From 2caad1018bb7c3aeb3b63e015cd2873500e3f5bb Mon Sep 17 00:00:00 2001 From: "bzrmirror%bugzilla.org" Date: Thu, 10 Jul 2014 02:00:46 +0000 Subject: [PATCH] Bug 1027182: merge-users.pl - SQL to remove bug_user_last_visit not correct r=glob,a=sgreen git-svn-id: svn://10.0.0.236/trunk@265452 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/.gitrev | 2 +- mozilla/webtools/bugzilla/contrib/merge-users.pl | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 29ec892d32e..41a1159e17d 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -9075 \ No newline at end of file +9076 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/.gitrev b/mozilla/webtools/bugzilla/.gitrev index 6a1d5292083..08c38dd678d 100644 --- a/mozilla/webtools/bugzilla/.gitrev +++ b/mozilla/webtools/bugzilla/.gitrev @@ -1 +1 @@ -70b1cb4b8ff30538b3f952a5418ff5b12dc38662 \ No newline at end of file +2f10cf7b02a921d4e85bd3514035bccef06f3fc7 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/contrib/merge-users.pl b/mozilla/webtools/bugzilla/contrib/merge-users.pl index 272f5586af1..62b08792132 100755 --- a/mozilla/webtools/bugzilla/contrib/merge-users.pl +++ b/mozilla/webtools/bugzilla/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.