简体   繁体   中英

Can DML and DDL statements be in a transaction together

I would like to create a table and perform an insertion all in one transaction. Can this be done in MySQL?

According to MySQL:

Some statements cannot be rolled back. In general, these include data definition language (DDL) statements, such as those that create or drop databases, those that create, drop, or alter tables or stored routines.

Documentation

不,MySQL(嗯,InnoDB)不支持DDL语句的事务。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM