summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-07-10 13:39:49 +0200
committerDavid Lawrence <dkl@mozilla.com>2014-07-10 13:39:49 +0200
commit6a20061b95f6d7ec6260b1f86115ecd7016d5213 (patch)
tree40e9a2091e8f2df1ad1104076e0136f179cd9464 /contrib
parenteb33aae6614ce02b6a3748c9a6a79989c40317fc (diff)
downloadbugzilla-6a20061b95f6d7ec6260b1f86115ecd7016d5213.tar.gz
bugzilla-6a20061b95f6d7ec6260b1f86115ecd7016d5213.tar.xz
Bug 1027182: merge-users.pl - SQL to remove bug_user_last_visit not correct
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/merge-users.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/merge-users.pl b/contrib/merge-users.pl
index 5935d842a..28a378e1c 100755
--- a/contrib/merge-users.pl
+++ b/contrib/merge-users.pl
@@ -173,8 +173,9 @@ my $dupe_ids = $dbh->selectcol_arrayref("
INNER JOIN bug_user_last_visit as later
ON (earlier.user_id != later.user_id AND earlier.last_visit_ts < later.last_visit_ts
AND earlier.bug_id = later.bug_id)
- WHERE (earlier.user_id = ? OR earlier.user_id = ?)",
- undef, $old_id, $new_id);
+ WHERE (earlier.user_id = ? OR earlier.user_id = ?)
+ AND (later.user_id = ? OR later.user_id = ?)",
+ undef, $old_id, $new_id, $old_id, $new_id);
$dbh->do("DELETE FROM bug_user_last_visit WHERE " . $dbh->sql_in('id', $dupe_ids));
# Migrate records from old user to new user.