Followup r83843, r83837, per brian, addOption unconditionally replaces ORDER BY etc...
authorSam Reed <reedy@users.mediawiki.org>
Sun, 13 Mar 2011 19:28:44 +0000 (19:28 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 13 Mar 2011 19:28:44 +0000 (19:28 +0000)
Simplify addFields call, remove un-needed array for 1 element

includes/api/ApiQueryAllLinks.php
includes/api/ApiQueryDeletedrevs.php

index 4b40ffb..1a7ad61 100644 (file)
@@ -102,9 +102,7 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                        $this->addWhere( 'pl_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
                }
 
-               $this->addFields( array(
-                       'pl_title',
-               ) );
+               $this->addFields( 'pl_title' );
                $this->addFieldsIf( 'pl_from', !$params['unique'] );
 
                $this->addOption( 'USE INDEX', 'pl_namespace' );
@@ -112,7 +110,7 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                $this->addOption( 'LIMIT', $limit + 1 );
 
                if ( !$params['unique'] ) {
-                       $this->addOption( 'ORDER BY', 'pl_from' );
+                       $this->addOption( 'ORDER BY', 'pl_title, pl_from' );
                }
 
                $res = $this->select( __METHOD__ );
index 2cf5ee5..290f4d7 100644 (file)
@@ -172,7 +172,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                        if ( $params['unique'] ) {
                                $this->addOption( 'GROUP BY', 'ar_title' );
                        } else {
-                               $this->addOption( 'ORDER BY', 'ar_timestamp' );
+                               $this->addOption( 'ORDER BY', 'ar_title, ar_timestamp' );
                        }
                } else {
                        if ( $mode == 'revs' ) {