]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fix for bug 124587: Lock bugs table before inserting new bug.
authormyk%mozilla.org <>
Wed, 24 Apr 2002 04:33:46 +0000 (04:33 +0000)
committermyk%mozilla.org <>
Wed, 24 Apr 2002 04:33:46 +0000 (04:33 +0000)
Patch by Myk Melez <myk@mozilla.org>
r=bbaetz,justdave

post_bug.cgi

index 7f9f46c47b80ff936797cc74ec93227fa2120158..a50369592db71d98362088193edaa6ae767e4a11 100755 (executable)
@@ -237,6 +237,11 @@ foreach my $b (grep(/^bit-\d*$/, keys %::FORM)) {
 
 $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.
 SendSQL($sql);
 
@@ -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"
 my @ARGLIST = ();
 if (@cc) {