> "Instead of cancelling the transaction, the ROLLBACK TO command > restarts the transaction again at the beginning. All intervening > SAVEPOINTs are cancelled, however." > > Say we have the following events: > > begin > insert > update > savepoint A > update > savepoint B > insert > delete > savepoint C > update > rollback to B > > I would expect the last statement to: > cancel the whole transaction (contrary to what's said) > then re-apply changes: > > begin > insert > update > savepoint A ??? > update
That's correct. But savepoint B is opened as well. That's the point of the excerpt - that savepoint B remains open. The difference is: BEGIN; .... ROLLBACK; /* Database state restored, transaction is no longer open */ vs: SAVEPOINT outer; .... ROLLBACK TO outer; /* Database state restored, transaction is still open */ Dan. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users