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 result when using index in enum column #27610

Closed
ChenPeng2013 opened this issue Aug 26, 2021 · 1 comment · Fixed by #27629
Closed

wrong result when using index in enum column #27610

ChenPeng2013 opened this issue Aug 26, 2021 · 1 comment · Fixed by #27629
Assignees
Labels
severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@ChenPeng2013
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
drop table if exists PK_TCOLLATION3966STROBJSTROBJ;
CREATE TABLE `PK_TCOLLATION3966STROBJSTROBJ` (
  `COL1` enum('ll','aa','bb','cc','dd','ee') COLLATE utf8_general_ci NOT NULL,
  `COL2` varchar(20) COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (`COL1`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
insert into PK_TCOLLATION3966STROBJSTROBJ values("ee", "tttt");
SELECT col1, COL2 FROM PK_TCOLLATION3966STROBJSTROBJ WHERE COL1 IN ('notexist','6') and col2 not in ("abcd");

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

release-5.0

mysql> SELECT col1, COL2 FROM PK_TCOLLATION3966STROBJSTROBJ WHERE COL1 IN ('notexist','6') and col2 not in ("abcd");
Empty set (0.00 sec)

3. What did you see instead (Required)

release-5.1 & release-5.2 & master

mysql> SELECT col1, COL2 FROM PK_TCOLLATION3966STROBJSTROBJ WHERE COL1 IN ('notexist','6') and col2 not in ("abcd");
+------+------+
| col1 | COL2 |
+------+------+
| ee   | tttt |
+------+------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

Release Version: v5.2.0-alpha-747-g449e83236
Edition: Community
Git Commit Hash: 449e83236d097ec0100700e10bbb07ff84756dd9
Git Branch: master
UTC Build Time: 2021-08-26 10:02:01
GoVersion: go1.16.5
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@ChenPeng2013 ChenPeng2013 added type/bug The issue is confirmed as a bug. severity/critical sig/execution SIG execution labels Aug 26, 2021
@wshwsh12 wshwsh12 self-assigned this Aug 27, 2021
@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/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants