summaryrefslogtreecommitdiffstats
path: root/editvalues.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-10-10 06:21:48 +0200
committerlpsolit%gmail.com <>2007-10-10 06:21:48 +0200
commit24a90239690d3c59538cb4044bc31411efd83464 (patch)
tree09242819613a0cd56319b09bf258077dce147d70 /editvalues.cgi
parenta81a0804496d263f9de71b03e2ebf612e3c534cc (diff)
downloadbugzilla-24a90239690d3c59538cb4044bc31411efd83464.tar.gz
bugzilla-24a90239690d3c59538cb4044bc31411efd83464.tar.xz
Bug 398976: edit*.cgi scripts should use transactions for database interaction - Patch by Emmanuel Seyman <eseyman@linagora.com> r/a=mkanat
Diffstat (limited to 'editvalues.cgi')
-rwxr-xr-xeditvalues.cgi10
1 files changed, 4 insertions, 6 deletions
diff --git a/editvalues.cgi b/editvalues.cgi
index a9d5878c0..520c0797b 100755
--- a/editvalues.cgi
+++ b/editvalues.cgi
@@ -312,9 +312,7 @@ if ($action eq 'delete') {
trick_taint($value);
- my @lock_tables = ('bugs READ', "$field WRITE");
- push(@lock_tables, 'status_workflow WRITE') if ($field eq 'bug_status');
- $dbh->bz_lock_tables(@lock_tables);
+ $dbh->bz_start_transaction();
# Check if there are any bugs that still have this value.
my $bug_ids = $dbh->selectcol_arrayref(
@@ -338,7 +336,7 @@ if ($action eq 'delete') {
$dbh->do("DELETE FROM $field WHERE value = ?", undef, $value);
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
delete_token($token);
$template->process("admin/fieldvalues/deleted.html.tmpl",
@@ -396,7 +394,7 @@ if ($action eq 'update') {
ThrowUserError('fieldvalue_name_too_long', $vars);
}
- $dbh->bz_lock_tables('bugs WRITE', "$field WRITE");
+ $dbh->bz_start_transaction();
# Need to store because detaint_natural() will delete this if
# invalid
@@ -442,7 +440,7 @@ if ($action eq 'update') {
$vars->{'updated_value'} = 1;
}
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
# If the old value was the default value for the field,
# update data/params accordingly.