fix backtrace on SQL error
authorAntoine Musso <hashar@users.mediawiki.org>
Fri, 13 May 2011 07:05:20 +0000 (07:05 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Fri, 13 May 2011 07:05:20 +0000 (07:05 +0000)
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

index 6560abf..fd79cab 100644 (file)
@@ -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;