Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5, 10.6, 10.11, 11.1, 11.2, 11.4, 11.5, 11.6
-
None
Description
Similar to the previously fixed MDEV-29092 we see:
11.5.0 e4afa610539ae01164485554e2de839bea9de816 (Debug) |
11.5.0-dbg>CREATE TABLE t (c1 INT PRIMARY KEY,c2 INT,FOREIGN KEY(c2) REFERENCES t (c1));
|
Query OK, 0 rows affected (0.011 sec)
|
 |
11.5.0-dbg>ALTER TABLE t DROP PRIMARY KEY;
|
ERROR 1025 (HY000): Error on rename of './test/#sql-alter-2ff04a-4' to './test/t' (errno: 150 "Foreign key constraint is incorrectly formed")
|
11.5.0-dbg>SHOW WARNINGS;
|
+-------+------+---------------------------------------------------------------------------------------------------------------------------+
|
| Level | Code | Message |
|
+-------+------+---------------------------------------------------------------------------------------------------------------------------+
|
| Error | 1025 | Error on rename of './test/#sql-alter-2ff04a-4' to './test/t' (errno: 150 "Foreign key constraint is incorrectly formed") |
|
+-------+------+---------------------------------------------------------------------------------------------------------------------------+
|
1 row in set (0.000 sec)
|
11.5.0 e4afa610539ae01164485554e2de839bea9de816 (Debug) |
2024-06-15 11:50:06 4 [ERROR] InnoDB: In ALTER TABLE `test`.`t` has or is referenced in foreign key constraints which are not compatible with the new table definition.
|
MTR Testcase:
--source include/have_innodb.inc
|
CREATE TABLE t (c1 INT PRIMARY KEY,c2 INT,FOREIGN KEY(c2) REFERENCES t (c1)) ENGINE=InnoDB; |
ALTER TABLE t DROP PRIMARY KEY; |
SHOW WARNINGS;
|
Bug confirmed present in:
MariaDB: 10.5.26 (dbg), 10.5.26 (opt), 10.6.19 (dbg), 10.6.19 (opt), 10.11.9 (dbg), 10.11.9 (opt), 11.1.6 (dbg), 11.1.6 (opt), 11.2.5 (dbg), 11.2.5 (opt), 11.4.2 (dbg), 11.4.2 (opt), 11.5.0 (dbg), 11.5.0 (opt), 11.6.0 (dbg), 11.6.0 (opt)
Attachments
Issue Links
- relates to
-
MDEV-29092 FOREIGN_KEY_CHECKS does not prevent non-copy alter from creating invalid FK structure
-
- Closed
-