From 3c4ab2eb268a1f6785d524876c2df0914a48acad Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 16 Oct 2012 13:15:50 +0200 Subject: [PATCH] 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 --- includes/db/Database.php | 6 ++++++ 1 file changed, 6 insertions(+) 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 ); -- 2.20.1