Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.3.2, 10.6, 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL)
-
None
Description
Run the following statements, in which the last INSERT statement should succeed, since there is no FOREIGN KEY violation. But an error is retuned.
CREATE TABLE t0 (c2 FLOAT8, PRIMARY KEY (c2)); |
CREATE TABLE t1 (c1 FLOAT8 UNIQUE, FOREIGN KEY (c1) REFERENCES t0(c2) ON UPDATE CASCADE); |
ALTER TABLE t0 RENAME AS t2, ALGORITHM COPY; |
INSERT INTO t2 (c2) VALUES (1); |
INSERT INTO t1 (c1) VALUES (1); -- actual: failed, expected: succeed |
I got the following error message, which seems incorrect, since there is no table with name t0.
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`c1`) REFERENCES `t0` (`c2`) ON UPDATE CASCADE)
|
Attachments
Issue Links
- relates to
-
MDEV-25885 Rename table operation using copy algorithm fails to rename the foreign key constraint
- Stalled