From 936182e8be1463be07a3679e7829aa64e9c5740b Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sat, 29 Jan 2011 22:07:22 +0000 Subject: [PATCH] Per fixme on r78786, obey sortDescending in Cached mode (ie if sortDescending, force order by qc_value DESC) --- includes/QueryPage.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/QueryPage.php b/includes/QueryPage.php index f656949b9b..4cf039dc45 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -407,6 +407,9 @@ abstract class QueryPage extends SpecialPage { if ( $offset !== false ) { $options['OFFSET'] = intval( $offset ); } + if ( $this->sortDescending() ) { + $options['ORDER BY'] = 'qc_value DESC'; + } $res = $dbr->select( 'querycache', array( 'qc_type', 'qc_namespace AS namespace', 'qc_title AS title', @@ -416,7 +419,7 @@ abstract class QueryPage extends SpecialPage { ); return $dbr->resultObject( $res ); } - + public function getCachedTimestamp() { if ( !is_null( $this->cachedTimestamp ) ) { $dbr = wfGetDB( DB_SLAVE ); -- 2.20.1