From: Aaron Schulz Date: Thu, 24 Dec 2015 01:16:54 +0000 (-0800) Subject: Upgrade mismatched begin() warnings to exceptions X-Git-Tag: 1.31.0-rc.0~7081^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=f8d50756562b5758499bc0005c0f514e41684df1;p=lhc%2Fweb%2Fwiklou.git Upgrade mismatched begin() warnings to exceptions No WMF logs for these events in the last 7 days. Change-Id: I79f2f2c8117ffa887a550a793a9e490c2a26f721 --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 8807e13439..92e89b0de1 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -2589,17 +2589,13 @@ abstract class DatabaseBase implements IDatabase { } elseif ( !$this->mTrxAutomatic ) { // 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, - $this->getLogContext( [ - 'method' => __METHOD__, - 'fname' => $fname, - ] ) + throw new DBUnexpectedError( + $this, + "$fname: Transaction already in progress (from {$this->mTrxFname}), " . + " performing implicit commit!" ); } else { - // if the transaction was automatic and has done write operations + // The transaction was automatic and has done write operations if ( $this->mTrxDoneWrites ) { wfDebug( "$fname: Automatic transaction with writes in progress" . " (from {$this->mTrxFname}), performing implicit commit!\n"