summaryrefslogtreecommitdiffstats
path: root/contrib/merge-users.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-11-15 05:56:31 +0100
committerlpsolit%gmail.com <>2007-11-15 05:56:31 +0100
commit0dadaed4ffb582ccfbc2356e7715007819d1cea2 (patch)
treea44cf83a9670d0a5e2ebc63a1dcc27a012924fc1 /contrib/merge-users.pl
parentec38a93e110be22f7316871994f91dc53712bcd2 (diff)
downloadbugzilla-0dadaed4ffb582ccfbc2356e7715007819d1cea2.tar.gz
bugzilla-0dadaed4ffb582ccfbc2356e7715007819d1cea2.tar.xz
Bug 403824: Replace table locks in most Bugzilla files with transactions - Patch by Emmanuel Seyman <eseyman@linagora.com> r/a=mkanat
Diffstat (limited to 'contrib/merge-users.pl')
-rw-r--r--contrib/merge-users.pl9
1 files changed, 4 insertions, 5 deletions
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";