r81198 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81197‎ | r81198 | r81199 >
Date:22:07, 29 January 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Per fixme on r78786, obey sortDescending in Cached mode (ie if sortDescending, force order by qc_value DESC)
Modified paths:
  • /trunk/phase3/includes/QueryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/QueryPage.php
@@ -407,6 +407,9 @@
408408 if ( $offset !== false ) {
409409 $options['OFFSET'] = intval( $offset );
410410 }
 411+ if ( $this->sortDescending() ) {
 412+ $options['ORDER BY'] = 'qc_value DESC';
 413+ }
411414 $res = $dbr->select( 'querycache', array( 'qc_type',
412415 'qc_namespace AS namespace',
413416 'qc_title AS title',
@@ -416,7 +419,7 @@
417420 );
418421 return $dbr->resultObject( $res );
419422 }
420 -
 423+
421424 public function getCachedTimestamp() {
422425 if ( !is_null( $this->cachedTimestamp ) ) {
423426 $dbr = wfGetDB( DB_SLAVE );

Follow-up revisions

RevisionCommit summaryAuthorDate
r81390Fixup fixme on r81198, explicitally ORDER BY qc_value ASC if not doing DESCreedy14:26, 2 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78786Merge querypage-work2 branch from trunk. The most relevant changes are:...catrope14:16, 22 December 2010

Comments

#Comment by Catrope (talk | contribs)   14:14, 2 February 2011

We should always specify an ORDER BY, and add DESC as required.

Status & tagging log