(bug 39287) Fixed error checking in DatabaseMysql::fetchObject.
authorTyler Anthony Romeo <tylerromeo@gmail.com>
Tue, 4 Sep 2012 03:55:18 +0000 (23:55 -0400)
committerAaron <aschulz@wikimedia.org>
Tue, 4 Sep 2012 18:41:58 +0000 (11:41 -0700)
commitb69cc58b7fda191872ebbc315ea635983d710c48
tree7bb3eb71a327948f80fbc527cd5a213964d31cfe
parent28678c3d07e6116b6fc0f2523180253746dc0c44
(bug 39287) Fixed error checking in DatabaseMysql::fetchObject.

According to the libmysql API documentation, mysql_fetch_row,
upon which the PHP functions mysql_fetch_object, etc. are
based on, does not reset the error number or message upon
success. So calling mysql_errno() after a successful fetch
may return the error of the previous function call.

This commit changes DatabaseMysql::fetchObject and similar
functions to only check for specific error numbers that are
explicitly documented to be expected from mysql_fetch_*.

Change-Id: Iacb78828885a8a0d4e499a681d938a6adf651582
includes/db/DatabaseMysql.php