rdbms: make cancelAtomic() handle callbacks and work with DBO_TRX
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 24 Mar 2018 07:02:24 +0000 (00:02 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 20 Apr 2018 09:49:38 +0000 (09:49 +0000)
commit12db6432b8aaa0c192f5275b94f4c404a9d9ec66
tree138fb7e7ced666424e4159d5ce9902601ae2310f
parentbae2b9d95c885ad78f3a0263af4e9643dc4783e6
rdbms: make cancelAtomic() handle callbacks and work with DBO_TRX

Make transaction callbacks aware of cancelled sections. If the
statements of a section are reverted via cancelAtomic(), then the
dependant callbacks are now cancelled as well. Any callbacks for
onTransactionResolution(), which does not depend on COMMIT, will
see the triggering event as a ROLLBACK, since the unit of work it
was part of was rolled back.

Also fix the handling of topmost atomic sections with DBO_TRX.
These still need their own savepoint to make cancelAtomic() work.

Follow-up to 52aeaa7a5.

Change-Id: If4d455c98155283797678cfb9df31d5317dd91a2
(cherry picked from commit 20777d73998fb7024593752b0b3211d9d0e79b79)
includes/libs/rdbms/database/Database.php
tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php