TRUNCATE TABLE
is normally
regarded as a DML statement, and so would be expected to be
logged and replicated using row-based format when the binary
logging mode is ROW
or
MIXED
. However this caused issues when
logging or replicating, in STATEMENT
or
MIXED
mode, tables that used transactional
storage engines such as InnoDB
when
the transaction isolation level was READ
COMMITTED
or READ UNCOMMITTED
,
which precludes statement-based logging.
TRUNCATE TABLE
is treated for
purposes of logging and replication as DDL rather than DML so
that it can be logged and replicated as a statement. However,
the effects of the statement as applicable to
InnoDB
and other transactional
tables on replication slaves still follow the rules described in
Section 12.2.10, “TRUNCATE TABLE
Syntax” governing such tables.
(Bug#36763)
User Comments
Add your own comment.