Commit 99919582 authored by myk%mozilla.org's avatar myk%mozilla.org

Fix for bug 124587: Lock bugs table before inserting new bug.

Patch by Myk Melez <myk@mozilla.org> r=bbaetz,justdave
parent d53b0947
...@@ -237,6 +237,11 @@ foreach my $b (grep(/^bit-\d*$/, keys %::FORM)) { ...@@ -237,6 +237,11 @@ foreach my $b (grep(/^bit-\d*$/, keys %::FORM)) {
$sql .= ") & $::usergroupset)\n"; $sql .= ") & $::usergroupset)\n";
# Lock tables before inserting records for the new bug into the database
# if we are using a shadow database to prevent shadow database corruption
# when two bugs get created at the same time.
SendSQL("LOCK TABLES bugs WRITE, longdescs WRITE, cc WRITE") if Param("shadowdb");
# Add the bug report to the DB. # Add the bug report to the DB.
SendSQL($sql); SendSQL($sql);
...@@ -266,6 +271,8 @@ if (defined $::FORM{'cc'}) { ...@@ -266,6 +271,8 @@ if (defined $::FORM{'cc'}) {
} }
} }
SendSQL("UNLOCK TABLES") if Param("shadowdb");
# Assemble the -force* strings so this counts as "Added to this capacity" # Assemble the -force* strings so this counts as "Added to this capacity"
my @ARGLIST = (); my @ARGLIST = ();
if (@cc) { if (@cc) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment