1616
1616
DRIZZLE_LOCK *extra_lock= NULL;
1618
For row-based replication, the CREATE-SELECT statement is written
1619
in two pieces: the first one contain the CREATE TABLE statement
1620
necessary to create the table and the second part contain the rows
1621
that should go into the table.
1623
For non-temporary tables, the start of the CREATE-SELECT
1624
implicitly commits the previous transaction, and all events
1625
forming the statement will be stored the transaction cache. At end
1626
of the statement, the entire statement is committed as a
1627
transaction, and all events are written to the binary log.
1629
On the master, the table is locked for the duration of the
1630
statement, but since the CREATE part is replicated as a simple
1631
statement, there is no way to lock the table for accesses on the
1632
slave. Hence, we have to hold on to the CREATE part of the
1633
statement until the statement has finished.
1618
For replication, the CREATE-SELECT statement is written
1619
in two pieces: the first transaction messsage contains
1620
the CREATE TABLE statement as a CreateTableStatement message
1621
necessary to create the table.
1623
The second transaction message contains all the InsertStatement
1624
and associated InsertRecords that should go into the table.
1639
Start a statement transaction before the create if we are using
1640
row-based replication for the statement. If we are creating a
1641
temporary table, we need to start a statement transaction.
1644
1629
if (!(table= create_table_from_items(session, create_info, create_table,
1646
1631
alter_info, &values,