r83850 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83849‎ | r83850 | r83851 >
Date:19:28, 13 March 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Followup r83843, r83837, per brian, addOption unconditionally replaces ORDER BY etc, so fix that

Simplify addFields call, remove un-needed array for 1 element
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryAllLinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryDeletedrevs.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryAllLinks.php
@@ -102,9 +102,7 @@
103103 $this->addWhere( 'pl_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
104104 }
105105
106 - $this->addFields( array(
107 - 'pl_title',
108 - ) );
 106+ $this->addFields( 'pl_title' );
109107 $this->addFieldsIf( 'pl_from', !$params['unique'] );
110108
111109 $this->addOption( 'USE INDEX', 'pl_namespace' );
@@ -112,7 +110,7 @@
113111 $this->addOption( 'LIMIT', $limit + 1 );
114112
115113 if ( !$params['unique'] ) {
116 - $this->addOption( 'ORDER BY', 'pl_from' );
 114+ $this->addOption( 'ORDER BY', 'pl_title, pl_from' );
117115 }
118116
119117 $res = $this->select( __METHOD__ );
Index: trunk/phase3/includes/api/ApiQueryDeletedrevs.php
@@ -172,7 +172,7 @@
173173 if ( $params['unique'] ) {
174174 $this->addOption( 'GROUP BY', 'ar_title' );
175175 } else {
176 - $this->addOption( 'ORDER BY', 'ar_timestamp' );
 176+ $this->addOption( 'ORDER BY', 'ar_title, ar_timestamp' );
177177 }
178178 } else {
179179 if ( $mode == 'revs' ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83837Cleanup/simplify code added to alllinks in r70584reedy17:36, 13 March 2011
r83843Bug 27341 - Add drto param to list=deletedrevs...reedy17:59, 13 March 2011

Comments

#Comment by Bryan (talk | contribs)   20:02, 13 March 2011

Please note that Brian==bawolff, but Bryan==me.

Status & tagging log