r47781 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47780‎ | r47781 | r47782 >
Date:04:33, 25 February 2009
Author:aaron
Status:ok
Tags:
Comment:
INDEX use fixes
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryLogEvents.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryLogEvents.php
@@ -94,8 +94,7 @@
9595
9696 $limit = $params['limit'];
9797 $this->addOption('LIMIT', $limit +1);
98 -
99 - $index = false;
 98+
10099 $user = $params['user'];
101100 if (!is_null($user)) {
102101 $userid = User::idFromName($user);
@@ -114,7 +113,7 @@
115114 $this->addWhereFld('log_title', $titleObj->getDBkey());
116115
117116 // Use the title index in preference to the user index if there is a conflict
118 - $index = 'page_time';
 117+ $index = is_null($user) ? 'page_time' : array('page_time','user_time');
119118 }
120119 if ( $index ) {
121120 $this->addOption( 'USE INDEX', array( 'logging' => $index ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r47801Slight fix for r47781: remove useless if($index) conditional: $index is alway...catrope14:42, 25 February 2009

Status & tagging log