This section discusses the rules that are applied when a
CREATE TABLE ...
SELECT statement is replicated.
CREATE TABLE ...
SELECT always performs an implicit commit
(Section 12.4.3, “Statements That Cause an Implicit Commit”).
Statement succeeds.
If the CREATE
TABLE ... SELECT statement succeeds on the master,
then the CREATE
TABLE ... SELECT statement is itself replicated.
Statement fails.
The failure of a
CREATE TABLE ...
SELECT is handled according to the following
criteria:
No IF NOT EXISTS option.
If the
CREATE
TABLE ... SELECT does not contain an
IF NOT EXISTS option, then the
statement has no effect. However, the implicit commit
caused by the statement is logged. This is true
regardless of the storage engine used and the reason
for which the statement failed.
Statement uses IF NOT EXISTS.
If the
CREATE
TABLE ... SELECT statement includes the
IF NOT EXISTS option and fails, the
CREATE TABLE IF NOT EXISTS ...
SELECT is logged with an error.


User Comments
Add your own comment.