From 48dff3e3a90d09d31162bda078f0cb126b35ef65 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 11 Feb 2013 13:53:40 -0800 Subject: [PATCH] [Database] Log transaction mismatch errors to the DB log. Change-Id: Ic681cb98e13d7769b849ddc132b71596b2b25abe --- includes/db/Database.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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" ); } } -- 2.20.1