From 7a42a4da7e900879c5fc662c244d8f6a37f12134 Mon Sep 17 00:00:00 2001 From: OverlordQ Date: Thu, 3 Dec 2009 02:37:49 +0000 Subject: [PATCH] (bug 20150): Change query to explicity select distinct rows instead of doing it using a group by, RevDelete works on PG now --- includes/LogEventsList.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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( -- 2.20.1