From ef3069138701d41db2f44dbe81e1f0ca50d9fa06 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Mon, 4 Nov 2013 19:53:52 +0100 Subject: Bug 926952: Possible race conditions when editing or deleting a milestone or a version r/a=glob --- Bugzilla/Version.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Version.pm') diff --git a/Bugzilla/Version.pm b/Bugzilla/Version.pm index 317b73d95..1dcd2b141 100644 --- a/Bugzilla/Version.pm +++ b/Bugzilla/Version.pm @@ -118,14 +118,18 @@ sub bug_count { sub update { my $self = shift; + my $dbh = Bugzilla->dbh; + + $dbh->bz_start_transaction(); my ($changes, $old_self) = $self->SUPER::update(@_); if (exists $changes->{value}) { - my $dbh = Bugzilla->dbh; $dbh->do('UPDATE bugs SET version = ? WHERE version = ? AND product_id = ?', undef, ($self->name, $old_self->name, $self->product_id)); } + $dbh->bz_commit_transaction(); + return $changes; } -- cgit v1.2.3-24-g4f1b