From: Aaron Schulz Date: Mon, 11 Feb 2013 21:53:40 +0000 (-0800) Subject: [Database] Log transaction mismatch errors to the DB log. X-Git-Tag: 1.31.0-rc.0~20719 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=48dff3e3a90d09d31162bda078f0cb126b35ef65;p=lhc%2Fweb%2Fwiklou.git [Database] Log transaction mismatch errors to the DB log. Change-Id: Ic681cb98e13d7769b849ddc132b71596b2b25abe --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 7e865c1c2c..bf619a78ce 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -3013,18 +3013,18 @@ abstract class DatabaseBase implements DatabaseType { if ( $this->mTrxLevel ) { // implicit commit if ( !$this->mTrxAutomatic ) { - // We want to warn about inadvertently nested begin/commit pairs, but not about auto-committing - // implicit transactions that were started by query() because DBO_TRX was set. - - wfWarn( "$fname: Transaction already in progress (from {$this->mTrxFname}), " . - " performing implicit commit!" ); + // We want to warn about inadvertently nested begin/commit pairs, but not about + // auto-committing implicit transactions that were started by query() via DBO_TRX + $msg = "$fname: Transaction already in progress (from {$this->mTrxFname}), " . + " performing implicit commit!"; + wfWarn( $msg ); + wfLogDBError( $msg ); } else { // if the transaction was automatic and has done write operations, // log it if $wgDebugDBTransactions is enabled. - if ( $this->mTrxDoneWrites && $wgDebugDBTransactions ) { - wfDebug( "$fname: Automatic transaction with writes in progress (from {$this->mTrxFname}), " . - " performing implicit commit!\n" ); + wfDebug( "$fname: Automatic transaction with writes in progress" . + " (from {$this->mTrxFname}), performing implicit commit!\n" ); } }