jeudi 5 février 2015

Does SQLite rollback automatically if statement fail?

There is this documentation for sqlite: http://ift.tt/1sS8Il1 which doesn't say anything about what happens in case I have case like:



BEGIN;
INSERT INTO a (x, y) VALUES (0, 0);
INSERT INTO b (x, y) VALUES (1, 2); -- line 3 error here, b doesn't have column x
COMMIT;


What happens in this case? Does it commit or rollback if there is error in line 3? I would expect automatic rollback, but I would like to be sure about it.


Aucun commentaire:

Enregistrer un commentaire