As documented under TRUNCATE TABLE
Syntax (emphasis added):
To achieve high performance, it bypasses the DML method of deleting data. Thus, it cannot be rolled back, it does not cause
ON DELETE
triggers to fire, and it cannot be performed forInnoDB
tables with parent-child foreign key relationships.Although
TRUNCATE TABLE
is similar toDELETE
, it is classified as a DDL statement rather than a DML statement. It differs fromDELETE
in the following ways in MySQL 5.5:
[ deletia ]
TRUNCATE TABLE
fails for anInnoDB
table if there are anyFOREIGN KEY
constraints from other tables that reference the table. Foreign key constraints between columns of the same table are permitted.