can cause database corruption after a ROLLBACK. Also add new tests to make sure everything is working this time. (CVS 663) FossilOrigin-Name: f6e24d5ccbcfcf5863ffbd65860dafa2f5663e99
FossilOrigin-Name: f8328a5f11801c5124f9a8dace22df3c1cfb2191
FossilOrigin-Name: 4e926efe2b59adfec4086eb1d2ba830238facb4c