}
if ( $this->debug() ) {
- wfDebugLog( 'queries', sprintf( "%s: %s", $this->mDBname, $sql ) );
+ wfDebugLog( 'queries', sprintf( "%s: %s", $this->mDBname, $commentedSql ) );
}
$queryId = MWDebug::query( $sql, $fname, $isMaster );
MWExceptionHandler::logException( $ePrior );
}
$ePrior = $e;
+ // Some callbacks may use startAtomic/endAtomic, so make sure
+ // their transactions are ended so other callbacks don't fail
+ if ( $this->trxLevel() ) {
+ $this->rollback( __METHOD__ );
+ }
}
}
} while ( count( $this->mTrxIdleCallbacks ) );
$levels = implode( ', ', $this->mTrxAtomicLevels );
throw new DBUnexpectedError(
$this,
- "Got explicit BEGIN while atomic sections $levels are still open."
+ "Got explicit BEGIN from $fname while atomic section(s) $levels are open."
);
} elseif ( !$this->mTrxAutomatic ) {
// We want to warn about inadvertently nested begin/commit pairs, but not about