mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 19:33:18 +00:00
Wasn't always tweaking LOCK TABLES commands correctly when shadowing. And finally fixed it to actually generate useful SQL error messages.
This commit is contained in:
parent
011ec66cec
commit
890e5ce7c0
@ -112,12 +112,12 @@ sub SendSQL {
|
|||||||
if ($iswrite && !$::dbwritesallowed) {
|
if ($iswrite && !$::dbwritesallowed) {
|
||||||
die "Evil code attempted to write stuff to the shadow database.";
|
die "Evil code attempted to write stuff to the shadow database.";
|
||||||
}
|
}
|
||||||
if ($str =~ /^LOCK TABLES/ && $str !~ /shadowlog/) {
|
if ($str =~ /^LOCK TABLES/i && $str !~ /shadowlog/) {
|
||||||
$str =~ s/^LOCK TABLES/LOCK TABLES shadowlog WRITE, /;
|
$str =~ s/^LOCK TABLES/LOCK TABLES shadowlog WRITE, /i;
|
||||||
}
|
}
|
||||||
SqlLog($str);
|
SqlLog($str);
|
||||||
$::currentquery = $::db->query($str)
|
$::currentquery = $::db->query($str)
|
||||||
|| die "$str: $::db_errstr";
|
|| die "$str: " . $::db->errmsg;
|
||||||
SqlLog("Done");
|
SqlLog("Done");
|
||||||
if (!$dontshadow && $iswrite && Param("shadowdb")) {
|
if (!$dontshadow && $iswrite && Param("shadowdb")) {
|
||||||
my $q = SqlQuote($str);
|
my $q = SqlQuote($str);
|
||||||
|
Loading…
Reference in New Issue
Block a user