Last modified: 2012-02-28 02:19:13 UTC
Created attachment 10120 [details] Resetting mConn upon closing MySQL database connection The documentation of the close function in includesDatabase.php:730--736 says that 'close' should return true, when called for an already closed connection. Calling close on an already closed DatabaseMysql object fails, by something like: -----8<------ PHP Warning: mysql_close(): 4 is not a valid MySQL-Link resource in /home/christian/sources/Wikimedia/shreddingPHPUnit/dummy.php on line 13 Warning: mysql_close(): 4 is not a valid MySQL-Link resource in /home/christian/sources/Wikimedia/shreddingPHPUnit/dummy.php on line 13 -----8<------ The problem seems to be that mConn is not cleared upon closing DatabaseMysql. The attached patch resolves this issue.
Why would you call ->close() twice anyway? It seems like that is the bug that should be fixed.
Fixed in r112565 for all DatabaseBase subclasses (except Sqlite, which wasn't affected).