Details
-
Bug
-
Status: Stalled (View Workflow)
-
Critical
-
Resolution: Unresolved
-
10.10(EOL)
-
None
Description
CREATE OR REPLACE failed with "Duplicate key on write or update" when it replace an empty table with the non-anonymous constraint name
From comment
Test fails due to a duplicate key on SYS_FOREIGN.NAME on the non-anonymous constraint name:
Test:
--source include/have_innodb.inc
|
 |
CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB; |
CREATE OR REPLACE TABLE u(a INT PRIMARY KEY, CONSTRAINT c FOREIGN KEY d (a) REFERENCES t (a)) ENGINE=InnoDB; |
CREATE OR REPLACE TABLE u(a INT PRIMARY KEY, CONSTRAINT c FOREIGN KEY d (a) REFERENCES t (a)) ENGINE=InnoDB; |
DROP TABLE u, t; |
Actual result:
At line 5: query 'CREATE OR REPLACE TABLE u(a INT PRIMARY KEY, CONSTRAINT c FOREIGN KEY d (a) REFERENCES t (a)) ENGINE=InnoDB' failed: ER_CANT_CREATE_TABLE (1005): Can't create table `test`.`u` (errno: 121 "Duplicate key on write or update") |
Expected result:
No errors
Attachments
Issue Links
- blocks
-
MDEV-25292 Atomic CREATE OR REPLACE TABLE
- Stalled
- is blocked by
-
MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN
- Closed
- is caused by
-
MDEV-25292 Atomic CREATE OR REPLACE TABLE
- Stalled
- relates to
-
MDEV-29409 ASAN failure on long fk_id when renaming a table
- Closed
-
MDEV-19191 Partial support of foreign keys in partitioned tables
- In Review
-
MDEV-29258 Failing assertion for name length on RENAME TABLE
- Closed
-
MDEV-30416 Can't redefine constraint in a single ALTER TABLE
- Confirmed