r87948 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87947‎ | r87948 | r87949 >
Date:07:05, 13 May 2011
Author:hashar
Status:reverted (Comments)
Tags:core 
Comment:
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 :)
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -3070,7 +3070,10 @@
30713071 "Query: $sql\n" .
30723072 "Function: $fname\n" .
30733073 "Error: $errno $error\n";
3074 -
 3074+ global $wgShowDBErrorBacktrace;
 3075+ if( $wgShowDBErrorBacktrace ) {
 3076+ $message .= $this->getTraceAsString();
 3077+ }
30753078 parent::__construct( $db, $message );
30763079
30773080 $this->error = $error;

Follow-up revisions

RevisionCommit summaryAuthorDate
r110308rv r87948 "fix backtrace on SQL error"...hashar17:36, 30 January 2012

Comments

#Comment by IAlex (talk | contribs)   11:26, 13 May 2011

Now the backtrace is displayed twice. It's added by DBError::getText() and DBError::getHTML() since DBQueryError doesn't override these.

#Comment by IAlex (talk | contribs)   12:18, 13 May 2011

Addendum: only happens when Exception::useOutputPage() returns false.

#Comment by IAlex (talk | contribs)   12:10, 30 January 2012

Setting back to fixme, the issue I described above has not been resolved.

#Comment by Hashar (talk | contribs)   17:37, 30 January 2012

According to my tests, that code looks unneeded nowadays. I have reverted it with r110308.

Status & tagging log