如图,开启事务,第二条SQL发生错误,COMMIT之后发现第一条SQL并没有"回滚"。
MySQL 5.7存储引擎InnoDB
在MySQL文档中发现这么一句话
InnoDB sometimes rolls back only the statement that failed, other times it rolls back the entire transaction.https://dev.mysql.com/doc/ref...
InnoDB
如何理解上述现象?
因为你手动commit了事务,会把成功的sql执行
1.4m articles
1.4m replys
5 comments
56.7k users