Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Not a Bug
-
Affects Version/s: 10.1, 10.0, 5.5
-
Fix Version/s: N/A
-
Component/s: Documentation, Storage Engine - InnoDB
-
Labels:
-
Environment:Debian Linux x64
Description
According to the documentation (https://mariadb.com/kb/en/mariadb/truncate-table/) a truncate on a table with InnoDB should empty the table by deleting the table and recreating it. If the table contains foreign keys the engine should delete row after row and trigger all foreign keys. But thats currently not the case. Currently mariadb fails with the error:
ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint
Thanks and greetings
Leo
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Thanks for the report.
Apparently, our KB is outdated. Same happens on MySQL 5.5/5.6 (as opposed to MySQL 5.1), and it's been documented in MySQL manual accordingly. Compare:
MySQL 5.1 manual
MySQL 5.5 manual
Naturally, we inherited the same behavior in MariaDB 5.5 and then 10.0.