
I have searched the MySql documentation and found nothing. I have tried this ... the Rollback doesn't seem to cancel the inserts made in table1 and table2
Start Transaction;
INSERT INTO Table1(field1,field2) VALUES (value1, value2);
INSERT INTO Table2(field3,field4) VALUES (value3, value4);
INSERT INTO Table3(field5,field6) VALUES (value5, value6);
Rollback;
UPDATE: Thanks for all answers, but I forgot to tell that the 3rd statement throws an exception (Constraint Violation).
解决方案
As of current version of MySql v5.1 ... it does not support rollback over multiple tables ... That might change (I hope) in the near future!
489

被折叠的 条评论
为什么被折叠?



