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

UPDATE IGNORE doesn't omit the foreign key error #56681

Closed
Tracked by #55861
YangKeao opened this issue Oct 16, 2024 · 0 comments · Fixed by #56682
Closed
Tracked by #55861

UPDATE IGNORE doesn't omit the foreign key error #56681

YangKeao opened this issue Oct 16, 2024 · 0 comments · Fixed by #56682
Assignees
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@YangKeao
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists parent, child;
create table parent (id int primary key, ref int, key(ref));
create table child (id int primary key, ref int, foreign key (ref) references parent(ref));
insert into parent values (1, 1), (2, 2);
insert into child values (1, 1);

update child set ref = 2 where id = 1;
-- error 1452
update child set ref = 3 where id = 1;
--enable_warnings
update ignore child set ref = 3 where id = 1;
--disable_warnings

-- error 1451
update parent set ref = 3 where id = 2;
--enable_warnings
update ignore parent set ref = 3 where id = 2;
--disable_warnings

2. What did you expect to see? (Required)

TiDB doesn't return error for UPDATE IGNORE statement.

3. What did you see instead (Required)

TiDB returns error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant