MySQL事务不支持Truncate命令和其他操作一起回滚

1 · · Sept. 10, 2022, 5:49 a.m.
Data Manipulation Language (DML) 数据操作语言 (select,insert,update等,主要用于调整查询数据 ) Data Definition Language (DDL) 数据定义语言 (CREATE,TRUNCATE,DROP,ALTER等,主要用于调整数据库的定义结构等元数据 ) 根据https://dev.mysql.com/doc/refman/8.0/en/atomic-ddl.html文档, mysql提供了原子性的DDL语句,每次执行truncate操作都会直接提交COMMIT,要么成功要么失败,但无法与其他语句一起组合成为事务 Atomic DDL is not transactional DDL. DDL statements, atomic or otherwise, implicitly end any transaction that is active in the current session, as if you had done a COMMIT before executing the stateme...