Last modified: 2006-07-23 00:23:09 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 T8789, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 6789 - mysql_errno() Should Take Connection as Parameter
mysql_errno() Should Take Connection as Parameter
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.8.x
PC Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-23 00:13 UTC by Gregory Szorc
Modified: 2006-07-23 00:23 UTC (History)
0 users

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


Attachments

Description Gregory Szorc 2006-07-23 00:13:10 UTC
In Database.php, the fetchObject, fetchRow, and numRows functions all call
mysql_errno() without a parameter.  The functions should instead call
$this->lastErrno(), like the following:

if ( $this->lastErrno() ) { ... }

The reason is that mysql_errno() without a parameter will return the most recent
mysql error, not necessarily belonging to the mysql connection used by the
Database class.  If there are multiple mysql connection resources in one
instance of MediaWiki, possibly through an extension, and one of these triggers
an error, then MediaWiki will crash on the next database query.
Comment 1 Gregory Szorc 2006-07-23 00:23:09 UTC
Nevermind.  I was looking at the wrong revision of the tree when I saw the bug.
 Marking as invalid.

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


Navigation
Links