#### 17.5.1.7 Replication of CREATE TABLE ... SELECT Statements

[]()[]()

 MySQL applies these rules when [`CREATE TABLE ... SELECT`](create-table-select.html) statements are replicated:

* [`CREATE TABLE ... SELECT`](create-table-select.html) always performs an implicit commit ([Section 13.3.3, “Statements That Cause an Implicit Commit”](implicit-commit.html)).

* If the destination table does not exist, logging occurs as follows. It does not matter whether `IF NOT EXISTS` is present.

  * `STATEMENT` or `MIXED` format: The statement is logged as written.

  * `ROW` format: The statement is logged as a [`CREATE TABLE`](create-table.html) statement followed by a series of insert-row events.

     Prior to MySQL 8.0.21, the statement is logged as two transactions. As of MySQL 8.0.21, on storage engines that support atomic DDL, it is logged as one transaction. For more information, see [Section 13.1.1, “Atomic Data Definition Statement Support”](atomic-ddl.html).

* If the [`CREATE TABLE ... SELECT`](create-table-select.html) statement fails, nothing is logged. This includes the case that the destination table exists and `IF NOT EXISTS` is not given.

* If the destination table exists and `IF NOT EXISTS` is given, MySQL 8.0 ignores the statement completely; nothing is inserted or logged.

 MySQL 8.0 does not allow a [`CREATE TABLE ... SELECT`](create-table-select.html) statement to make any changes in tables other than the table that is created by the statement.

