Last modified: 2013-01-28 11:43:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 24712 - Remove superfluous db freeResult calls
Remove superfluous db freeResult calls
Status: NEW
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.21.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2010-08-07 13:59 UTC by Sam Reed (reedy)
Modified: 2013-01-28 11:43 UTC (History)
4 users (show)

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


Attachments

Description Sam Reed (reedy) 2010-08-07 13:59:25 UTC
Are all (or at least most) of the various freeResult calls on DB objects superfluous? i.e. Shouldn't code scope take care of them?
Comment 1 Sam Reed (reedy) 2010-08-07 14:00:53 UTC
There's 116 or so in phase3 alone, and no doubt, many more in extensions
Comment 2 Sam Reed (reedy) 2010-08-09 20:30:06 UTC
r70686 looks like Chad has done most of them...
Comment 3 Sam Reed (reedy) 2010-08-09 20:57:34 UTC
Search "->freeResult" (14 hits in 4 files)
  R:\Programming\SVN\mediawiki\trunk\phase3\includes\db\Database.php (1 hits)
	Line 2788: 		$this->db->freeResult( $this );
  R:\Programming\SVN\mediawiki\trunk\phase3\maintenance\convertLinks.inc (3 hits)
	Line 60: 	$dbw->freeResult( $res );
	Line 91: 		$dbw->freeResult( $res );
	Line 131: 			$dbw->freeResult( $res );
  R:\Programming\SVN\mediawiki\trunk\phase3\maintenance\convertLinks.php (3 hits)
	Line 83: 		$dbw->freeResult( $res );
	Line 114: 			$dbw->freeResult( $res );
	Line 154: 				$dbw->freeResult( $res );
  R:\Programming\SVN\mediawiki\trunk\phase3\maintenance\storage\checkStorage.php (7 hits)
	Line 76: 			$dbr->freeResult( $res );
	Line 129: 			$dbr->freeResult( $res );
	Line 162: 				$dbr->freeResult( $res );
	Line 183: 					$extDb->freeResult( $res );
	Line 241: 				$dbr->freeResult( $res );
	Line 279: 				$dbr->freeResult( $res );
	Line 366: 			$extDb->freeResult( $res );
Comment 4 Domas Mituzas 2010-08-10 07:00:10 UTC
are you sure scope takes care of them?
Comment 5 Andre Klapper 2013-01-28 11:43:48 UTC
Still valid in 1.21wmf8:

$:andre\> grep -r "\->freeResult" .
./includes/db/DatabaseUtility.php:	$this->db->freeResult( $this );
./maintenance/storage/checkStorage.php:	$dbr->freeResult( $res );
./maintenance/storage/checkStorage.php:	$dbr->freeResult( $res );
./maintenance/storage/checkStorage.php:	$dbr->freeResult( $res );
./maintenance/storage/checkStorage.php:	$extDb->freeResult( $res );
./maintenance/storage/checkStorage.php:	$dbr->freeResult( $res );
./maintenance/storage/checkStorage.php:	$dbr->freeResult( $res );
./maintenance/storage/checkStorage.php:	$extDb->freeResult( $res );
./maintenance/convertLinks.php:		$dbw->freeResult( $res );
./maintenance/convertLinks.php:		$dbw->freeResult( $res );
./maintenance/convertLinks.php:		$dbw->freeResult( $res );

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


Navigation
Links