From: OverlordQ Date: Thu, 3 Dec 2009 02:37:49 +0000 (+0000) Subject: (bug 20150): Change query to explicity select distinct rows instead of doing it using... X-Git-Tag: 1.31.0-rc.0~38647 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=7a42a4da7e900879c5fc662c244d8f6a37f12134;p=lhc%2Fweb%2Fwiklou.git (bug 20150): Change query to explicity select distinct rows instead of doing it using a group by, RevDelete works on PG now --- diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 76be8286b5..cfbadeb343 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -893,12 +893,13 @@ class LogPager extends ReverseChronologicalPager { $this->mConds[] = 'user_id = log_user'; $groupBy = false; $index = array(); + $options = array(); # Add log_search table if there are conditions on it if( array_key_exists('ls_field',$this->mConds) ) { $tables[] = 'log_search'; $index['log_search'] = 'ls_field_val'; $index['logging'] = 'PRIMARY'; - $groupBy = 'ls_log_id'; + $options[] = 'DISTINCT'; # Avoid usage of the wrong index by limiting # the choices of available indexes. This mainly # avoids site-breaking filesorts. @@ -912,7 +913,7 @@ class LogPager extends ReverseChronologicalPager { } else { $index['logging'] = 'times'; } - $options = array( 'USE INDEX' => $index ); + $options['USE INDEX'] = $index; # Don't show duplicate rows when using log_search if( $groupBy ) $options['GROUP BY'] = $groupBy; $info = array(