Make use of DatabaseBase::selectRowCount in Title
authorMarius Hoch <hoo@online.de>
Sun, 4 Jan 2015 05:34:06 +0000 (06:34 +0100)
committerPleaseStand <pleasestand@live.com>
Sun, 4 Jan 2015 17:08:24 +0000 (17:08 +0000)
Change-Id: I686f4f785ffa6323ac94b679794ba50539d951f0

includes/Title.php

index d0c8b3b..24f4331 100644 (file)
@@ -4046,7 +4046,7 @@ class Title {
                if ( $this->mIsBigDeletion === null ) {
                        $dbr = wfGetDB( DB_SLAVE );
 
-                       $innerQuery = $dbr->selectSQLText(
+                       $revCount = $dbr->selectRowCount(
                                'revision',
                                '1',
                                array( 'rev_page' => $this->getArticleID() ),
@@ -4054,13 +4054,6 @@ class Title {
                                array( 'LIMIT' => $wgDeleteRevisionsLimit + 1 )
                        );
 
-                       $revCount = $dbr->query(
-                               'SELECT COUNT(*) FROM (' . $innerQuery . ') AS innerQuery',
-                               __METHOD__
-                       );
-                       $revCount = $revCount->fetchRow();
-                       $revCount = $revCount['COUNT(*)'];
-
                        $this->mIsBigDeletion = $revCount > $wgDeleteRevisionsLimit;
                }