I just started learning MySQL and I just got introduced to savepoints and rollbacks.
I did this:
START TRANSACTION;
CREATE TABLE test (
c1 int,
c2 varchar(10)
);
INSERT INTO test VALUES ('1', 'LINHA1');
SAVEPOINT A;
INSERT INTO test VALUES ('2', 'LINHA2');
ROLLBACK TO SAVEPOINT A;
When I run "rollback to savepoint A", it says "SAVEPOINT a does not exist".
In mysql, DDL (such as CREATE TABLE) can't be inside a transaction. Your CREATE TABLE is ending your transaction, and every statement thereafter is auto-committed, so there is no savepoint A by the time you do the ROLLBACK.