From: Aaron Schulz Date: Wed, 25 Jun 2014 17:12:44 +0000 (-0700) Subject: Made DB commit() method properly bail out if no trx is active X-Git-Tag: 1.31.0-rc.0~15238^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=1045fdf3121381e91b9d2b3c5a30ea5b2e9c0811;p=lhc%2Fweb%2Fwiklou.git Made DB commit() method properly bail out if no trx is active * Also flipped conditional to avoid being in the negative Change-Id: I30bce9a015bea5909322bba93493500b5b418d18 --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 7bbcc2ffe4..32a2ca857c 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -3467,17 +3467,18 @@ abstract class DatabaseBase implements IDatabase, DatabaseType { ); } - if ( $flush !== 'flush' ) { + if ( $flush === 'flush' ) { if ( !$this->mTrxLevel ) { - wfWarn( "$fname: No transaction to commit, something got out of sync!" ); - } elseif ( $this->mTrxAutomatic ) { - wfWarn( "$fname: Explicit commit of implicit transaction. Something may be out of sync!" ); + return; // nothing to do + } elseif ( !$this->mTrxAutomatic ) { + wfWarn( "$fname: Flushing an explicit transaction, getting out of sync!" ); } } else { if ( !$this->mTrxLevel ) { + wfWarn( "$fname: No transaction to commit, something got out of sync!" ); return; // nothing to do - } elseif ( !$this->mTrxAutomatic ) { - wfWarn( "$fname: Flushing an explicit transaction, getting out of sync!" ); + } elseif ( $this->mTrxAutomatic ) { + wfWarn( "$fname: Explicit commit of implicit transaction. Something may be out of sync!" ); } }