summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authormyk%mozilla.org <>2002-04-24 06:33:46 +0200
committermyk%mozilla.org <>2002-04-24 06:33:46 +0200
commit999195822166fd2bd5558a2c1f60460141aa7a2c (patch)
treeb4aa8398c8c358eb23272e7fdc428a253f35cc48 /post_bug.cgi
parentd53b09470938c680ee76385d0066fcc61cba6d5f (diff)
downloadbugzilla-999195822166fd2bd5558a2c1f60460141aa7a2c.tar.gz
bugzilla-999195822166fd2bd5558a2c1f60460141aa7a2c.tar.xz
Fix for bug 124587: Lock bugs table before inserting new bug.
Patch by Myk Melez <myk@mozilla.org> r=bbaetz,justdave
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi7
1 files changed, 7 insertions, 0 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index 7f9f46c47..a50369592 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -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) {