From 0dadaed4ffb582ccfbc2356e7715007819d1cea2 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 15 Nov 2007 04:56:31 +0000 Subject: Bug 403824: Replace table locks in most Bugzilla files with transactions - Patch by Emmanuel Seyman r/a=mkanat --- contrib/merge-users.pl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'contrib/merge-users.pl') diff --git a/contrib/merge-users.pl b/contrib/merge-users.pl index ac689abfd..70250a1ee 100644 --- a/contrib/merge-users.pl +++ b/contrib/merge-users.pl @@ -154,9 +154,8 @@ my $changes = { profiles => [], # ['userid'], }; -# Lock tables -my @locked_tables = map {"$_ WRITE"} keys(%$changes); -$dbh->bz_lock_tables(@locked_tables); +# Start the transaction +$dbh->bz_start_transaction(); # Delete old records from logincookies and tokens tables. $dbh->do('DELETE FROM logincookies WHERE userid = ?', undef, $old_id); @@ -230,7 +229,7 @@ print "OK, records in the 'mailto' column of the 'whine_schedules' table\n" . # Delete the old record from the profiles table. $dbh->do('DELETE FROM profiles WHERE userid = ?', undef, $old_id); -# Unlock tables -$dbh->bz_unlock_tables(); +# Commit the transaction +$dbh->bz_commit_transaction(); print "Done.\n"; -- cgit v1.2.3-24-g4f1b