[MDEV-15986] Allow TRUNCATE TABLE to execute if table is referenced via FK by an empty table Created: 2018-04-23  Updated: 2018-05-31

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Rick Pizzi Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Since the first days of InnoDB, it is impossible to execute a TRUNCATE TABLE if the table in question is referenced by another table via foreign keys.

While I understand that TRUNCATE TABLE is implemented as DDL, I think it could be safe and also very useful to allow the operation to proceed when the table which references the one to be truncated is empty, instead of forcing users to set FOREIGN_KEY_CHECKS=0.


Generated at Thu Feb 08 08:25:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.