The following rules and decisions are applied when a
CREATE TABLE ... SELECT statement is
replicated:
All CREATE TABLE ... SELECT statements do
implicit commit.
If there are no failures, then all CREATE TABLE ...
SELECT statements are replicated as follows:
For STATEMENT and
MIXED format, as the CREATE
TABLE ... SELECT statement itself.
For ROW format, as a CREATE
TABLE statement followed by binwrite events.
Requirements for CREATE TABLE t2 SELECT
... using both transactional and non-transactional
tables:
For STATEMENT,
MIXED, and ROW
formats:
If the table already exists, then the statement does nothing on the master, and only the implicit commit is logged.
If other execution failure (and thus
t2 did not exist), then the table
is never created on master and only the implicit
commit is logged.
Requirements for CREATE TABLE IF NOT EXISTS t2
SELECT ...
For STATEMENT and
MIXED format:
If execution failure, then statement is logged with error code.
For ROW format when t2 is
transactional:
If table already exists, then
The CREATE TABLE part of the
statement is not logged.
All applied rows are logged.
The implicit commit is logged.
If other failure in creating table, then only the implicit commit is logged.
If failure in selecting or inserting (but create succeeded), then the table is dropped on master and only the implicit commit is logged.
For ROW format when t2 is
non-transactional:
If table already exists, then:
the CREATE TABLE part of the
statement is not logged.
All applied rows are logged.
The implicit commit is logged.
If other failure in creating table, then only the implicit commit is logged.
If failure in selecting or inserting (but create succeeded), then:
The CREATE TABLE part of the
statement is logged.
All applied rows are logged.
The implicit commit is logged.

User Comments
Add your own comment.