r59692 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59691‎ | r59692 | r59693 >
Date:02:37, 3 December 2009
Author:overlordq
Status:ok
Tags:
Comment:
(bug 20150): Change query to explicity select distinct rows instead of doing it using a group by, RevDelete works on PG now
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -893,12 +893,13 @@
894894 $this->mConds[] = 'user_id = log_user';
895895 $groupBy = false;
896896 $index = array();
 897+ $options = array();
897898 # Add log_search table if there are conditions on it
898899 if( array_key_exists('ls_field',$this->mConds) ) {
899900 $tables[] = 'log_search';
900901 $index['log_search'] = 'ls_field_val';
901902 $index['logging'] = 'PRIMARY';
902 - $groupBy = 'ls_log_id';
 903+ $options[] = 'DISTINCT';
903904 # Avoid usage of the wrong index by limiting
904905 # the choices of available indexes. This mainly
905906 # avoids site-breaking filesorts.
@@ -912,7 +913,7 @@
913914 } else {
914915 $index['logging'] = 'times';
915916 }
916 - $options = array( 'USE INDEX' => $index );
 917+ $options['USE INDEX'] = $index;
917918 # Don't show duplicate rows when using log_search
918919 if( $groupBy ) $options['GROUP BY'] = $groupBy;
919920 $info = array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r59964Delete refs to variable removed in r59692simetrical19:43, 11 December 2009

Status & tagging log