Trigger warning for bad use of transactions.
authordaniel <daniel.kinzler@wikimedia.de>
Mon, 27 Aug 2012 09:55:15 +0000 (11:55 +0200)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 20 Sep 2012 04:00:05 +0000 (21:00 -0700)
commit877c8afc3ebc66e7af53377317a009fcb3d132a9
treeca02a13ab80378f1a1259950cb32383e2ee8256f
parent64aecfb31987f2271198c6dff5a97742cea3d9c9
Trigger warning for bad use of transactions.

Mediawiki currently does not support nested transactions, which means that
starting a transaction while another is in progress will silently commit
the previous transaction, causing lots of potential inconsistency.

This change introduces checks that will log a warning whenever begin() is
used while a transaction is already in progress, and whenever commit() or
rollback() are used without a transaction being in progress.

NOTE: this exposes several places in the code where transactions have inadvertedly
be nested, or unmatched calls to begin() resp commit() are used. With
$wgDevelopmentWarnings enabled or I36583fb0 merged, this may cause tests to fail.
The following changes fix the issues in question: I80faf2ed, Ia225251e, Iff394f97,
and I20d90fed.

Change-Id: I8c0426e12b78edbd758b1f087c35dabd64498624
includes/db/Database.php