Didn't check return value of select #17

wants to merge 2 commits into


None yet

3 participants

hexmode commented Jan 22, 2013

select can return false.


You can test for false.

if ($res === false)

Note the three equals signs. This tests for type and value equality.


Yes, but an db object won't evaluate as false, so this is safe. I've nothing against the === operator if you prefer that, though.

reedy commented Mar 30, 2013
 * @return ResultWrapper. If the query returned no rows, a ResultWrapper
 *   with no rows in it will be returned. If there was a query error, a
 *   DBQueryError exception will be thrown, except if the "ignore errors"
 *   option was set, in which case false will be returned.

For MediaWiki usage, you're really only going to get a ResultWrapper object or false. If it throws an exception we don't care what the return value is anyway


Cannot be automatically merged. r- until resubmitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment