Documentation Home
MySQL 9.4 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 41.2Mb
PDF (A4) - 41.3Mb
Man Pages (TGZ) - 262.8Kb
Man Pages (Zip) - 368.8Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb


19.5.1.38 Replication and TRUNCATE TABLE

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 isROW orMIXED. However this caused issues when logging or replicating, inSTATEMENT orMIXED mode, tables that used transactional storage engines such asInnoDB when the transaction isolation level wasREAD COMMITTED orREAD 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 toInnoDB and other transactional tables on replicas still follow the rules described inSection 15.1.42, “TRUNCATE TABLE Statement” governing such tables. (Bug #36763)