From 801a66f00ccbd34cabbc26860fb97de1461b511a Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Fri, 13 May 2011 07:05:20 +0000 Subject: [PATCH] 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 :) --- includes/db/Database.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.20.1