From: Aaron Schulz Date: Wed, 7 Oct 2015 19:31:04 +0000 (-0700) Subject: Made Database atomic section errors mention the sections X-Git-Tag: 1.31.0-rc.0~9497^2 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=d01d35184d32c0520a0afb4d0facaa954f389fce;p=lhc%2Fweb%2Fwiklou.git Made Database atomic section errors mention the sections Change-Id: Ia6243dd655ef09f3bfbc66ac6d0757ec7bb4bd10 --- diff --git a/includes/db/Database.php b/includes/db/Database.php index b9d344f685..811a4a7209 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -3426,8 +3426,10 @@ abstract class DatabaseBase implements IDatabase { if ( $this->mTrxAtomicLevels ) { // If the current transaction was an automatic atomic one, then we definitely have // a problem. Same if there is any unclosed atomic level. - throw new DBUnexpectedError( $this, - "Attempted to start explicit transaction when atomic levels are still open." + $levels = implode( ', ', $this->mTrxAtomicLevels ); + throw new DBUnexpectedError( + $this, + "Got explicit BEGIN while atomic sections $levels are still open." ); } elseif ( !$this->mTrxAutomatic ) { // We want to warn about inadvertently nested begin/commit pairs, but not about @@ -3510,9 +3512,10 @@ abstract class DatabaseBase implements IDatabase { final public function commit( $fname = __METHOD__, $flush = '' ) { if ( $this->mTrxLevel && $this->mTrxAtomicLevels ) { // There are still atomic sections open. This cannot be ignored + $levels = implode( ', ', $this->mTrxAtomicLevels ); throw new DBUnexpectedError( $this, - "Attempted to commit transaction while atomic sections are still open" + "Got COMMIT while atomic sections $levels are still open" ); }