summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-03-21 03:48:10 +0100
committerterry%mozilla.org <>2000-03-21 03:48:10 +0100
commit71699f062777186d9de525bb06bcb719c87d8fc1 (patch)
tree04847623af8f76e257645b61ddf059713358e377 /globals.pl
parent62ef5eab24e1cc2e3d4dbc6786a6692227e9ace9 (diff)
downloadbugzilla-71699f062777186d9de525bb06bcb719c87d8fc1.tar.gz
bugzilla-71699f062777186d9de525bb06bcb719c87d8fc1.tar.xz
Make it so that we can (hopefully!) rebuild the shadow db without
busting other people trying to use the system.
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/globals.pl b/globals.pl
index 98a72a9a3..9a62a2336 100644
--- a/globals.pl
+++ b/globals.pl
@@ -79,7 +79,7 @@ sub ConnectToDatabase {
my ($useshadow) = (@_);
if (!defined $::db) {
my $name = $db_name;
- if ($useshadow && Param("shadowdb")) {
+ if ($useshadow && Param("shadowdb") && Param("queryagainstshadowdb")) {
$name = Param("shadowdb");
$::dbwritesallowed = 0;
}
@@ -89,7 +89,7 @@ sub ConnectToDatabase {
}
sub ReconnectToShadowDatabase {
- if (Param("shadowdb")) {
+ if (Param("shadowdb") && Param("queryagainstshadowdb")) {
SendSQL("USE " . Param("shadowdb"));
$::dbwritesallowed = 0;
}
@@ -127,7 +127,7 @@ sub SendSQL {
if ($iswrite && !$::dbwritesallowed) {
die "Evil code attempted to write stuff to the shadow database.";
}
- if ($str =~ /^LOCK TABLES/i && $str !~ /shadowlog/) {
+ if ($str =~ /^LOCK TABLES/i && $str !~ /shadowlog/ && $::dbwritesallowed) {
$str =~ s/^LOCK TABLES/LOCK TABLES shadowlog WRITE, /i;
}
SqlLog($str);