Disable transaction warnings for automatic trx.
authordaniel <daniel.kinzler@wikimedia.de>
Fri, 5 Oct 2012 08:19:42 +0000 (10:19 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Mon, 8 Oct 2012 11:49:50 +0000 (13:49 +0200)
commit149c25370481c572aa5ede1fe198abe96bec48a8
tree79a4028f4f7d515b049c5a4892a2cd0a9609c31b
parenta7153315a6fd6b41949098537dd2023b9754e736
Disable transaction warnings for automatic trx.

This tracks which transaction was opened automatically because of the
DBO_TRX flag, and then supresses any warnings about committing these
transactions implicitely, even if write operations were performed by
that transaction. To get warnings about implicitely committed writes
from automatic transactions, enable $wgDebugDBTransactions.

This change is a follow-up to I1e746322 and the older I3f1dd5fd, and
should be considered an alternative to I3eacc5a9. The new warning
behavior is:

* when beginning a transaction, warn if there is a transaction pending
that has also been started explicitely by calling begin().

* when beginning a transaction and $wgDebugDBTransactions is on, log
any implicit commit of an automatic transaction if write operations
where performed within that transaction.

The idea is to provide warnings about nested explicite transactions
while staying quiet about implicite commits to automatic transactions.

Change-Id: Idbe4a9034b13413e351f432408d358a704f6b77d
includes/Defines.php
includes/db/Database.php