+ if ( $this->mTrxDoneWrites || ( $this->mFlags & DBO_TRX ) === 0 ) {
+ // In theory, we should always warn about nesting BEGIN statements.
+ // However, it is sometimes hard to avoid so we only warn if:
+ //
+ // a) the transaction has done writes. This gives warnings about bad transactions
+ // that could cause partial writes but not about read queries seeing more
+ // than one DB snapshot (when in REPEATABLE-READ) due to nested BEGINs.
+ //
+ // b) the DBO_TRX flag is not set. Explicit transactions should always be properly
+ // started and comitted.
+ /*wfWarn( "$fname: Transaction already in progress (from {$this->mTrxFname}), " .
+ " performing implicit commit!" );*/
+ } elseif ( $wgDebugDBTransactions ) {
+ wfDebug( "$fname: Transaction already in progress (from {$this->mTrxFname}), " .
+ " performing implicit commit!\n" );
+ }
+