Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.5, 10.6
Description
SET old_alter_table=1;
|
CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
CREATE TABLE t1_fk (a VARCHAR(40), KEY a (a), FULLTEXT KEY(a), CONSTRAINT fk FOREIGN KEY(a) REFERENCES t1 (a) ON UPDATE CASCADE) ENGINE=InnoDB;
|
ALTER TABLE t1 RENAME TO tm1;
|
CREATE TABLE t1 (c1 BIGINT NOT NULL, c2 BIGINT NOT NULL, PRIMARY KEY(c1), UNIQUE KEY(c2)) ENGINE=MEMORY;
|
ALTER TABLE t1 ENGINE=InnoDB;
|
This testcase would sporadically (4 out of 5 times) crash build 10.6 at 9db14e93acc4ec9023d50686c66dbef7d4d8c15c, and would also crash 10.5 at dd07cfcecd4aabb0aeae9c4f5087f82b4080c1bd. See MDEV-25509.
Now, it does not look healthy on a build from today:
10.6.1 f8665314d4ba190679001b81bb7d9fd7a38fc0f6 (Optimized) |
10.6.1-opt>SET old_alter_table=1;
|
Query OK, 0 rows affected, 1 warning (0.000 sec)
|
|
10.6.1-opt>CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
Query OK, 0 rows affected (0.015 sec)
|
|
10.6.1-opt>CREATE TABLE t1_fk (a VARCHAR(40), KEY a (a), FULLTEXT KEY(a), CONSTRAINT fk FOREIGN KEY(a) REFERENCES t1 (a) ON UPDATE CASCADE) ENGINE=InnoDB;
|
Query OK, 0 rows affected (0.091 sec)
|
|
10.6.1-opt>ALTER TABLE t1 RENAME TO tm1;
|
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails
|
10.6.1-opt>CREATE TABLE t1 (c1 BIGINT NOT NULL, c2 BIGINT NOT NULL, PRIMARY KEY(c1), UNIQUE KEY(c2)) ENGINE=MEMORY;
|
Query OK, 0 rows affected (0.008 sec)
|
|
10.6.1-opt>ALTER TABLE t1 ENGINE=InnoDB;
|
ERROR 1050 (42S01): Table './test/t1' already exists
|
10.6.1-opt>
|
Attachments
Issue Links
- relates to
-
MDEV-25885 Rename table operation using copy algorithm fails to rename the foreign key constraint
- Stalled
-
MDEV-26127 Assertion `err != DB_DUPLICATE_KEY' failed or InnoDB: Failing assertion: id != 0 on ALTER ... REBUILD PARTITION
- Closed
-
MDEV-25509 Atomic DDL: Assertion `err != DB_DUPLICATE_KEY' fails after previous error upon multi-RENAME
- Closed