From 69c7a021327045b8f6b0aeb36d4bd08f67dd1987 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 28 Jan 2010 08:57:34 +0000 Subject: [PATCH] * Fixed $opts['tagfilter'] emptiness check * Doc cleanup/spacing --- includes/specials/SpecialRecentchanges.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 2de734f81e..3206823b27 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -293,22 +293,20 @@ class SpecialRecentChanges extends SpecialPage { // Tag stuff. $fields = array(); // Fields are * in this case, so let the function modify an empty array to keep it happy. - ChangeTags::modifyDisplayQuery( $tables, - $fields, - $conds, - $join_conds, - $query_options, - $opts['tagfilter'] - ); + ChangeTags::modifyDisplayQuery( + $tables, $fields, $conds, $join_conds, $query_options, $opts['tagfilter'] + ); wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts ) ); - // Is there either one namespace selected or excluded? - // Tag filtering also has a better index. - // Also, if this is "all" or main namespace, just use timestamp index. + // Don't use the new_namespace_time timestamp index if: + // (a) "All namespaces" selected + // (b) We want all pages NOT in a certain namespaces (inverted) + // (c) There is a tag to filter on (use tag index instead) + // (d) UNION + sort/limit is not an option for the DBMS if( is_null($namespace) || $invert - || $opts['tagfilter'] + || $opts['tagfilter'] != '' || !$dbr->unionSupportsOrderAndLimit() ) { $res = $dbr->select( $tables, '*', $conds, __METHOD__, -- 2.20.1