From: gerv%gerv.net <> Date: Fri, 12 Oct 2001 04:58:07 +0000 (+0000) Subject: Bug 57819 - cut down large mysql error strings. Patch by n_hibma@qubesoft.com, r... X-Git-Tag: bugzilla-2.14.1~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f02a1e9427580208368cda9aad865378394a97f9;p=thirdparty%2Fbugzilla.git Bug 57819 - cut down large mysql error strings. Patch by n_hibma@qubesoft.com, r=gerv. --- diff --git a/globals.pl b/globals.pl index c7f848c8af..eedfa12e3b 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);