Per fixme on r78786, obey sortDescending in Cached mode (ie if sortDescending, force...
authorSam Reed <reedy@users.mediawiki.org>
Sat, 29 Jan 2011 22:07:22 +0000 (22:07 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 29 Jan 2011 22:07:22 +0000 (22:07 +0000)
includes/QueryPage.php

index f656949..4cf039d 100644 (file)
@@ -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 );