From a463facbd584c88b07b0e2f4638d03f87bd6d238 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 13 Mar 2011 19:28:44 +0000 Subject: [PATCH] Followup r83843, r83837, per brian, addOption unconditionally replaces ORDER BY etc, so fix that Simplify addFields call, remove un-needed array for 1 element --- includes/api/ApiQueryAllLinks.php | 6 ++---- includes/api/ApiQueryDeletedrevs.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/api/ApiQueryAllLinks.php b/includes/api/ApiQueryAllLinks.php index 4b40ffb6de..1a7ad616c5 100644 --- a/includes/api/ApiQueryAllLinks.php +++ b/includes/api/ApiQueryAllLinks.php @@ -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__ ); diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 2cf5ee5788..290f4d7b3f 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -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' ) { -- 2.20.1