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

Wrong results when accessing partition tables by IndexJoin #24631

Closed
qw4990 opened this issue May 13, 2021 · 2 comments · Fixed by #24659
Closed

Wrong results when accessing partition tables by IndexJoin #24631

qw4990 opened this issue May 13, 2021 · 2 comments · Fixed by #24659
Assignees
Labels
severity/critical sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@qw4990
Copy link
Contributor

qw4990 commented May 13, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set @@tidb_partition_prune_mode = 'dynamic'

create table thash (a int, b int, c int, primary key(a), index idx_b(b)) partition by hash(a) partitions 4;
create table tnormal (a int, b int, c int, primary key(a), index idx_b(b));
create table touter (a int, b int, c int);

insert into thash values (1, 2, 3);
insert into tnormal values (1, 2, 3);
insert into touter values (1, 2, 3);



mysql> select /*+ INL_JOIN(touter, thash) */ thash.b from touter join thash use index(idx_b) on touter.b = thash.b;
Empty set (0.01 sec)

mysql> select /*+ INL_JOIN(touter, tnormal) */ tnormal.b from touter join tnormal use index(idx_b) on touter.b = tnormal.b;
+------+
| b    |
+------+
|    2 |
+------+
1 row in set (0.00 sec)

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

They should return the same result.

3. What did you see instead (Required)

Their results are different.

4. What is your TiDB version? (Required)

Master Branch

@qw4990 qw4990 added the type/bug The issue is confirmed as a bug. label May 13, 2021
@qw4990 qw4990 self-assigned this May 13, 2021
@qw4990 qw4990 added the sig/planner SIG: Planner label May 13, 2021
@qw4990
Copy link
Contributor Author

qw4990 commented May 13, 2021

I'm working on this now.

@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/critical sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants