Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -893,12 +893,13 @@ |
894 | 894 | $this->mConds[] = 'user_id = log_user'; |
895 | 895 | $groupBy = false; |
896 | 896 | $index = array(); |
| 897 | + $options = array(); |
897 | 898 | # Add log_search table if there are conditions on it |
898 | 899 | if( array_key_exists('ls_field',$this->mConds) ) { |
899 | 900 | $tables[] = 'log_search'; |
900 | 901 | $index['log_search'] = 'ls_field_val'; |
901 | 902 | $index['logging'] = 'PRIMARY'; |
902 | | - $groupBy = 'ls_log_id'; |
| 903 | + $options[] = 'DISTINCT'; |
903 | 904 | # Avoid usage of the wrong index by limiting |
904 | 905 | # the choices of available indexes. This mainly |
905 | 906 | # avoids site-breaking filesorts. |
— | — | @@ -912,7 +913,7 @@ |
913 | 914 | } else { |
914 | 915 | $index['logging'] = 'times'; |
915 | 916 | } |
916 | | - $options = array( 'USE INDEX' => $index ); |
| 917 | + $options['USE INDEX'] = $index; |
917 | 918 | # Don't show duplicate rows when using log_search |
918 | 919 | if( $groupBy ) $options['GROUP BY'] = $groupBy; |
919 | 920 | $info = array( |