Big commit: kill almost every freeResult() call as useless
authorChad Horohoe <demon@users.mediawiki.org>
Sun, 8 Aug 2010 12:27:48 +0000 (12:27 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sun, 8 Aug 2010 12:27:48 +0000 (12:27 +0000)
43 files changed:
config/Installer.php
includes/Article.php
includes/LinksUpdate.php
includes/QueryPage.php
includes/RecentChange.php
includes/SquidUpdate.php
includes/Title.php
includes/WatchedItem.php
includes/db/Database.php
includes/db/DatabaseIbm_db2.php
includes/db/DatabaseMssql.php
includes/db/DatabaseMysql.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php
includes/filerepo/File.php
includes/filerepo/LocalFile.php
includes/specials/SpecialAllmessages.php
includes/specials/SpecialDisambiguations.php
includes/specials/SpecialDoubleRedirects.php
includes/specials/SpecialExport.php
includes/specials/SpecialFileDuplicateSearch.php
includes/specials/SpecialNewimages.php
includes/specials/SpecialWatchlist.php
includes/specials/SpecialWhatlinkshere.php
maintenance/FiveUpgrade.inc
maintenance/attachLatest.php
maintenance/deleteOrphanedRevisions.php
maintenance/dumpSisterSites.php
maintenance/dumpUploads.php
maintenance/fixSlaveDesync.php
maintenance/fixTimestamps.php
maintenance/initEditCount.php
maintenance/namespaceDupes.php
maintenance/orphans.php
maintenance/rebuildImages.php
maintenance/rebuildrecentchanges.php
maintenance/rebuildtextindex.php
maintenance/storage/compressOld.inc
maintenance/storage/moveToExternal.php
maintenance/storage/resolveStubs.php
maintenance/updateArticleCount.php
maintenance/updaters.inc
maintenance/userDupes.inc

index a41dd7a..7ebc8bd 100644 (file)
@@ -1256,7 +1256,6 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                                                break;
                                        }
                                }
-                               $wgDatabase->freeResult( $res );
                                if ( !$found && $conf->DBengine != 'MyISAM' ) {
                                        echo "<li><strong>Warning:</strong> " . htmlspecialchars( $conf->DBengine ) .
                                                " storage engine not available, " .
index a8ad0c4..679bfcd 100644 (file)
@@ -2788,8 +2788,6 @@ class Article {
                        $onlyAuthor = false;
                }
 
-               $dbw->freeResult( $res );
-
                // Generate the summary with a '$1' placeholder
                if ( $blank ) {
                        // The current revision is blank and the one before is also
@@ -4311,8 +4309,6 @@ class Article {
                        }
                }
 
-               $dbr->freeResult( $res );
-
                return $result;
        }
 
@@ -4343,8 +4339,6 @@ class Article {
                        }
                }
 
-               $dbr->freeResult( $res );
-
                return $result;
        }
 
index 5fb7c05..af05746 100644 (file)
@@ -640,7 +640,6 @@ class LinksUpdate {
                        }
                        $arr[$row->pl_namespace][$row->pl_title] = 1;
                }
-               $this->mDb->freeResult( $res );
                return $arr;
        }
 
@@ -658,7 +657,6 @@ class LinksUpdate {
                        }
                        $arr[$row->tl_namespace][$row->tl_title] = 1;
                }
-               $this->mDb->freeResult( $res );
                return $arr;
        }
 
@@ -673,7 +671,6 @@ class LinksUpdate {
                while ( $row = $this->mDb->fetchObject( $res ) ) {
                        $arr[$row->il_to] = 1;
                }
-               $this->mDb->freeResult( $res );
                return $arr;
        }
 
@@ -688,7 +685,6 @@ class LinksUpdate {
                while ( $row = $this->mDb->fetchObject( $res ) ) {
                        $arr[$row->el_to] = 1;
                }
-               $this->mDb->freeResult( $res );
                return $arr;
        }
 
@@ -703,7 +699,6 @@ class LinksUpdate {
                while ( $row = $this->mDb->fetchObject( $res ) ) {
                        $arr[$row->cl_to] = $row->cl_sortkey;
                }
-               $this->mDb->freeResult( $res );
                return $arr;
        }
 
@@ -736,7 +731,6 @@ class LinksUpdate {
                        }
                        $arr[$row->iwl_prefix][$row->iwl_title] = 1;
                }
-               $this->mDb->freeResult( $res );
                return $arr;
        }
 
@@ -751,7 +745,6 @@ class LinksUpdate {
                while ( $row = $this->mDb->fetchObject( $res ) ) {
                        $arr[$row->pp_propname] = $row->pp_value;
                }
-               $this->mDb->freeResult( $res );
                return $arr;
        }
 
index b34768c..619c101 100644 (file)
@@ -264,13 +264,9 @@ class QueryPage {
                        if ( count( $vals ) ) {
                                if ( !$dbw->insert( 'querycache', $vals, __METHOD__ ) ) {
                                        // Set result to false to indicate error
-                                       $dbr->freeResult( $res );
                                        $res = false;
                                }
                        }
-                       if ( $res ) {
-                               $dbr->freeResult( $res );
-                       }
                        if ( $ignoreErrors ) {
                                $dbw->ignoreErrors( $ignoreW );
                                $dbr->ignoreErrors( $ignoreR );
@@ -492,7 +488,6 @@ class QueryPage {
                                $item = $this->feedResult( $obj );
                                if( $item ) $feed->outItem( $item );
                        }
-                       $dbr->freeResult( $res );
 
                        $feed->outFooter();
                        return true;
index 38c6b74..81e3b12 100644 (file)
@@ -73,7 +73,6 @@ class RecentChange {
                $res = $dbr->select( 'recentchanges', '*', array( 'rc_id' => $rcid ), __METHOD__ );
                if( $res && $dbr->numRows( $res ) > 0 ) {
                        $row = $dbr->fetchObject( $res );
-                       $dbr->freeResult( $res );
                        return self::newFromRow( $row );
                } else {
                        return null;
index 8944df8..d0fe51b 100644 (file)
@@ -46,7 +46,6 @@ class SquidUpdate {
                                $blurlArr[] = $tobj->getInternalURL();
                        }
                }
-               $dbr->freeResult ( $res ) ;
 
                wfProfileOut( __METHOD__ );
                return new SquidUpdate( $blurlArr );
index 9bb6f83..b47e8cc 100644 (file)
@@ -2804,7 +2804,6 @@ class Title {
                                }
                        }
                }
-               $db->freeResult( $res );
                return $retVal;
        }
 
@@ -3553,7 +3552,6 @@ class Title {
                        foreach ( $res as $row )
                                // $data[] = Title::newFromText($wgContLang->getNSText ( NS_CATEGORY ).':'.$row->cl_to);
                                $data[$wgContLang->getNSText( NS_CATEGORY ) . ':' . $row->cl_to] = $this->getFullText();
-                       $dbr->freeResult( $res );
                } else {
                        $data = array();
                }
index d1c1529..1fd6e31 100644 (file)
@@ -150,7 +150,6 @@ class WatchedItem {
                                'wl_title' => $newtitle
                        );
                }
-               $dbw->freeResult( $res );
 
                if( empty( $values ) ) {
                        // Nothing to do
index 5ebf0d5..54eb32c 100644 (file)
@@ -786,7 +786,6 @@ abstract class DatabaseBase {
                }
                $row = $this->fetchRow( $res );
                if ( $row !== false ) {
-                       $this->freeResult( $res );
                        return reset( $row );
                } else {
                        return false;
@@ -947,13 +946,10 @@ abstract class DatabaseBase {
                if ( $res === false )
                        return false;
                if ( !$this->numRows($res) ) {
-                       $this->freeResult($res);
                        return false;
                }
                $obj = $this->fetchObject( $res );
-               $this->freeResult( $res );
                return $obj;
-
        }
 
        /**
@@ -976,7 +972,6 @@ abstract class DatabaseBase {
                        $row = $this->fetchRow( $res );
                        $rows = ( isset( $row['rowcount'] ) ) ? $row['rowcount'] : 0;
                }
-               $this->freeResult( $res );
                return $rows;
        }
 
@@ -1056,7 +1051,6 @@ abstract class DatabaseBase {
                                $result[] = $row;
                        }
                }
-               $this->freeResult($res);
 
                return empty($result) ? false : $result;
        }
@@ -1069,12 +1063,7 @@ abstract class DatabaseBase {
                $old = $this->ignoreErrors( true );
                $res = $this->query( "SELECT 1 FROM $table LIMIT 1" );
                $this->ignoreErrors( $old );
-               if( $res ) {
-                       $this->freeResult( $res );
-                       return true;
-               } else {
-                       return false;
-               }
+               return (bool)$res;
        }
 
        /**
@@ -1658,7 +1647,6 @@ abstract class DatabaseBase {
                $sql = "SHOW COLUMNS FROM $table LIKE \"$field\";";
                $res = $this->query( $sql, 'Database::textFieldSize' );
                $row = $this->fetchObject( $res );
-               $this->freeResult( $res );
 
                $m = array();
                if ( preg_match( '/\((.*)\)/', $row->Type, $m ) ) {
@@ -1926,7 +1914,6 @@ abstract class DatabaseBase {
                $sql = "SELECT MASTER_POS_WAIT($encFile, $encPos, $timeout)";
                $res = $this->doQuery( $sql );
                if ( $res && $row = $this->fetchRow( $res ) ) {
-                       $this->freeResult( $res );
                        wfProfileOut( $fname );
                        return $row[0];
                } else {
index be3851a..f74721a 100644 (file)
@@ -1005,7 +1005,6 @@ EOF;
                $res = $this->query( "VALUES NEXTVAL FOR $safeseq" );
                $row = $this->fetchRow( $res );
                $this->mInsertId = $row[0];
-               $this->freeResult( $res );
                return $this->mInsertId;
                */
                return null;
@@ -1604,7 +1603,6 @@ SQL;
                $res = $this->query($sql);
                $row = $this->fetchObject($res);
                $size = $row->size;
-               $this->freeResult( $res );
                return $size;
        }
        
index a8b7d86..f972027 100644 (file)
@@ -327,7 +327,6 @@ class DatabaseMssql extends DatabaseBase {
                if ( $res ) {
                        $row = $this->fetchRow( $res );
                        if ( isset( $row['EstimateRows'] ) ) $rows = $row['EstimateRows'];
-                       $this->freeResult( $res );
                }
                return $rows;
        }
@@ -666,7 +665,6 @@ class DatabaseMssql extends DatabaseBase {
                $row = $this->fetchRow( $res );
                $size = -1;
                if ( strtolower( $row['DATA_TYPE'] ) != 'text' ) $size = $row['CHARACTER_MAXIMUM_LENGTH'];
-               $this->freeResult( $res );
                return $size;
        }
 
index c49470b..b221893 100644 (file)
@@ -256,7 +256,6 @@ class DatabaseMysql extends DatabaseBase {
                if ( $res === false )
                        return false;
                if ( !$this->numRows( $res ) ) {
-                       $this->freeResult($res);
                        return 0;
                }
 
@@ -264,8 +263,6 @@ class DatabaseMysql extends DatabaseBase {
                while( $plan = $this->fetchObject( $res ) ) {
                        $rows *= $plan->rows > 0 ? $plan->rows : 1; // avoid resetting to zero
                }
-
-               $this->freeResult($res);
                return $rows;
        }
 
@@ -382,7 +379,6 @@ class DatabaseMysql extends DatabaseBase {
                $lockName = $this->addQuotes( $lockName );
                $result = $this->query( "SELECT GET_LOCK($lockName, $timeout) AS lockstatus", $method );
                $row = $this->fetchObject( $result );
-               $this->freeResult( $result );
 
                if( $row->lockstatus == 1 ) {
                        return true;
index 8bfcf2b..4cdea73 100644 (file)
@@ -654,7 +654,6 @@ class DatabaseOracle extends DatabaseBase {
                $res = $this->query( "SELECT $seqName.nextval FROM dual" );
                $row = $this->fetchRow( $res );
                $this->mInsertId = $row[0];
-               $this->freeResult( $res );
                return $this->mInsertId;
        }
 
index 34bf99c..b956a6b 100644 (file)
@@ -726,7 +726,6 @@ class DatabasePostgres extends DatabaseBase {
                        if( preg_match( '/rows=(\d+)/', $row[0], $count ) ) {
                                $rows = $count[1];
                        }
-                       $this->freeResult($res);
                }
                return $rows;
        }
@@ -993,7 +992,6 @@ class DatabasePostgres extends DatabaseBase {
                $res = $this->query( "SELECT nextval('$safeseq')" );
                $row = $this->fetchRow( $res );
                $this->mInsertId = $row[0];
-               $this->freeResult( $res );
                return $this->mInsertId;
        }
 
@@ -1005,7 +1003,6 @@ class DatabasePostgres extends DatabaseBase {
                $res = $this->query( "SELECT currval('$safeseq')" );
                $row = $this->fetchRow( $res );
                $currval = $row[0];
-               $this->freeResult( $res );
                return $currval;
        }
 
@@ -1098,7 +1095,6 @@ class DatabasePostgres extends DatabaseBase {
                } else {
                        $size=$row->size;
                }
-               $this->freeResult( $res );
                return $size;
        }
 
@@ -1188,8 +1184,6 @@ class DatabasePostgres extends DatabaseBase {
                        . "AND c.relkind IN ('" . implode("','", $types) . "')";
                $res = $this->query( $SQL );
                $count = $res ? $res->numRows() : 0;
-               if ($res)
-                       $this->freeResult( $res );
                return $count ? true : false;
        }
 
@@ -1221,7 +1215,6 @@ SQL;
                if (!$res)
                        return null;
                $rows = $res->numRows();
-               $this->freeResult( $res );
                return $rows;
        }
 
@@ -1245,7 +1238,6 @@ SQL;
                if (!$res)
                        return null;
                $rows = $res->numRows();
-               $this->freeResult($res);
                return $rows;
        }
 
@@ -1263,8 +1255,6 @@ SQL;
                } else {
                        $owner = false;
                }
-               if ($res)
-                       $this->freeResult($res);
                return $owner;
        }
 
index a9c6437..a3b62f8 100644 (file)
@@ -893,7 +893,6 @@ abstract class File {
                                }
                        }
                }
-               $db->freeResult( $res );
                wfProfileOut( __METHOD__ );
                return $retVal;
        }
index 3dd294c..86ee34d 100644 (file)
@@ -697,12 +697,10 @@ class LocalFile extends File {
                                $fname
                        );
                        if ( 0 == $dbr->numRows( $this->historyRes ) ) {
-                               $dbr->freeResult( $this->historyRes );
                                $this->historyRes = null;
                                return false;
                        }
                } elseif ( $this->historyLine == 1 ) {
-                       $dbr->freeResult( $this->historyRes );
                        $this->historyRes = $dbr->select( 'oldimage', '*',
                                array( 'oi_name' => $this->title->getDBkey() ),
                                $fname,
@@ -720,7 +718,6 @@ class LocalFile extends File {
        public function resetHistory() {
                $this->historyLine = 0;
                if ( !is_null( $this->historyRes ) ) {
-                       $this->repo->getSlaveDB()->freeResult( $this->historyRes );
                        $this->historyRes = null;
                }
        }
@@ -1827,7 +1824,6 @@ class LocalFileMoveBatch {
                                "{$archiveBase}/{$this->newHash}{$timestamp}!{$this->newName}"
                        );
                }
-               $this->db->freeResult( $result );
        }
 
        /**
index ec6a09e..fcbac9e 100644 (file)
@@ -241,7 +241,6 @@ class AllmessagesTablePager extends TablePager {
                                $talkFlags[$s->page_title] = true;
                        }
                }
-               $dbr->freeResult( $res );
 
                wfProfileOut( __METHOD__ . '-db' );
 
index 3da912e..0081331 100644 (file)
@@ -67,8 +67,6 @@ class DisambiguationsPage extends PageQueryPage {
                                while ( $row = $dbr->fetchObject( $res ) ) {
                                        $linkBatch->addObj( Title::makeTitle( NS_TEMPLATE, $row->pl_title ));
                                }
-
-                               $dbr->freeResult( $res );
                }
 
                $set = $linkBatch->constructSet( 'lb.tl', $dbr );
index 566f8f6..30f84f0 100644 (file)
@@ -85,7 +85,6 @@ class DoubleRedirectsPage extends PageQueryPage {
                        $res = $dbr->query( $sql, $fname );
                        if ( $res ) {
                                $result = $dbr->fetchObject( $res );
-                               $dbr->freeResult( $res );
                        }
                }
                if ( !$result ) {
index cec5c47..86e8a1f 100644 (file)
@@ -319,9 +319,6 @@ class SpecialExport extends SpecialPage {
 
                        $pages[] = $n;
                }
-               
-               $dbr->freeResult($res);
-
                return $pages;
        }
 
@@ -349,9 +346,6 @@ class SpecialExport extends SpecialPage {
 
                        $pages[] = $n;
                }
-               
-               $dbr->freeResult( $res );
-
                return $pages;
        }
 
index f162ff7..2d28295 100644 (file)
@@ -100,7 +100,6 @@ function wfSpecialFileDuplicateSearch( $par = null ) {
                if( $row !== false ) {
                        $hash = $row[0];
                }
-               $dbr->freeResult( $res );
        }
 
        # Create the input form
index 0f183d1..91d7ee6 100644 (file)
@@ -67,7 +67,6 @@ function wfSpecialNewimages( $par, $specialPage ) {
        } else {
                $ts = false;
        }
-       $dbr->freeResult( $res );
        $sql = '';
 
        # If we were clever, we'd use this to cache.
@@ -125,7 +124,6 @@ function wfSpecialNewimages( $par, $specialPage ) {
                        array_push( $images, $s );
                }
        }
-       $dbr->freeResult( $res );
 
        $gallery = new ImageGallery();
        $firstTimestamp = null;
index d6628dc..52ac4a5 100644 (file)
@@ -386,7 +386,6 @@ function wfSpecialWatchlist( $par ) {
        }
        $s .= $list->endRecentChangesList();
 
-       $dbr->freeResult( $res );
        $wgOut->addHTML( $s );
 }
 
@@ -478,7 +477,6 @@ function wlCountItems( &$user, $talk = true ) {
                array( 'wl_user' => $user->mId ), 'wlCountItems' );
        $row = $dbr->fetchObject( $res );
        $count = $row->count;
-       $dbr->freeResult( $res );
 
        # Halve to remove talk pages if needed
        if( !$talk )
index ac2f931..f9a0314 100644 (file)
@@ -189,8 +189,6 @@ class SpecialWhatLinksHere extends SpecialPage {
                                $row->is_image = 0;
                                $rows[$row->page_id] = $row;
                        }
-                       $dbr->freeResult( $plRes );
-
                }
                if( !$hidetrans ) {
                        while ( $row = $dbr->fetchObject( $tlRes ) ) {
@@ -198,7 +196,6 @@ class SpecialWhatLinksHere extends SpecialPage {
                                $row->is_image = 0;
                                $rows[$row->page_id] = $row;
                        }
-                       $dbr->freeResult( $tlRes );
                }
                if( !$hideimages ) {
                        while ( $row = $dbr->fetchObject( $ilRes ) ) {
@@ -206,7 +203,6 @@ class SpecialWhatLinksHere extends SpecialPage {
                                $row->is_image = 1;
                                $rows[$row->page_id] = $row;
                        }
-                       $dbr->freeResult( $ilRes );
                }
 
                // Sort by key and then change the keys to 0-based indices
index 00b532b..fd4bb86 100644 (file)
@@ -336,7 +336,6 @@ class FiveUpgrade {
                        $this->addChunk( $add );
                }
                $this->lastChunk( $add );
-               $this->dbr->freeResult( $result );
 
                $this->log( "Done converting $name." );
                $this->cleanupSwaps[] = $name;
@@ -444,7 +443,6 @@ class FiveUpgrade {
                        $this->addChunk( $add, $row->cur_id );
                }
                $this->lastChunk( $add );
-               $this->dbr->freeResult( $result );
 
                /**
                 * Copy revision metadata from old into revision.
@@ -477,7 +475,6 @@ class FiveUpgrade {
                        $this->addChunk( $add );
                }
                $this->lastChunk( $add );
-               $this->dbr->freeResult( $result );
 
 
                /**
@@ -510,7 +507,6 @@ class FiveUpgrade {
                        $this->addChunk( $add );
                }
                $this->lastChunk( $add );
-               $this->dbr->freeResult( $result );
 
                $this->log( "...done with cur/old -> page/revision." );
        }
@@ -902,7 +898,6 @@ END;
                        $this->addChunk( $add );
                }
                $this->lastChunk( $add );
-               $this->dbr->freeResult( $result );
 
                $this->log( 'Done converting watchlist.' );
                $this->cleanupSwaps[] = 'watchlist';
index ae528bb..6db5d6d 100644 (file)
@@ -69,7 +69,6 @@ class AttachLatest extends Maintenance {
                        }
                        $n++;
                }
-               $dbw->freeResult( $result );
                $this->output( "Done! Processed $n pages.\n" );
                if ( !$this->hasOption( 'fix' ) ) {
                        $this->output( "This was a dry run; rerun with --fix to update page_latest.\n" );
index 4986788..73068cc 100644 (file)
@@ -51,7 +51,6 @@ class DeleteOrphanedRevisions extends Maintenance {
                $revisions = array();
                foreach ( $res as $row )
                        $revisions[] = $row->rev_id;
-               $dbw->freeResult( $res );
                $count = count( $revisions );
                $this->output( "found {$count}.\n" );
        
index bc4acd8..75b7a00 100644 (file)
@@ -48,7 +48,6 @@ class DumpSisterSites extends Maintenance {
                        $text = $title->getPrefixedText();
                        $this->output( "$url $text\n" );
                }
-               $dbr->freeResult( $result );
        }
 }
 
index ff6bfdd..726153f 100644 (file)
@@ -82,7 +82,6 @@ By default, outputs relative paths against the parent directory of \$wgUploadDir
                foreach ( $result as $row ) {
                        $this->outputItem( $row->il_to, $shared );
                }
-               $dbr->freeResult( $result );
        }
 
        /**
@@ -100,7 +99,6 @@ By default, outputs relative paths against the parent directory of \$wgUploadDir
                foreach ( $result as $row ) {
                        $this->outputItem( $row->img_name, $shared );
                }
-               $dbr->freeResult( $result );
        }
        
        function outputItem( $name, $shared ) {
index c07ee0d..b282510 100644 (file)
@@ -66,7 +66,6 @@ class FixSlaveDesync extends Maintenance {
                        }
                }
                $this->output( "\n" );
-               $dbw->freeResult( $res );
 
                global $slaveIndexes;
                foreach ( $slaveIndexes as $i ) {
@@ -78,7 +77,6 @@ class FixSlaveDesync extends Maintenance {
                                        $this->output( $row->page_id . "\t" );
                                }
                        }
-                       $db->freeResult( $res );
                }
                $this->output( "\n" );
                return $desync;
@@ -128,14 +126,12 @@ class FixSlaveDesync extends Maintenance {
                foreach ( $res as $row ) {
                        $masterIDs[] = $row->rev_id;
                }
-               $dbw->freeResult( $res );
 
                $res = $db->select( 'revision', array( 'rev_id' ), array( 'rev_page' => $pageID ), __METHOD__ );
                $slaveIDs = array();
                foreach ( $res as $row ) {
                        $slaveIDs[] = $row->rev_id;
                }
-               $db->freeResult( $res );
                if ( count( $masterIDs ) < count( $slaveIDs ) ) {
                        $missingIDs = array_diff( $slaveIDs, $masterIDs );
                        if ( count( $missingIDs ) ) {
index d258287..c6046ca 100644 (file)
@@ -89,7 +89,6 @@ class FixTimestamps extends Maintenance {
                                $badRevs[] = $row->rev_id;
                        }
                }
-               $dbw->freeResult( $res );
        
                $numBadRevs = count( $badRevs );
                if ( $numBadRevs > $numGoodRevs ) {
index 02eb623..3ca067c 100644 (file)
@@ -80,7 +80,6 @@ in $wgDBservers, usually indicating a replication environment.' );
                                                __METHOD__ );
                                        ++$migrated;
                                }
-                               $dbr->freeResult( $result );
 
                                $delta = microtime( true ) - $start;
                                $rate = ( $delta == 0.0 ) ? 0.0 : $migrated / $delta;
index 66af835..13dfd9f 100644 (file)
@@ -142,7 +142,6 @@ class NamespaceConflictChecker extends Maintenance {
                foreach ( $result as $row ) {
                        $prefixes[] = $row->iw_prefix;
                }
-               $this->db->freeResult( $result );
                return $prefixes;
        }
 
@@ -214,8 +213,6 @@ class NamespaceConflictChecker extends Maintenance {
                foreach ( $result as $row ) {
                        $set[] = $row;
                }
-               $this->db->freeResult( $result );
-
                return $set;
        }
 
index 4a04a93..a82fa40 100644 (file)
@@ -184,7 +184,6 @@ class Orphans extends Maintenance {
                                WHERE rev_page=$row->page_id
                        " );
                        $row2 = $dbw->fetchObject( $result2 );
-                       $dbw->freeResult( $result2 );
                        if ( $row2 ) {
                                if ( $row->rev_timestamp != $row2->max_timestamp ) {
                                        if ( $found == 0 ) {
index 52cfd48..5788124 100644 (file)
@@ -112,7 +112,6 @@ class ImageBuilder extends FiveUpgrade {
                        }
                }
                $this->log( "Finished $table... $this->updated of $this->processed rows updated" );
-               $this->dbr->freeResult( $result );
        }
 
        function buildImage() {
index d38a75a..2b96645 100644 (file)
@@ -129,7 +129,6 @@ class RebuildRecentchanges extends Maintenance {
                                        $lastSize = 'NULL';
                                        $new = 1; // probably true
                                }
-                               $dbw->freeResult( $res2 );
                        }
                        if ( $lastCurId == 0 ) {
                                $this->output( "Uhhh, something wrong? No curid\n" );
@@ -147,7 +146,6 @@ class RebuildRecentchanges extends Maintenance {
                                $lastSize = $size;
                        }
                }
-               $dbw->freeResult( $res );
        }
 
        /**
@@ -272,8 +270,6 @@ class RebuildRecentchanges extends Maintenance {
                                $dbw->query( $sql2 );
                        }
                }
-       
-               $dbw->freeResult( $res );
        }
 
        /**
index beb7a57..fd2d159 100644 (file)
@@ -87,7 +87,6 @@ class RebuildTextIndex extends Maintenance {
                                $u = new SearchUpdate( $s->page_id, $s->page_title, $revtext );
                                $u->doUpdate();
                        }
-                       $this->db->freeResult( $res );
                        $n += self::RTI_CHUNK_SIZE;
                }
        }
index 981cfda..e5d5fe9 100644 (file)
@@ -23,7 +23,6 @@ function compressOldPages( $start = 0, $extdb = '' ) {
                        compressPage( $row, $extdb );
                        $last = $row->old_id;
                }
-               $dbw->freeResult( $res );
                $start = $last + 1; # Deletion may leave long empty stretches
                print "$start...\n";
        } while( true );
index c2ed85b..ec1c4c6 100644 (file)
@@ -111,7 +111,6 @@ function moveToExternal( $cluster, $maxID, $minID = 1 ) {
                                array( 'old_id' => $id ), $fname );
                        $numMoved++;
                }
-               $dbr->freeResult( $res );
        }
 }
 
index b32c72f..ff1b010 100644 (file)
@@ -40,10 +40,7 @@ function resolveStubs() {
                        $fname );
                while ( $row = $dbr->fetchObject( $res ) ) {
                        resolveStub( $row->old_id, $row->old_text, $row->old_flags );
-               }
-               $dbr->freeResult( $res );
-
-               
+               }               
        }
        print "100%\n";
 }
index 367ee07..bf9042e 100644 (file)
@@ -92,7 +92,6 @@ class UpdateArticleCount extends Maintenance {
                $dbr = wfGetDB( DB_SLAVE );
                $res = $dbr->query( $this->makeSql( $dbr ), __METHOD__ );
                $row = $dbr->fetchObject( $res );
-               $dbr->freeResult( $res );
                return $row ? $row->pagecount : false;
        }
 }
index a5e3fdc..86adf5a 100644 (file)
@@ -327,7 +327,6 @@ function check_bin( $table, $field, $patchFile ) {
        $tableName = $wgDatabase->tableName( $table );
        $res = $wgDatabase->query( "SELECT $field FROM $tableName LIMIT 0" );
        $flags = explode( ' ', mysql_field_flags( $res->result, 0 ) );
-       $wgDatabase->freeResult( $res );
 
        if ( in_array( 'binary', $flags ) ) {
                wfOut( "...$table table has correct $field encoding.\n" );
@@ -550,7 +549,6 @@ function do_namespace_size_on( $table, $prefix ) {
        $tablename = $wgDatabase->tableName( $table );
        $result = $wgDatabase->query( "SHOW COLUMNS FROM $tablename LIKE '$field'" );
        $info = $wgDatabase->fetchObject( $result );
-       $wgDatabase->freeResult( $result );
 
        if ( substr( $info->Type, 0, 3 ) == 'int' ) {
                wfOut( "...$field is already a full int ($info->Type).\n" );
@@ -698,7 +696,6 @@ function do_user_groups_update() {
                                $fname );
                }
        }
-       $wgDatabase->freeResult( $result );
        wfOut( "ok\n" );
 }
 
@@ -793,7 +790,6 @@ function do_templatelinks_update() {
                        );
 
                }
-               $wgDatabase->freeResult( $res );
        } else {
                // Fast update
                $wgDatabase->insertSelect( 'templatelinks', 'pagelinks',
@@ -1241,14 +1237,12 @@ END;
                return null;
        }
        if ( !( $r = $wgDatabase->fetchRow( $res ) ) ) {
-               $wgDatabase->freeResult( $res );
                return null;
        }
 
        $indkey = $r[0];
        $relid = intval( $r[1] );
        $indkeys = explode( " ", $indkey );
-       $wgDatabase->freeResult( $res );
 
        $colnames = array();
        foreach ( $indkeys as $rid ) {
@@ -1263,11 +1257,9 @@ END;
                        return null;
                }
                if ( !( $row2 = $wgDatabase->fetchRow( $r2 ) ) ) {
-                       $wgDatabase->freeResult( $r2 );
                        return null;
                }
                $colnames[] = $row2[0];
-               $wgDatabase->freeResult( $r2 );
        }
 
        return $colnames;
@@ -1316,7 +1308,6 @@ END;
                return null;
        }
        $d = $row[0];
-       $wgDatabase->freeResult( $r );
        return $d;
 }
 
index 86d5e00..668d0bc 100644 (file)
@@ -193,8 +193,6 @@ class UserDupes {
                while ( $row = $this->db->fetchObject( $result ) ) {
                        $list[] = $row->user_name;
                }
-               $this->db->freeResult( $result );
-
                return $list;
        }
 
@@ -246,7 +244,6 @@ class UserDupes {
                        }
                        wfOut( "\n" );
                }
-               $this->db->freeResult( $result );
        }
 
        /**