MySQL 8.0 supports atomic Data Definition Language (DDL) statements. MySQL 8.0支持原子数据定义语言(DDL)语句。This feature is referred to as atomic DDL. 这个特性称为原子DDL。An atomic DDL statement combines the data dictionary updates, storage engine operations, and binary log writes associated with a DDL operation into a single, atomic operation. 原子DDL语句将数据字典更新、存储引擎操作和与DDL操作相关联的二进制日志写入合并为单个原子操作。The operation is either committed, with applicable changes persisted to the data dictionary, storage engine, and binary log, or is rolled back, even if the server halts during the operation.该操作要么提交,对数据字典、存储引擎和二进制日志保留适用的更改,要么回滚,即使服务器在操作期间停止。
Atomic DDL is not transactional DDL. 原子DDL不是事务DDL。DDL statements, atomic or otherwise, implicitly end any transaction that is active in the current session, as if you had done a DDL语句(原子的或其他的)隐式地结束当前会话中任何活动的事务,就好像您在执行该语句之前做了一个COMMIT
before executing the statement. COMMIT
一样。This means that DDL statements cannot be performed within another transaction, within transaction control statements such as 这意味着DDL语句不能在另一个事务中执行,也不能在事务控制语句中执行,例如START TRANSACTION ... COMMIT
, or combined with other statements within the same transaction.START TRANSACTION ... COMMIT
,也不能与同一事务中的其他语句组合。
Atomic DDL is made possible by the introduction of the MySQL data dictionary in MySQL 8.0. MySQL 8.0中引入了MySQL数据字典,使原子DDL成为可能。In earlier MySQL versions, metadata was stored in metadata files, nontransactional tables, and storage engine-specific dictionaries, which necessitated intermediate commits. 在早期的MySQL版本中,元数据存储在元数据文件、非事务表和特定于存储引擎的字典中,这需要中间提交。Centralized, transactional metadata storage provided by the MySQL data dictionary removed this barrier, making it possible to restructure DDL statement operations to be atomic.MySQL数据字典提供的集中式事务性元数据存储消除了这一障碍,使DDL语句操作的原子化重组成为可能。
The atomic DDL feature is described under the following topics in this section:原子DDL功能在本节的以下主题中进行了描述:
The atomic DDL feature supports both table and non-table DDL statements. 原子DDL特性支持表和非表DDL语句。Table-related DDL operations require storage engine support, whereas non-table DDL operations do not. 与表相关的DDL操作需要存储引擎支持,而非表DDL操作则不需要。Currently, only the 目前,只有InnoDB
storage engine supports atomic DDL.InnoDB
存储引擎支持原子DDL。
Supported table DDL statements include 支持的表DDL语句包括数据库、表空间、表和索引的CREATE
, ALTER
, and DROP
statements for databases, tablespaces, tables, and indexes, and the TRUNCATE TABLE
statement.CREATE
、ALTER
和DROP
语句,以及TRUNCATE TABLE
语句。
Supported non-table DDL statements include:支持的非表DDL语句包括:
为存储程序、触发器、视图和可加载函数CREATE
and DROP
statements, and, if applicable, ALTER
statements for stored programs, triggers, views, and loadable functions.CREATE
和DROP
语句,如果适用,还可以ALTER
语句。
Account management statements: 帐户管理语句:为用户和角色CREATE
, ALTER
, DROP
, and, if applicable, RENAME
statements for users and roles, as well as GRANT
and REVOKE
statements.CREATE
、ALTER
、DROP
和(如果适用)RENAME
语句,以及GRANT
和REVOKE
语句。
The following statements are not supported by the atomic DDL feature:原子DDL功能不支持以下语句:
Table-related DDL statements that involve a storage engine other than 涉及InnoDB
.InnoDB
以外的存储引擎的表相关DDL语句。
INSTALL PLUGIN
and UNINSTALL PLUGIN
statements.INSTALL PLUGIN
语句和UNINSTALL PLUGIN
语句。
INSTALL COMPONENT
and UNINSTALL COMPONENT
statements.INSTALL COMPONENT
语句和UNINSTALL COMPONENT
语句。
CREATE SERVER
, ALTER SERVER
, and DROP SERVER
statements.CREATE SERVER
、ALTER SERVER
和DROP SERVER
语句。
The characteristics of atomic DDL statements include the following:原子DDL语句的特征包括:
Metadata updates, binary log writes, and storage engine operations, where applicable, are combined into a single atomic operation.元数据更新、二进制日志写入和存储引擎操作(如果适用)组合到单个原子操作中。
There are no intermediate commits at the SQL layer during the DDL operation.在DDL操作期间,SQL层没有中间提交。
Where applicable:如适用:
The state of data dictionary, routine, event, and loadable function caches is consistent with the status of the DDL operation, meaning that caches are updated to reflect whether or not the DDL operation was completed successfully or rolled back.数据字典、例程、事件和可加载函数缓存的状态与DDL操作的状态一致,这意味着缓存将更新以反映DDL操作是否成功完成或回滚。
The storage engine methods involved in a DDL operation do not perform intermediate commits, and the storage engine registers itself as part of the DDL operation.DDL操作中涉及的存储引擎方法不执行中间提交,存储引擎将自己注册为DDL操作的一部分。
The storage engine supports redo and rollback of DDL operations, which is performed in the Post-DDL phase of the DDL operation.存储引擎支持DDL操作的重做和回滚,这是在DDL操作的后DDL阶段执行的。
The visible behaviour of DDL operations is atomic, which changes the behavior of some DDL statements. DDL操作的可见行为是原子的,这改变了一些DDL语句的行为。See Changes in DDL Statement Behavior.请参阅DDL语句行为中的更改。
This section describes changes in DDL statement behavior due to the introduction of atomic DDL support.本节描述由于引入原子DDL支持而导致的DDL语句行为的变化。
如果所有命名表都使用原子DDL支持的存储引擎,则DROP TABLE
operations are fully atomic if all named tables use an atomic DDL-supported storage engine. DROP TABLE
操作是完全原子的。The statement either drops all tables successfully or is rolled back.语句要么成功删除所有表,要么回滚。
如果命名表不存在,并且无论存储引擎如何,都不会进行任何更改,则DROP TABLE
fails with an error if a named table does not exist, and no changes are made, regardless of the storage engine. DROP TABLE
将失败并出现错误。This change in behavior is demonstrated in the following example, where the 下面的示例演示了这种行为变化,其中DROP TABLE
statement fails because a named table does not exist:DROP TABLE
语句由于命名表不存在而失败:
mysql>CREATE TABLE t1 (c1 INT);
mysql>DROP TABLE t1, t2;
ERROR 1051 (42S02): Unknown table 'test.t2' mysql>SHOW TABLES;
+----------------+ | Tables_in_test | +----------------+ | t1 | +----------------+
Prior to the introduction of atomic DDL, 在引入原子DDL之前,DROP TABLE
reports an error for the named table that does not exist but succeeds for the named table that does exist:DROP TABLE
为不存在的命名表报告错误,但为存在的命名表报告成功:
mysql>CREATE TABLE t1 (c1 INT);
mysql>DROP TABLE t1, t2;
ERROR 1051 (42S02): Unknown table 'test.t2' mysql>SHOW TABLES;
Empty set (0.00 sec)
Due to this change in behavior, a partially completed 由于行为上的这种变化,当在MySQL 8.0副本上复制时,MySQL 5.7复制源服务器上部分完成的DROP TABLE
statement on a MySQL 5.7 replication source server fails when replicated on a MySQL 8.0 replica. DROP TABLE
语句将失败。To avoid this failure scenario, use 要避免这种失败情况,请在IF EXISTS
syntax in DROP TABLE
statements to prevent errors from occurring for tables that do not exist.DROP TABLE
语句中使用IF EXISTS
语法,以防止不存在的表出错。
如果所有表都使用支持原子DDL的存储引擎,则DROP DATABASE
is atomic if all tables use an atomic DDL-supported storage engine. DROP DATABASE
是原子的。The statement either drops all objects successfully or is rolled back. 语句要么成功删除所有对象,要么回滚。However, removal of the database directory from the file system occurs last and is not part of the atomic operation. 但是,从文件系统中删除数据库目录是最后一次,并且不是原子操作的一部分。If removal of the database directory fails due to a file system error or server halt, the 如果由于文件系统错误或服务器停止而删除数据库目录失败,则不会回滚DROP DATABASE
transaction is not rolled back.DROP DATABASE
事务。
For tables that do not use an atomic DDL-supported storage engine, table deletion occurs outside of the atomic 对于不使用原子DDL支持的存储引擎的表,表删除发生在原子DROP TABLE
or DROP DATABASE
transaction. DROP table
或DROP DATABASE
事务之外。Such table deletions are written to the binary log individually, which limits the discrepancy between the storage engine, data dictionary, and binary log to one table at most in the case of an interrupted 这样的表删除会分别写入二进制日志,这样在中断DROP TABLE
or DROP DATABASE
operation. DROP TABLE
或DROP DATABASE
操作的情况下,存储引擎、数据字典和二进制日志之间的差异最多只能限于一个表。For operations that drop multiple tables, the tables that do not use an atomic DDL-supported storage engine are dropped before tables that do.对于删除多个表的操作,不使用原子DDL支持的存储引擎的表将在使用原子DDL支持的存储引擎的表之前删除。
使用支持DDL的原子存储引擎的表的CREATE TABLE
, ALTER TABLE
, RENAME TABLE
, TRUNCATE TABLE
, CREATE TABLESPACE
, and DROP TABLESPACE
operations for tables that use an atomic DDL-supported storage engine are either fully committed or rolled back if the server halts during their operation. CREATE TABLE
、ALTER TABLE
、RENAME TABLE
、TRUNCATE TABLE
、CREATE TABLESPACE
和DROP TABLESPACE
操作要么完全提交,要么在操作期间服务器停止时回滚。In earlier MySQL releases, interruption of these operations could cause discrepancies between the storage engine, data dictionary, and binary log, or leave behind orphan files. 在早期的MySQL版本中,这些操作的中断可能会导致存储引擎、数据字典和二进制日志之间的差异,或者留下孤立文件。只有当所有命名表都使用支持原子DDL的存储引擎时,RENAME TABLE
operations are only atomic if all named tables use an atomic DDL-supported storage engine.RENAME TABLE
操作才是原子的。
As of MySQL 8.0.21, on storage engines that support atomic DDL, the 从MySQL8.0.21开始,在支持原子DDL的存储引擎上,当使用基于行的复制时,CREATE TABLE ... SELECT
statement is logged as one transaction in the binary log when row-based replication is in use. CREATE TABLE ... SELECT
语句作为一个事务记录在二进制日志中。Previously, it was logged as two transactions, one to create the table, and the other to insert data. 以前,它被记录为两个事务,一个用于创建表,另一个用于插入数据。A server failure between the two transactions or while inserting data could result in replication of an empty table. 两个事务之间或插入数据时发生服务器故障可能会导致复制空表。With the introduction of atomic DDL support, 随着原子DDL支持的引入,CREATE TABLE ... SELECT
statements are now safe for row-based replication and permitted for use with GTID-based replication.CREATE TABLE ... SELECT
语句现在对于基于行的复制是安全的,并且允许与基于GTID的复制一起使用。
On storage engines that support both atomic DDL and foreign key constraints, creation of foreign keys is not permitted in 在同时支持原子DDL和外键约束的存储引擎上,当使用基于行的复制时,不允许在CREATE TABLE ... SELECT
statements when row-based replication is in use. CREATE TABLE ... SELECT
语句中创建外键。Foreign key constraints can be added later using 外键约束可以稍后使用ALTER TABLE
.ALTERTABLE
添加。
When 当CREATE TABLE ... SELECT
is applied as an atomic operation, a metadata lock is held on the table while data is inserted, which prevents concurrent access to the table for the duration of the operation.CREATE TABLE ... SELECT
作为原子操作应用,插入数据时在表上保留元数据锁,这会在操作期间阻止对表的并发访问。
如果命名视图不存在且未进行任何更改,则DROP VIEW
fails if a named view does not exist, and no changes are made. DROP VIEW
将失败。The change in behavior is demonstrated in this example, where the 此示例演示了行为的更改,其中DROP VIEW
statement fails because a named view does not exist:DROP VIEW
语句由于不存在命名视图而失败:
mysql>CREATE VIEW test.viewA AS SELECT * FROM t;
mysql>DROP VIEW test.viewA, test.viewB;
ERROR 1051 (42S02): Unknown table 'test.viewB' mysql>SHOW FULL TABLES IN test WHERE TABLE_TYPE LIKE 'VIEW';
+----------------+------------+ | Tables_in_test | Table_type | +----------------+------------+ | viewA | VIEW | +----------------+------------+
Prior to the introduction of atomic DDL, 在引入原子DDL之前,DROP VIEW
returns an error for the named view that does not exist but succeeds for the named view that does exist:DROP VIEW
为不存在的命名视图返回一个错误,但为存在的命名视图返回一个成功的错误:
mysql>CREATE VIEW test.viewA AS SELECT * FROM t;
mysql>DROP VIEW test.viewA, test.viewB;
ERROR 1051 (42S02): Unknown table 'test.viewB' mysql>SHOW FULL TABLES IN test WHERE TABLE_TYPE LIKE 'VIEW';
Empty set (0.00 sec)
Due to this change in behavior, a partially completed 由于行为上的这种变化,当在MySQL 8.0副本上复制时,MySQL 5.7复制源服务器上部分完成的DROP VIEW
operation on a MySQL 5.7 replication source server fails when replicated on a MySQL 8.0 replica. DROP VIEW
操作将失败。To avoid this failure scenario, use 若要避免此失败场景,请在IF EXISTS
syntax in DROP VIEW
statements to prevent an error from occurring for views that do not exist.DROP VIEW
语句中使用IF EXISTS
语法,以防止不存在的视图发生错误。
Partial execution of account management statements is no longer permitted. 不再允许部分执行账户管理报表。Account management statements either succeed for all named users or roll back and have no effect if an error occurs. 帐户管理语句要么对所有指定用户成功,要么回滚,并且在发生错误时不起作用。In earlier MySQL versions, account management statements that name multiple users could succeed for some users and fail for others.在早期的MySQL版本中,命名多个用户的帐户管理语句可能对某些用户成功,而对其他用户失败。
The change in behavior is demonstrated in this example, where the second 这个例子演示了行为的变化,其中第二个CREATE USER
statement returns an error but fails because it cannot succeed for all named users.CREATE USER
语句返回一个错误,但是失败了,因为它不能对所有命名用户成功。
mysql>CREATE USER userA;
mysql>CREATE USER userA, userB;
ERROR 1396 (HY000): Operation CREATE USER failed for 'userA'@'%' mysql>SELECT User FROM mysql.user WHERE User LIKE 'user%';
+-------+ | User | +-------+ | userA | +-------+
Prior to the introduction of atomic DDL, the second 在引入原子DDL之前,第二条CREATE USER
statement returns an error for the named user that does not exist but succeeds for the named user that does exist:CREATE USER
语句为不存在的命名用户返回一个错误,但为存在的命名用户返回一个成功的错误:
mysql>CREATE USER userA;
mysql>CREATE USER userA, userB;
ERROR 1396 (HY000): Operation CREATE USER failed for 'userA'@'%' mysql>SELECT User FROM mysql.user WHERE User LIKE 'user%';
+-------+ | User | +-------+ | userA | | userB | +-------+
Due to this change in behavior, partially completed account management statements on a MySQL 5.7 replication source server fail when replicated on a MySQL 8.0 replica. 由于行为上的这种变化,当在MySQL 8.0副本上复制时,MySQL 5.7复制源服务器上部分完成的帐户管理语句将失败。To avoid this failure scenario, use 要避免此失败场景,请在帐户管理语句中使用IF EXISTS
or IF NOT EXISTS
syntax, as appropriate, in account management statements to prevent errors related to named users.IF EXISTS
或IF NOT EXISTS
语法(视情况而定),以防止与命名用户相关的错误。
Currently, only the 目前,只有InnoDB
storage engine supports atomic DDL. InnoDB
存储引擎支持原子DDL。Storage engines that do not support atomic DDL are exempted from DDL atomicity. 不支持原子DDL的存储引擎不受DDL原子性的限制。DDL operations involving exempted storage engines remain capable of introducing inconsistencies that can occur when operations are interrupted or only partially completed.涉及豁免存储引擎的DDL操作仍然能够引入不一致性,这些不一致性可能在操作中断或仅部分完成时发生。
To support redo and rollback of DDL operations, 为了支持DDL操作的重做和回滚,InnoDB
writes DDL logs to the mysql.innodb_ddl_log
table, which is a hidden data dictionary table that resides in the mysql.ibd
data dictionary tablespace.InnoDB
将DDL日志写入mysql.innodb_ddl_log
表,这是一个隐藏的数据字典表,位于mysql.ibd
数据字典表空间中。
To view DDL logs that are written to the 要在DDL操作期间查看写入mysql.innodb_ddl_log
table during a DDL operation, enable the innodb_print_ddl_logs
configuration option. mysql.innodb_DDL_log
表的DDL日志,请启用innodb_print_DDL_logs
配置选项。For more information, see Viewing DDL Logs.有关更多信息,请参阅查看DDL日志。
The redo logs for changes to the 不管mysql.innodb_ddl_log
table are flushed to disk immediately regardless of the innodb_flush_log_at_trx_commit
setting. nnodb_flush_log_at_trx_commit
设置如何,mysql.innodb_ddl_log
表更改的重做日志都会立即刷新到磁盘。Flushing the redo logs immediately avoids situations where data files are modified by DDL operations but the redo logs for changes to the 立即刷新重做日志可避免数据文件被DDL操作修改的情况,但由于这些操作而导致的mysql.innodb_ddl_log
table resulting from those operations are not persisted to disk. mysql.innodb_DDL_log
表更改的重做日志不会持久化到磁盘。Such a situation could cause errors during rollback or recovery.这种情况可能会在回滚或恢复期间导致错误。
The InnoDB
storage engine executes DDL operations in phases. InnoDB
存储引擎分阶段执行DDL操作。DDL operations such as 诸如ALTER TABLE
may perform the Prepare and Perform phases multiple times prior to the Commit phase.ALTER TABLE
之类的DDL操作可以在提交阶段之前多次执行准备阶段和实施阶段。
Prepare准备: Create the required objects and write the DDL logs to the :创建所需的对象,并将DDL日志写入mysql.innodb_ddl_log
table. mysql.innodb_DDL_log
表。The DDL logs define how to roll forward and roll back the DDL operation.DDL日志定义了如何前滚和回滚DDL操作。
Perform实施: Perform the DDL operation. :执行DDL操作。For example, perform a create routine for a 例如,执行CREATE TABLE
operation.CREATE TABLE
操作的创建例程。
Commit提交: Update the data dictionary and commit the data dictionary transaction.:更新数据字典并提交数据字典事务。
Post-DDL后DDL: Replay and remove DDL logs from the :从mysql.innodb_ddl_log
table. mysql.innodb_DDL_log
表中重放并删除DDL日志。To ensure that rollback can be performed safely without introducing inconsistencies, file operations such as renaming or removing data files are performed in this final phase. 为了确保可以安全地执行回滚而不引入不一致性,文件操作(如重命名或删除数据文件)将在此最后阶段执行。This phase also removes dynamic metadata from the 此阶段还从mysql.innodb_dynamic_metadata
data dictionary table for DROP TABLE
, TRUNCATE TABLE
, and other DDL operations that rebuild the table.mysql.innodb_dynamic_metadata
数据字典表中删除动态元数据,用于DROP TABLE
、TRUNCATE TABLE
和其他重建表的DDL操作。
DDL logs are replayed and removed from the 在后DDL阶段,无论DDL操作是提交还是回滚,都会重放DDL日志,并从mysql.innodb_ddl_log
table during the Post-DDL phase, regardless of whether the DDL operation is committed or rolled back. mysql.innodb_ddl_log
表中删除这些日志。DDL logs should only remain in the 如果服务器在DDL操作期间停止,则DDL日志应仅保留在mysql.innodb_ddl_log
table if the server is halted during a DDL operation. mysql.innodb_ddl_log
表中。In this case, the DDL logs are replayed and removed after recovery.在这种情况下,DDL日志将在恢复后重放并删除。
In a recovery situation, a DDL operation may be committed or rolled back when the server is restarted. 在恢复情况下,可以在服务器重新启动时提交或回滚DDL操作。If the data dictionary transaction that was performed during the Commit phase of a DDL operation is present in the redo log and binary log, the operation is considered successful and is rolled forward. 如果在DDL操作的提交阶段执行的数据字典事务存在于重做日志和二进制日志中,则该操作被视为成功,并被前滚。Otherwise, the incomplete data dictionary transaction is rolled back when 否则,InnoDB
replays data dictionary redo logs, and the DDL operation is rolled back.InnoDB
重放数据字典重做日志时,不完整的数据字典事务被回滚,DDL操作被回滚。
To view DDL logs that are written to the 要查看在涉及mysql.innodb_ddl_log
data dictionary table during atomic DDL operations that involve the InnoDB
storage engine, enable innodb_print_ddl_logs
to have MySQL write the DDL logs to stderr
. InnoDB
存储引擎的原子DDL操作过程中写入mysql.innodb_DDL_log
数据字典表的DDL日志,请启用innodb_print_DDL_logs
以使mysql将DDL日志写入stderr
。Depending on the host operating system and MySQL configuration, 根据主机操作系统和MySQL配置,stderr
may be the error log, terminal, or console window. stderr
可能是错误日志、终端或控制台窗口。See Section 5.4.2.2, “Default Error Log Destination Configuration”.请参阅第5.4.2.2节,“默认错误日志目标配置”。
InnoDB
writes DDL logs to the mysql.innodb_ddl_log
table to support redo and rollback of DDL operations. InnoDB
将DDL日志写入mysql.innodb_ddl_log
表,以支持DDL操作的重做和回滚。The mysql.innodb_ddl_log
table is a hidden data dictionary table that resides in the mysql.ibd
data dictionary tablespace. innodb_ddl_log
表是一个隐藏的数据字典表,驻留在mysql.ibd
数据字典表空间中。Like other hidden data dictionary tables, the 与其他隐藏数据字典表一样,mysql.innodb_ddl_log
table cannot be accessed directly in non-debug versions of MySQL. mysql.innodb_ddl_log
表在mysql的非调试版本中不能直接访问。(See Section 14.1, “Data Dictionary Schema”.) (请参阅第14.1节,“数据字典模式”。)The structure of the mysql.innodb_ddl_log
table corresponds to this definition:mysql.innodb_ddl_log
表的结构与此定义相对应:
CREATE TABLE mysql.innodb_ddl_log ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, thread_id BIGINT UNSIGNED NOT NULL, type INT UNSIGNED NOT NULL, space_id INT UNSIGNED, page_no INT UNSIGNED, index_id BIGINT UNSIGNED, table_id BIGINT UNSIGNED, old_file_path VARCHAR(512) COLLATE UTF8_BIN, new_file_path VARCHAR(512) COLLATE UTF8_BIN, KEY(thread_id) );
id
: A unique identifier for a DDL log record.:DDL日志记录的唯一标识符。
thread_id
: Each DDL log record is assigned a :为每个DDL日志记录分配一个thread_id
, which is used to replay and remove DDL logs that belong to a particular DDL operation. thread_id
,用于重播和删除属于特定DDL操作的DDL日志。DDL operations that involve multiple data file operations generate multiple DDL log records.涉及多个数据文件操作的DDL操作生成多个DDL日志记录。
type
: The DDL operation type. Types include :DDL操作类型。类型包括FREE
(drop an index tree), DELETE
(delete a file), RENAME
(rename a file), or DROP
(drop metadata from the mysql.innodb_dynamic_metadata
data dictionary table).FREE
(删除索引树)、DELETE
(删除文件)、RENAME
(重命名文件)或DROP
(从mysql.innodb_dynamic_metadata
数据字典表中删除元数据)。
space_id
: The tablespace ID.:表空间ID。
page_no
: A page that contains allocation information; an index tree root page, for example.:包含分配信息的页面;例如,索引树根页。
index_id
: The index ID.:索引ID。
table_id
: The table ID.:表ID。
old_file_path
: The old tablespace file path. :旧表空间文件路径。Used by DDL operations that create or drop tablespace files; also used by DDL operations that rename a tablespace.用于创建或删除表空间文件的DDL操作;也由重命名表空间的DDL操作使用。
new_file_path
: The new tablespace file path. Used by DDL operations that rename tablespace files.:新表空间文件路径。由重命名表空间文件的DDL操作使用。
This example demonstrates enabling 此示例演示如何启用innodb_print_ddl_logs
to view DDL logs written to strderr
for a CREATE TABLE
operation.innodb_print_ddl_logs
来查看为CREATE TABLE
操作写入strderr
的ddl日志。
mysql> SET GLOBAL innodb_print_ddl_logs=1; mysql> CREATE TABLE t1 (c1 INT) ENGINE = InnoDB;
[Note] [000000] InnoDB: DDL log insert : [DDL record: DELETE SPACE, id=18, thread_id=7, space_id=5, old_file_path=./test/t1.ibd] [Note] [000000] InnoDB: DDL log delete : by id 18 [Note] [000000] InnoDB: DDL log insert : [DDL record: REMOVE CACHE, id=19, thread_id=7, table_id=1058, new_file_path=test/t1] [Note] [000000] InnoDB: DDL log delete : by id 19 [Note] [000000] InnoDB: DDL log insert : [DDL record: FREE, id=20, thread_id=7, space_id=5, index_id=132, page_no=4] [Note] [000000] InnoDB: DDL log delete : by id 20 [Note] [000000] InnoDB: DDL log post ddl : begin for thread id : 7 [Note] [000000] InnoDB: DDL log post ddl : end for thread id : 7