Hoo man has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/182646

Change subject: Make use of DatabaseBase::selectRowCount in Title
......................................................................

Make use of DatabaseBase::selectRowCount in Title

Change-Id: I686f4f785ffa6323ac94b679794ba50539d951f0
---
M includes/Title.php
1 file changed, 1 insertion(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/46/182646/1

diff --git a/includes/Title.php b/includes/Title.php
index d0c8b3b..24f4331 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -4046,20 +4046,13 @@
                if ( $this->mIsBigDeletion === null ) {
                        $dbr = wfGetDB( DB_SLAVE );
 
-                       $innerQuery = $dbr->selectSQLText(
+                       $revCount = $dbr->selectRowCount(
                                'revision',
                                '1',
                                array( 'rev_page' => $this->getArticleID() ),
                                __METHOD__,
                                array( 'LIMIT' => $wgDeleteRevisionsLimit + 1 )
                        );
-
-                       $revCount = $dbr->query(
-                               'SELECT COUNT(*) FROM (' . $innerQuery . ') AS 
innerQuery',
-                               __METHOD__
-                       );
-                       $revCount = $revCount->fetchRow();
-                       $revCount = $revCount['COUNT(*)'];
 
                        $this->mIsBigDeletion = $revCount > 
$wgDeleteRevisionsLimit;
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/182646
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I686f4f785ffa6323ac94b679794ba50539d951f0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to