From: terry%mozilla.org <> Date: Fri, 18 Feb 2000 08:43:56 +0000 (+0000) Subject: Wasn't always tweaking LOCK TABLES commands correctly when shadowing. And finally... X-Git-Tag: bugzilla-2.12~374 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f229fcf58df2bdf86935e2c41085eb0682ecd530;p=thirdparty%2Fbugzilla.git Wasn't always tweaking LOCK TABLES commands correctly when shadowing. And finally fixed it to actually generate useful SQL error messages. --- diff --git a/globals.pl b/globals.pl index 00e1cfd258..7029158666 100644 --- a/globals.pl +++ b/globals.pl @@ -112,12 +112,12 @@ sub SendSQL { if ($iswrite && !$::dbwritesallowed) { die "Evil code attempted to write stuff to the shadow database."; } - if ($str =~ /^LOCK TABLES/ && $str !~ /shadowlog/) { - $str =~ s/^LOCK TABLES/LOCK TABLES shadowlog WRITE, /; + if ($str =~ /^LOCK TABLES/i && $str !~ /shadowlog/) { + $str =~ s/^LOCK TABLES/LOCK TABLES shadowlog WRITE, /i; } SqlLog($str); $::currentquery = $::db->query($str) - || die "$str: $::db_errstr"; + || die "$str: " . $::db->errmsg; SqlLog("Done"); if (!$dontshadow && $iswrite && Param("shadowdb")) { my $q = SqlQuote($str);