Last modified: 2012-02-28 02:19:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36762, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34762 - Patching DatabaseMysql.php's close to meet specification
Patching DatabaseMysql.php's close to meet specification
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.20.x
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-27 21:00 UTC by christian
Modified: 2012-02-28 02:19 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Resetting mConn upon closing MySQL database connection (575 bytes, patch)
2012-02-27 21:00 UTC, christian
Details

Description christian 2012-02-27 21:00:41 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.
Comment 1 Mark A. Hershberger 2012-02-28 02:10:31 UTC
Why would you call ->close() twice anyway?  It seems like that is the bug that should be fixed.
Comment 2 Chad H. 2012-02-28 02:19:13 UTC
Fixed in r112565 for all DatabaseBase subclasses (except Sqlite, which wasn't affected).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links