Last modified: 2013-01-28 11:43:48 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 T26712, the corresponding Phabricator task for complete and up-to-date bug report information.
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