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

The result of query using the tabledual plan is not correct #27130

Closed
lilinghai opened this issue Aug 11, 2021 · 1 comment · Fixed by #27267
Closed

The result of query using the tabledual plan is not correct #27130

lilinghai opened this issue Aug 11, 2021 · 1 comment · Fixed by #27267
Assignees
Labels
severity/critical sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@lilinghai
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t( a enum('y','b','Abc','null'),b enum('y','b','Abc','null'),key(a));
insert into t values("Abc","Abc");
select * from t where a like "A%";  -- expect got Abc, Abc; but got Empty set
/*
+-------------+---------+------+---------------+---------------+
| id          | estRows | task | access object | operator info |
+-------------+---------+------+---------------+---------------+
| TableDual_5 | 0.00    | root |               | rows:0        |
+-------------+---------+------+---------------+---------------+
*/
select * from t where b like "A%"; -- correctly
/*
+-------------------------+---------+-----------+---------------+--------------------------------+
| id                      | estRows | task      | access object | operator info                  |
+-------------------------+---------+-----------+---------------+--------------------------------+
| TableReader_7           | 0.00    | root      |               | data:Selection_6               |
| └─Selection_6           | 0.00    | cop[tikv] |               | like(rs.t.b, "A%", 92)         |
|   └─TableFullScan_5     | 1.00    | cop[tikv] | table:t       | keep order:false, stats:pseudo |
+-------------------------+---------+-----------+---------------+--------------------------------+
*/

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

tabledual plan result is correct

3. What did you see instead (Required)

tabledual plan result is not correct

4. What is your TiDB version? (Required)

Release Version: v5.2.0-alpha-549-g6720fcd40
Edition: Community
Git Commit Hash: 6720fcd
Git Branch: master
UTC Build Time: 2021-08-09 03:22:37
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@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.

4 participants