summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgerv%gerv.net <>2001-10-12 06:58:07 +0200
committergerv%gerv.net <>2001-10-12 06:58:07 +0200
commitf02a1e9427580208368cda9aad865378394a97f9 (patch)
tree775cead0d748fdb816dfb528c27e776abb492b32
parent69aa4d375af8f43bf5ec8922fe0b96ef85f0c7ee (diff)
downloadbugzilla-f02a1e9427580208368cda9aad865378394a97f9.tar.gz
bugzilla-f02a1e9427580208368cda9aad865378394a97f9.tar.xz
Bug 57819 - cut down large mysql error strings. Patch by n_hibma@qubesoft.com, r=gerv.
-rw-r--r--globals.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/globals.pl b/globals.pl
index c7f848c8a..eedfa12e3 100644
--- a/globals.pl
+++ b/globals.pl
@@ -211,8 +211,13 @@ sub SendSQL {
}
SqlLog($str);
$::currentquery = $::db->prepare($str);
- $::currentquery->execute
- || die "$str: " . $::db->errstr;
+ if (!$::currentquery->execute) {
+ my $errstr = $::db->errstr;
+ # Cut down the error string to a reasonable.size
+ $errstr = substr($errstr, 0, 100) . ' ... ' . substr($errstr, -100)
+ if length($errstr) > 200;
+ die "$str: " . $errstr;
+ }
SqlLog("Done");
if (!$dontshadow && $iswrite && Param("shadowdb")) {
my $q = SqlQuote($str);