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

Incorrect result of an anti-semi-join query #19423

Closed
zyguan opened this issue Aug 25, 2020 · 3 comments · Fixed by #19472 or #19576
Closed

Incorrect result of an anti-semi-join query #19423

zyguan opened this issue Aug 25, 2020 · 3 comments · Fixed by #19472 or #19576
Assignees
Labels
severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@zyguan
Copy link
Contributor

zyguan commented Aug 25, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t1, t2;
create table t1 (c_int int);
create table t2 (c_int int);
insert into t1 values (1), (2), (3);
insert into t2 values (1), (null);
select * from t1 where c_int not in (select c_int from t2 where t1.c_int = t2.c_int);

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

+-------+
| c_int |
+-------+
|     2 |
|     3 |
+-------+

3. What did you see instead (Required)

Empty set

4. What is your TiDB version? (Required)

master @ 6831e48
release-4.0 @ 61f1150

@zyguan zyguan added the type/bug The issue is confirmed as a bug. label Aug 25, 2020
@time-and-fate
Copy link
Member

/label sig/execution

@zyguan
Copy link
Contributor Author

zyguan commented Aug 28, 2020

drop table if exists t1, t2;
create table t1 (c_int int);
create table t2 (c_int int);
insert into t1 values (1), (2), (3);
insert into t2 values (1), (null);
select * from t1 where c_int <> all (select c_int from t2 where t1.c_int = t2.c_int);

Found similar problem when using <> all (an alias of not in). @eurekaka

@eurekaka
Copy link
Contributor

@zyguan hmmm, that is another code path of generating anti-semi-join. I will fix this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
5 participants