From: Antoine Musso Date: Fri, 13 May 2011 07:05:20 +0000 (+0000) Subject: fix backtrace on SQL error X-Git-Tag: 1.31.0-rc.0~30265 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=801a66f00ccbd34cabbc26860fb97de1461b511a;p=lhc%2Fweb%2Fwiklou.git fix backtrace on SQL error Setting $wgShowDBErrorBacktrace did not have any effect when throwing a DBQueryError exception. Code was missing to actually append the backtrace to the output :) --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 6560abfb25..fd79cabe0f 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -3070,7 +3070,10 @@ class DBQueryError extends DBError { "Query: $sql\n" . "Function: $fname\n" . "Error: $errno $error\n"; - + global $wgShowDBErrorBacktrace; + if( $wgShowDBErrorBacktrace ) { + $message .= $this->getTraceAsString(); + } parent::__construct( $db, $message ); $this->error = $error;