DROP TABLE test;
CREATE TABLE test (
id VARCHAR(10) PRIMARY KEY
) ENGINE=InnoDB;
SET autocommit=0;
START TRANSACTION;
insert test values ('test1');
COMMIT;
SET autocommit=0;
START TRANSACTION;
insert test values ('test2');
insert test values ('test1');
ROLLBACK;
insert with value test2 is committed to database, is it correct behavior?
This behavior cases to me a lot of problems, mainly I can't run anything in transaction because if there is an error part of transaction before error is committed.