summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-01-28 02:15:18 +0100
committerlpsolit%gmail.com <>2008-01-28 02:15:18 +0100
commitc0b4d49d2ed629ccba8c5fc0d61ebf28972d6ada (patch)
treef181f794f5ae4c38a5e10a1b57fd06fa2d21576d /process_bug.cgi
parentce3089f58a6edcb4074df97d1e6133d55b04377a (diff)
downloadbugzilla-c0b4d49d2ed629ccba8c5fc0d61ebf28972d6ada.tar.gz
bugzilla-c0b4d49d2ed629ccba8c5fc0d61ebf28972d6ada.tar.xz
Bug 121069: Remove $dbh->bz_(un)lock_tables from process_bug.cgi and Error.pm in favor of DB transactions. These methods are no longer used and are completely removed now - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi39
1 files changed, 5 insertions, 34 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index 912440ce2..8eb7aaf33 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -398,17 +398,7 @@ if ($move_action eq Bugzilla->params->{'move-button-text'}) {
$user->is_mover || ThrowUserError("auth_failure", {action => 'move',
object => 'bugs'});
- my @multi_select_locks = map {'bug_' . $_->name . " WRITE"}
- Bugzilla->get_fields({ custom => 1, type => FIELD_TYPE_MULTI_SELECT,
- obsolete => 0 });
-
- $dbh->bz_lock_tables('bugs WRITE', 'bugs_activity WRITE', 'duplicates WRITE',
- 'longdescs WRITE', 'profiles READ', 'groups READ',
- 'bug_group_map READ', 'group_group_map READ',
- 'user_group_map READ', 'classifications READ',
- 'products READ', 'components READ', 'votes READ',
- 'cc READ', 'fielddefs READ', 'bug_status READ',
- 'status_workflow READ', 'resolution READ', @multi_select_locks);
+ $dbh->bz_start_transaction();
# First update all moved bugs.
foreach my $bug (@bug_objects) {
@@ -430,7 +420,7 @@ if ($move_action eq Bugzilla->params->{'move-button-text'}) {
$bug->_clear_dup_id;
}
$_->update() foreach @bug_objects;
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
# Now send emails.
foreach my $bug (@bug_objects) {
@@ -510,28 +500,9 @@ foreach my $b (@bug_objects) {
# Do Actual Database Updates #
##############################
foreach my $bug (@bug_objects) {
- my $write = "WRITE"; # Might want to make a param to control
- # whether we do LOW_PRIORITY ...
-
- my @multi_select_locks = map {'bug_' . $_->name . " $write"}
- Bugzilla->get_fields({ custom => 1, type => FIELD_TYPE_MULTI_SELECT,
- obsolete => 0 });
-
- $dbh->bz_lock_tables("bugs $write", "bugs_activity $write", "cc $write",
- "profiles READ", "dependencies $write", "votes $write",
- "products READ", "components READ", "milestones READ",
- "keywords $write", "longdescs $write", "fielddefs READ",
- "bug_group_map $write", "flags $write", "duplicates $write",
- "user_group_map READ", "group_group_map READ", "flagtypes READ",
- "flaginclusions AS i READ", "flagexclusions AS e READ",
- "keyworddefs READ", "groups READ", "attachments READ",
- "bug_status READ", "group_control_map AS oldcontrolmap READ",
- "group_control_map AS newcontrolmap READ",
- "group_control_map READ", "email_setting READ",
- "classifications READ", @multi_select_locks);
-
- my $timestamp = $dbh->selectrow_array(q{SELECT NOW()});
+ $dbh->bz_start_transaction();
+ my $timestamp = $dbh->selectrow_array(q{SELECT NOW()});
my $changes = $bug->update($timestamp);
my %notify_deps;
@@ -581,7 +552,7 @@ foreach my $bug (@bug_objects) {
# Set and update flags.
Bugzilla::Flag::process($bug, undef, $timestamp, $cgi, $vars);
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
###############
# Send Emails #