fix sqlite rollback-transaction in case of auto-rollback error
Merge to release branch.
An invalid (needs-rollback?) transaction may correspond to a closed
underlying transaction. In that case, don't issue ROLLBACK command.
(cherry picked from commit 06aa4770f1
)
This commit is contained in:
parent
51647f1608
commit
0e4eed4e29
|
@ -302,10 +302,15 @@
|
||||||
(internal-query1 fsym "COMMIT TRANSACTION")]))
|
(internal-query1 fsym "COMMIT TRANSACTION")]))
|
||||||
((rollback)
|
((rollback)
|
||||||
(cond [savepoint
|
(cond [savepoint
|
||||||
|
;; FIXME: if nested tx is invalid, enclosing tx might be invalid too
|
||||||
|
;; (eg, IOERR). Add way to communicate back enclosing tx validity.
|
||||||
(internal-query1 fsym (format "ROLLBACK TO SAVEPOINT ~a" savepoint))
|
(internal-query1 fsym (format "ROLLBACK TO SAVEPOINT ~a" savepoint))
|
||||||
(internal-query1 fsym (format "RELEASE SAVEPOINT ~a" savepoint))]
|
(internal-query1 fsym (format "RELEASE SAVEPOINT ~a" savepoint))]
|
||||||
|
[(read-tx-status)
|
||||||
|
(internal-query1 fsym "ROLLBACK TRANSACTION")]
|
||||||
[else
|
[else
|
||||||
(internal-query1 fsym "ROLLBACK TRANSACTION")])
|
;; underlying tx already closed due to auto-rollback error
|
||||||
|
(void)])
|
||||||
;; remove 'invalid status, if necessary
|
;; remove 'invalid status, if necessary
|
||||||
(set-tx-status! fsym (read-tx-status))))
|
(set-tx-status! fsym (read-tx-status))))
|
||||||
(void))
|
(void))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user