Bug #99232 | Cross schema foreign key blocks schema drop while queries are running | ||
---|---|---|---|
Submitted: | 11 Apr 2020 6:57 | Modified: | 13 Apr 2020 13:17 |
Reporter: | Andre Scheidtmann | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 8.0.17 | OS: | Debian (Debian 18.04 and Windows 10) |
Assigned to: | CPU Architecture: | Any |
[11 Apr 2020 6:57]
Andre Scheidtmann
[13 Apr 2020 13:17]
MySQL Verification Team
Hi Mr. Scheidtmann, Thank you for your bug report. I have carefully analysed your report and I must inform you that this is not a bug. Simply, referential integrity has to be enforced, which is unrelated to the setting of the foreign key checks. When you have a foreign key in one table, pointing to the key in the parent table, then you have to drop lowest relation in the hierarchy, in your case table db2.t2, before you can drop parent table, in your case db1.t1. This is obligatory enforcement in the ACID engines, like InnoDB. It is explain in several chapters in our Reference Manual, including the chapter 16.11.2. Since dropping tables or schemas involves data dictionary, then metadata locking has to be involved, which are at SQL lever, not at storage level. Not a bug.