summaryrefslogtreecommitdiffstats
path: root/editmilestones.cgi
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-02-18 06:57:26 +0100
committermkanat%kerio.com <>2005-02-18 06:57:26 +0100
commitd3f8bf365e5b93f58497a25e07fde7ce30884f9d (patch)
treeba45ba2aa22039ecd440ca4c5c7fa421eb158456 /editmilestones.cgi
parentf95d1faba79c94bcf3bf936334d6bb10e03c93b2 (diff)
downloadbugzilla-d3f8bf365e5b93f58497a25e07fde7ce30884f9d.tar.gz
bugzilla-d3f8bf365e5b93f58497a25e07fde7ce30884f9d.tar.xz
Bug 280503: Replace "LOCK/UNLOCK TABLES" with Bugzilla::DB function call
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat,a=myk
Diffstat (limited to 'editmilestones.cgi')
-rwxr-xr-xeditmilestones.cgi26
1 files changed, 13 insertions, 13 deletions
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;