summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Bug.pm')
-rwxr-xr-xBugzilla/Bug.pm12
1 files changed, 4 insertions, 8 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index e79a7a1ca..eaf6a9a83 100755
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -738,12 +738,7 @@ sub remove_from_db {
# Also, the attach_data table uses attachments.attach_id as a foreign
# key, and so indirectly depends on a bug deletion too.
- $dbh->bz_lock_tables('attachments WRITE', 'bug_group_map WRITE',
- 'bugs WRITE', 'bugs_activity WRITE', 'cc WRITE',
- 'dependencies WRITE', 'duplicates WRITE',
- 'flags WRITE', 'keywords WRITE',
- 'longdescs WRITE', 'votes WRITE',
- 'attach_data WRITE');
+ $dbh->bz_start_transaction();
$dbh->do("DELETE FROM bug_group_map WHERE bug_id = ?", undef, $bug_id);
$dbh->do("DELETE FROM bugs_activity WHERE bug_id = ?", undef, $bug_id);
@@ -754,7 +749,6 @@ sub remove_from_db {
undef, ($bug_id, $bug_id));
$dbh->do("DELETE FROM flags WHERE bug_id = ?", undef, $bug_id);
$dbh->do("DELETE FROM keywords WHERE bug_id = ?", undef, $bug_id);
- $dbh->do("DELETE FROM longdescs WHERE bug_id = ?", undef, $bug_id);
$dbh->do("DELETE FROM votes WHERE bug_id = ?", undef, $bug_id);
# The attach_data table doesn't depend on bugs.bug_id directly.
@@ -771,7 +765,9 @@ sub remove_from_db {
$dbh->do("DELETE FROM attachments WHERE bug_id = ?", undef, $bug_id);
$dbh->do("DELETE FROM bugs WHERE bug_id = ?", undef, $bug_id);
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
+
+ $dbh->do("DELETE FROM longdescs WHERE bug_id = ?", undef, $bug_id);
# Now this bug no longer exists
$self->DESTROY;