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

error optimization of anti smei join on daul table #12074

Closed
jingyugao opened this issue Sep 8, 2019 · 3 comments · Fixed by #19620
Closed

error optimization of anti smei join on daul table #12074

jingyugao opened this issue Sep 8, 2019 · 3 comments · Fixed by #19620
Assignees
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@jingyugao
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
drop table if exists t1,t2;
create table t1( a int);
create table t2(b int);
insert into t1 value(1);
insert into t2 value(null);
select * from t1 where 1 not in (select b from t2);
select * from t1 where t1.a not in (select b from t2);
  1. What did you expect to see?

both select should return empty record.

  1. What did you see instead?
select * from t1 where 1 not in (select b from t2);
+------+
| a    |
+------+
|    1 |
+------+
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    702854f
@jingyugao jingyugao added the type/bug The issue is confirmed as a bug. label Sep 8, 2019
@jingyugao
Copy link
Contributor Author

This might be same with #12065.

@jingyugao
Copy link
Contributor Author

This is because tidb push eq(1,t2.b) down to the tableReader(t2), so the inner table return emtpy records and tryToMatch return false,false,nil
see code https://github.com/pingcap/tidb/blob/master/executor/joiner.go#L227

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

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