-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[WIP] executor: skip null rows when deleting multiple tables #31330
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: ekexium <[email protected]>
154ba90
to
d6d7b2b
Compare
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/d6d7b2b28afb5e72d52e95f3c62fb4a7e3d07371 |
Signed-off-by: ekexium <[email protected]>
Only using null datums as a condition is bad. An example: create table c(k1 int);
create table d(id int, k1 int);
insert into c(k1) values(null);
insert into d values(null, null);
delete c, d from c join d;
select * from d; Before: mysql> select * from d;
Empty set (0.00 sec) This PR: mysql> select * from d;
+------+------+
| id | k1 |
+------+------+
| NULL | NULL |
+------+------+ |
Seems this will affect the result of Sometimes the null row is fetched from storage and sometimes they are generated by the left join operator. We may need to refer the mysql code to investigate the expected behaviour for such cases. |
It seems to me that MySQL uses an explicit variable to indicate null rows generated by outer joins.
And there is a check to skip such rows when deleting. |
@ekexium: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: ekexium [email protected]
What problem does this PR solve?
Issue Number: close #31321
Problem Summary:
Skip null rows when deleting using outer joins.
I'm not sure whether it's an appropriate way to fix this. Please be careful when reviewing.
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note