[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. |