https://bugzilla.wikimedia.org/show_bug.cgi?id=42430

--- Comment #10 from Sam Reed (reedy) <[email protected]> ---
Minimal test case confirms it's ok in vanilla PHP.


<?php

$sql = "SELECT * FROM wikidb.mw_user LIMIT 1";
$sql1 = "SELECT 1 FROM foobar LIMIT 1";

$con=mysql_connect("","","");

$result = mysql_query($sql, $con);
$result1 = mysql_query($sql1, $con);

var_dump( (bool)$result1 ); echo "\n";
echo mysql_num_rows( $result ) . "\n";

mysql_close($con);


-----------------------------------

    /**
     * @throws DBUnexpectedError
     * @param $res ResultWrapper
     * @return int
     */
    function numRows( $res ) {
        if ( $res instanceof ResultWrapper ) {
            $res = $res->result;
        }
        wfSuppressWarnings();
        $n = mysql_num_rows( $res );
        wfRestoreWarnings();
        if( $this->lastErrno() ) {
            throw new DBUnexpectedError( $this, 'Error in numRows(): ' .
htmlspecialchars( $this->lastError() ) );
        }
        return $n;
    }

It's strange, as the code in numRows() is very minimal and doesn't depend on
any class member variables

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to