Nuke $db->freeResult() from Api stuffs
authorSam Reed <reedy@users.mediawiki.org>
Sun, 20 Jun 2010 17:48:21 +0000 (17:48 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 20 Jun 2010 17:48:21 +0000 (17:48 +0000)
29 files changed:
includes/api/ApiPageSet.php
includes/api/ApiQueryAllCategories.php
includes/api/ApiQueryAllLinks.php
includes/api/ApiQueryAllUsers.php
includes/api/ApiQueryAllimages.php
includes/api/ApiQueryAllpages.php
includes/api/ApiQueryBacklinks.php
includes/api/ApiQueryCategories.php
includes/api/ApiQueryCategoryInfo.php
includes/api/ApiQueryCategoryMembers.php
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryDuplicateFiles.php
includes/api/ApiQueryExtLinksUsage.php
includes/api/ApiQueryExternalLinks.php
includes/api/ApiQueryFilearchive.php
includes/api/ApiQueryIWBacklinks.php
includes/api/ApiQueryIWLinks.php
includes/api/ApiQueryImages.php
includes/api/ApiQueryInfo.php
includes/api/ApiQueryLangLinks.php
includes/api/ApiQueryLinks.php
includes/api/ApiQueryLogEvents.php
includes/api/ApiQueryProtectedTitles.php
includes/api/ApiQueryRandom.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryRevisions.php
includes/api/ApiQuerySiteinfo.php
includes/api/ApiQueryUserContributions.php
includes/api/ApiQueryWatchlist.php

index 7010d8f..554ae76 100644 (file)
@@ -472,7 +472,6 @@ class ApiPageSet extends ApiQueryBase {
                        // Store any extra fields requested by modules
                        $this->processDbRow( $row );
                }
-               $db->freeResult( $res );
 
                if ( isset( $remaining ) ) {
                        // Any items left in the $remaining list are added as missing
@@ -527,7 +526,6 @@ class ApiPageSet extends ApiQueryBase {
                        $pageids[$pageid] = '';
                        unset( $remaining[$revid] );
                }
-               $db->freeResult( $res );
                $this->profileDBOut();
 
                $this->mMissingRevIDs = array_keys( $remaining );
@@ -606,7 +604,7 @@ class ApiPageSet extends ApiQueryBase {
                        }
                        $this->mRedirectTitles[$from] = $to;
                }
-               $db->freeResult( $res );
+
                if ( $this->mPendingRedirectIDs ) {
                        // We found pages that aren't in the redirect table
                        // Add them
index cca846a..be2d9cf 100644 (file)
@@ -117,7 +117,6 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
                                }
                        }
                }
-               $db->freeResult( $res );
 
                if ( is_null( $resultPageSet ) ) {
                        $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'c' );
index cf6d2ab..ced7e0c 100644 (file)
@@ -145,7 +145,6 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                                $pageids[] = $row->pl_from;
                        }
                }
-               $db->freeResult( $res );
 
                if ( is_null( $resultPageSet ) ) {
                        $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'l' );
index 85a203f..fcb8ba1 100644 (file)
@@ -187,8 +187,6 @@ class ApiQueryAllUsers extends ApiQueryBase {
                        }
                }
 
-               $db->freeResult( $res );
-
                $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'u' );
        }
 
index 8692e1b..b8946e8 100644 (file)
@@ -134,7 +134,6 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase {
                                $titles[] = Title::makeTitle( NS_IMAGE, $row->img_name );
                        }
                }
-               $db->freeResult( $res );
 
                if ( is_null( $resultPageSet ) ) {
                        $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'img' );
index f9b503b..61f3414 100644 (file)
@@ -174,7 +174,6 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
                                $resultPageSet->processDbRow( $row );
                        }
                }
-               $db->freeResult( $res );
 
                if ( is_null( $resultPageSet ) ) {
                        $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'p' );
index a78bf08..4faba6f 100644 (file)
@@ -232,7 +232,6 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                                $resultPageSet->processDbRow( $row );
                        }
                }
-               $db->freeResult( $res );
 
                if ( $this->redirect && count( $this->redirTitles ) ) {
                        $this->resetQueryParams();
@@ -258,7 +257,6 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                                        $resultPageSet->processDbRow( $row );
                                }
                        }
-                       $db->freeResult( $res );
                }
                if ( is_null( $resultPageSet ) ) {
                        // Try to add the result data in one go and pray that it fits
index ff52598..fb7bd14 100644 (file)
@@ -174,8 +174,6 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
                        }
                        $resultPageSet->populateFromTitles( $titles );
                }
-
-               $db->freeResult( $res );
        }
 
        public function getAllowedParams() {
index f4f9522..17ddf0c 100644 (file)
@@ -93,7 +93,6 @@ class ApiQueryCategoryInfo extends ApiQueryBase {
                                break;
                        }
                }
-               $db->freeResult( $res );
        }
 
        public function getAllowedParams() {
index 774e596..479a804 100644 (file)
@@ -160,7 +160,6 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
                        }
                        $lastSortKey = $row->cl_sortkey; // detect duplicate sortkeys
                }
-               $db->freeResult( $res );
 
                if ( is_null( $resultPageSet ) ) {
                        $this->getResult()->setIndexedTagName_internal(
index 49bfafb..4740621 100644 (file)
@@ -248,7 +248,6 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                                break;
                        }
                }
-               $db->freeResult( $res );
                $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'page' );
        }
 
index 6be546e..494ea09 100644 (file)
@@ -121,7 +121,6 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase {
                if ( !is_null( $resultPageSet ) ) {
                        $resultPageSet->populateFromTitles( $titles );
                }
-               $db->freeResult( $res );
        }
 
        public function getAllowedParams() {
index 34e3c94..c17f0af 100644 (file)
@@ -141,7 +141,6 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
                                $resultPageSet->processDbRow( $row );
                        }
                }
-               $db->freeResult( $res );
 
                if ( is_null( $resultPageSet ) ) {
                        $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ),
index 057ecfa..bc33f33 100644 (file)
@@ -82,7 +82,6 @@ class ApiQueryExternalLinks extends ApiQueryBase {
                                break;
                        }
                }
-               $db->freeResult( $res );
        }
 
        public function getAllowedParams() {
index 70c8a98..08a75e3 100644 (file)
@@ -166,7 +166,6 @@ class ApiQueryFilearchive extends ApiQueryBase {
                                break;
                        }
                }
-               $db->freeResult( $res );
 
                $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'fa' );
        }
index 3324bfa..bc4c6cd 100644 (file)
@@ -111,7 +111,6 @@ class ApiQueryIWBacklinks extends ApiQueryBase {
                                break;
                        }
                }
-               $db->freeResult( $res );
 
                $this->getResult()->setIndexedTagName_internal(
                        array( 'query', $this->getModuleName() ),
index 7d13f07..b932c11 100644 (file)
@@ -107,7 +107,6 @@ class ApiQueryIWLinks extends ApiQueryBase {
                                break;
                        }
                }
-               $db->freeResult( $res );
        }
 
        public function getAllowedParams() {
index b6dfc1a..1804ce4 100644 (file)
@@ -120,8 +120,6 @@ class ApiQueryImages extends ApiQueryGeneratorBase {
                        }
                        $resultPageSet->populateFromTitles( $titles );
                }
-
-               $db->freeResult( $res );
        }
 
        public function getAllowedParams() {
index 88d2166..15bb1a8 100644 (file)
@@ -416,7 +416,6 @@ class ApiQueryInfo extends ApiQueryBase {
                                        }
                                }
                        }
-                       $db->freeResult( $res );
                }
 
                // Get protections for missing titles
@@ -434,7 +433,6 @@ class ApiQueryInfo extends ApiQueryBase {
                                        'expiry' => Block::decodeExpiry( $row->pt_expiry, TS_ISO_8601 )
                                );
                        }
-                       $db->freeResult( $res );
                }
 
                // Cascading protections
@@ -470,7 +468,6 @@ class ApiQueryInfo extends ApiQueryBase {
                                        'source' => $source->getPrefixedText()
                                );
                        }
-                       $db->freeResult( $res );
                }
 
                if ( count( $images ) ) {
@@ -494,7 +491,6 @@ class ApiQueryInfo extends ApiQueryBase {
                                        'source' => $source->getPrefixedText()
                                );
                        }
-                       $db->freeResult( $res );
                }
        }
 
index 10aad5a..d4fc38f 100644 (file)
@@ -94,7 +94,6 @@ class ApiQueryLangLinks extends ApiQueryBase {
                                break;
                        }
                }
-               $db->freeResult( $res );
        }
 
        public function getAllowedParams() {
index 202b772..5f5cf92 100644 (file)
@@ -178,8 +178,6 @@ class ApiQueryLinks extends ApiQueryGeneratorBase {
                        }
                        $resultPageSet->populateFromTitles( $titles );
                }
-
-               $db->freeResult( $res );
        }
 
        public function getAllowedParams() {
index 5d453ee..2858726 100644 (file)
@@ -171,8 +171,6 @@ class ApiQueryLogEvents extends ApiQueryBase {
                                break;
                        }
                }
-               $db->freeResult( $res );
-
                $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'item' );
        }
 
index 7f758fc..0162b88 100644 (file)
@@ -123,7 +123,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
                                $titles[] = $title;
                        }
                }
-               $db->freeResult( $res );
+
                if ( is_null( $resultPageSet ) ) {
                        $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), $this->getModulePrefix() );
                } else {
index 85863ab..5085b9e 100644 (file)
@@ -87,7 +87,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
                                $resultPageSet->processDbRow( $row );
                        }
                }
-               $db->freeResult( $res );
+
                return $count;
        }
 
index abace8f..ae2bef0 100644 (file)
@@ -273,8 +273,6 @@ class ApiQueryRecentChanges extends ApiQueryBase {
                        }
                }
 
-               $db->freeResult( $res );
-
                /* Format the result */
                $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'rc' );
        }
index 0793826..93cc2a1 100644 (file)
@@ -345,7 +345,6 @@ class ApiQueryRevisions extends ApiQueryBase {
                                break;
                        }
                }
-               $db->freeResult( $res );
        }
 
        private function extractRowInfo( $row ) {
index 5ec4e32..f4e6645 100644 (file)
@@ -271,7 +271,6 @@ class ApiQuerySiteinfo extends ApiQueryBase {
 
                        $data[] = $val;
                }
-               $db->freeResult( $res );
 
                $this->getResult()->setIndexedTagName( $data, 'iw' );
                return $this->getResult()->addValue( 'query', $property, $data );
index 24a03b7..a337c1d 100644 (file)
@@ -114,9 +114,6 @@ class ApiQueryContributions extends ApiQueryBase {
                        }
                }
 
-               // Free the database record so the connection can get on with other stuff
-               $db->freeResult( $res );
-
                $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'item' );
        }
 
index 4482485..b02f6ec 100644 (file)
@@ -202,8 +202,6 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                        }
                }
 
-               $db->freeResult( $res );
-
                if ( is_null( $resultPageSet ) ) {
                        $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'item' );
                } elseif ( $params['allrev'] ) {