r40895 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40894‎ | r40895 | r40896 >
Date:01:57, 16 September 2008
Author:aaron
Status:old
Tags:
Comment:
Tweak strange query for bug 14725
Modified paths:
  • /trunk/extensions/Nuke/SpecialNuke_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Nuke/SpecialNuke_body.php
@@ -115,19 +115,18 @@
116116
117117 function getNewPages( $username ) {
118118 $dbr = wfGetDB( DB_SLAVE );
119 - $result = $dbr->select( array( 'recentchanges', 'revision' ),
120 - array( 'rc_namespace', 'rc_title', 'rc_timestamp', 'COUNT(rev_id) AS edits' ),
 119+ $result = $dbr->select( 'recentchanges',
 120+ array( 'rc_namespace', 'rc_title', 'rc_timestamp', 'COUNT(*) AS edits' ),
121121 array(
122122 'rc_user_text' => $username,
123123 '(rc_new = 1) OR (rc_log_type = "upload" AND rc_log_action = "upload")'
124 - ),
 124+ ),
125125 __METHOD__,
126126 array(
127127 'ORDER BY' => 'rc_timestamp DESC',
128 - 'GROUP BY' => $dbr->implicitGroupby() ? 'rev_page' : 'rc_namespace, rc_title, rc_timestamp'
129 - ),
130 - array( 'revision' => array( 'LEFT JOIN', 'rc_cur_id=rev_page' ) )
131 - );
 128+ 'GROUP BY' => 'rc_namespace, rc_title'
 129+ )
 130+ );
132131 $pages = array();
133132 while( $row = $dbr->fetchObject( $result ) ) {
134133 $pages[] = array( Title::makeTitle( $row->rc_namespace, $row->rc_title ), $row->edits );