[Database] Log transaction mismatch errors to the DB log.
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 11 Feb 2013 21:53:40 +0000 (13:53 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 11 Feb 2013 21:54:57 +0000 (13:54 -0800)
Change-Id: Ic681cb98e13d7769b849ddc132b71596b2b25abe

includes/db/Database.php

index 7e865c1..bf619a7 100644 (file)
@@ -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" );
                                }
                        }