From: daniel Date: Tue, 16 Oct 2012 11:15:50 +0000 (+0200) Subject: Warn when flushing inside an explicit transaction. X-Git-Tag: 1.31.0-rc.0~21988^2 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=3c4ab2eb268a1f6785d524876c2df0914a48acad;p=lhc%2Fweb%2Fwiklou.git Warn when flushing inside an explicit transaction. Until now, commit() with the "flush" flag would just commit the transaction, no questions ask. Flushing however should only apply to automatic transactions. Change-Id: I621f145902cfdf201206b42c49c160aeeaf0e4ba --- diff --git a/includes/db/Database.php b/includes/db/Database.php index a942afe065..48aac9dbd8 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -2992,6 +2992,12 @@ abstract class DatabaseBase implements DatabaseType { } elseif( $this->mTrxAutomatic ) { wfWarn( "$fname: Explicit commit of implicit transaction. Something may be out of sync!" ); } + } else { + if ( !$this->mTrxLevel ) { + return; // nothing to do + } elseif( !$this->mTrxAutomatic ) { + wfWarn( "$fname: Flushing an explicit transaction, getting out of sync!" ); + } } $this->doCommit( $fname );