aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-07-10 01:45:44 +0000
committerDavid Lawrence <dkl@mozilla.com>2014-07-10 01:45:44 +0000
commit2f10cf7b02a921d4e85bd3514035bccef06f3fc7 (patch)
tree545ac5d115bf5b9d1a1d949e59c1b1e4432a87fa
parent70b1cb4b8ff30538b3f952a5418ff5b12dc38662 (diff)
downloadbugs-2f10cf7b02a921d4e85bd3514035bccef06f3fc7.tar
bugs-2f10cf7b02a921d4e85bd3514035bccef06f3fc7.tar.gz
bugs-2f10cf7b02a921d4e85bd3514035bccef06f3fc7.tar.bz2
bugs-2f10cf7b02a921d4e85bd3514035bccef06f3fc7.tar.xz
bugs-2f10cf7b02a921d4e85bd3514035bccef06f3fc7.zip
Bug 1027182: merge-users.pl - SQL to remove bug_user_last_visit not correct
r=glob,a=sgreen
-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 272f5586a..62b087921 100755
--- a/contrib/merge-users.pl
+++ b/contrib/merge-users.pl
@@ -154,8 +154,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.