From d3f8bf365e5b93f58497a25e07fde7ce30884f9d Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Fri, 18 Feb 2005 05:57:26 +0000 Subject: Bug 280503: Replace "LOCK/UNLOCK TABLES" with Bugzilla::DB function call Patch By Tomas Kopal r=mkanat,a=myk --- editmilestones.cgi | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'editmilestones.cgi') diff --git a/editmilestones.cgi b/editmilestones.cgi index 4da121848..7364d4d06 100755 --- a/editmilestones.cgi +++ b/editmilestones.cgi @@ -360,11 +360,11 @@ if ($action eq 'delete') { # lock the tables before we start to change everything: - $dbh->do('LOCK TABLES attachments WRITE, - bugs WRITE, - bugs_activity WRITE, - milestones WRITE, - dependencies WRITE'); + $dbh->bz_lock_tables('attachments WRITE', + 'bugs WRITE', + 'bugs_activity WRITE', + 'milestones WRITE', + 'dependencies WRITE'); # According to MySQL doc I cannot do a DELETE x.* FROM x JOIN Y, # so I have to iterate over bugs and delete all the indivial entries @@ -425,7 +425,7 @@ if ($action eq 'delete') { $product_id, $milestone); - $dbh->do('UNLOCK TABLES'); + $dbh->bz_unlock_tables(); unlink "$datadir/versioncache"; @@ -497,9 +497,9 @@ if ($action eq 'update') { my $dbh = Bugzilla->dbh; - $dbh->do("LOCK TABLES bugs WRITE, - milestones WRITE, - products WRITE"); + $dbh->bz_lock_tables('bugs WRITE', + 'milestones WRITE', + 'products WRITE'); # Need to store because detaint_natural() will delete this if # invalid @@ -507,7 +507,7 @@ if ($action eq 'update') { if ($sortkey != $sortkeyold) { if (!detaint_natural($sortkey)) { - $dbh->do('UNLOCK TABLES'); + $dbh->bz_unlock_tables(UNLOCK_ABORT); ThrowUserError('milestone_sortkey_invalid', {'name' => $milestone, 'sortkey' => $stored_sortkey}); @@ -532,12 +532,12 @@ if ($action eq 'update') { if ($milestone ne $milestoneold) { unless ($milestone) { - $dbh->do('UNLOCK TABLES'); + $dbh->bz_unlock_tables(UNLOCK_ABORT); ThrowUserError('milestone_blank_name'); exit; } if (TestMilestone($product, $milestone)) { - $dbh->do('UNLOCK TABLES'); + $dbh->bz_unlock_tables(UNLOCK_ABORT); ThrowUserError('milestone_already_exists', {'name' => $milestone, 'product' => $product}); @@ -579,7 +579,7 @@ if ($action eq 'update') { $vars->{'updated_name'} = 1; } - $dbh->do('UNLOCK TABLES'); + $dbh->bz_unlock_tables(); $vars->{'name'} = $milestone; $vars->{'product'} = $product; -- cgit v1.2.3-24-g4f1b