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>
Thu, 19 Apr 2018 19:43:01 +0000 (12:43 -0700)
commit20777d73998fb7024593752b0b3211d9d0e79b79
tree712218a80709968837e0efae7c507b492de59f8e
parent17c9569dc594dbe7f21d43244d633b5bc7cfe862
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
includes/libs/rdbms/database/Database.php
tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php