* added redundand join condition for index usage as per comment on CR r88008
authorJure Kajzer <freakolowsky@users.mediawiki.org>
Fri, 2 Sep 2011 06:58:08 +0000 (06:58 +0000)
committerJure Kajzer <freakolowsky@users.mediawiki.org>
Fri, 2 Sep 2011 06:58:08 +0000 (06:58 +0000)
includes/specials/SpecialContributions.php

index ab01b1d..1d0eed7 100644 (file)
@@ -518,11 +518,11 @@ class ContribsPager extends ReverseChronologicalPager {
                        $index = 'user_timestamp';
                        # @todo FIXME: Other groups may have 'bot' rights
                        $join_conds['user_groups'] = array( 'LEFT JOIN', "ug_user = rev_user AND ug_group = 'bot'" );
-                       $join_conds['recentchanges'] = array( 'INNER JOIN', "rev_id = rc_this_oldid" );
+                       $join_conds['recentchanges'] = array( 'INNER JOIN', "rev_id = rc_this_oldid AND rev_timestamp = rc_timestamp" );
                } else {
                        $tables = array( 'recentchanges', 'page', 'revision' );
                        $condition['rev_user_text'] = $this->target;
-                       $join_conds['recentchanges'] = array( 'INNER JOIN', "rev_id = rc_this_oldid" );
+                       $join_conds['recentchanges'] = array( 'INNER JOIN', "rev_id = rc_this_oldid AND rev_timestamp = rc_timestamp" );
                        $index = 'usertext_timestamp';
                }
                if( $this->deletedOnly ) {