Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete ignore foreign key check failed #39712

Closed
Tracked by #55861
crazycs520 opened this issue Dec 7, 2022 · 0 comments · Fixed by #56682
Closed
Tracked by #55861

delete ignore foreign key check failed #39712

crazycs520 opened this issue Dec 7, 2022 · 0 comments · Fixed by #56682
Labels
type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@crazycs520
Copy link
Contributor

Reproduce

CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (b INT);
INSERT INTO t1 VALUES (1), (2), (5);
INSERT INTO t2 VALUES (1), (5);
ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY(b) REFERENCES t1(a);
DELETE IGNORE FROM t1;

The last DELETE statement should execute success, but failed in TiDB.

> DELETE IGNORE FROM t1;
(1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`a`))')

TiDB Version

master: 2ea253e

@crazycs520 crazycs520 added the type/feature-request Categorizes issue or PR as related to a new feature. label Dec 7, 2022
@YangKeao YangKeao mentioned this issue Sep 5, 2024
17 tasks
@ti-chi-bot ti-chi-bot bot closed this as completed in 2de388b Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant