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

batch point get for enum type get wrong result #24562

Closed
aytrack opened this issue May 12, 2021 · 4 comments · Fixed by #24618
Closed

batch point get for enum type get wrong result #24562

aytrack opened this issue May 12, 2021 · 4 comments · Fixed by #24618
Assignees
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented May 12, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE PK_TCOLLATION3966STROBJSTROBJ (COL1 ENUM('^]IVWXEYONSORLSLQK3D_MZVT1?QT>HRUTLHLBTNPQPQUY@09<8N=YKIZ[RFA2K:V<S:RCVZGZG9_2K8H^O6ZSUU','DUQFI9QLXFF2CDUXN2KYH`D_FTOJA=M4SJLOEN0CG;F60RVSBZPBJM','UXHE3QX5WP`HM4LTWAALA[^MTHK:UP?]?Q7Q;ZEDOGXS^4[JSV6`4RO','MNRCTDNKGYFX=26\PZ[=OXG6KLKD5PRRNG`5CFTQRB\N<AIOB?WFEVX2ZAJXI;HI:DNIF[PJN^DU`1LWD9QNTUL^CH4;=86BKD?VCQGDOBRQ','H]HF6MPWZI0NPV@K^','U4G4QRNNFKE?P9Z[R^=BIM]C\RFNGDOBPMZMTMJHC3OEW;<WF@BW2GAOZVQJW__DB[6E[O\Q9TE\4M<','WLIQMCNAI^HSZUH8C2R^A^7OAPWG2VYACCCVH3[<XPXNAXM\PKDNVL_MCE4;2`C^AE0WFSLO_18@;O\3VHXRWCK`LP?PVZJQE4FKH8QA=U]I4XOBR5LWYEF=>XYVZ','MOKBNX71_@ADC4X9L@]CUVQNR]76WV1INCYVEKO9XMAIV^S=KNU_2L;_\3JB48_W^BP=GQ_H=W\C9T03>KPPOFYN[50GSLE\DP6XX=X','173IZBDJKTTR6LNCTOWWJDCG\K;PA]UVB4P[\>FHBN7AO7E?RXT<WXDRDB<29XH`GZVHJ97IG>ZYX4HA;BLHP6EB_?_3@ZFV<MZOKWOY>3^Q6]N5C=>CNF^W2L','9YGUQ:MLWDM<B'),COL2 VARCHAR(20),COL4 DATETIME,COL3 BIGINT,COL5 FLOAT,PRIMARY KEY(COL1)) CHARSET UTF8 COLLATE UTF8_GENERAL_CI;

insert into PK_TCOLLATION3966STROBJSTROBJ (COL1,COL2,COL4,COL3,COL5) values(6,"虡摿驟蚔冿峥仕牅癲ȱ矙榓咯腝縌窄軓旨鵁褪","5545\-08\-08\ 14:57:40",6286550474446791307,1.355671759964334e+38); 

select * from PK_TCOLLATION3966STROBJSTROBJ where col1 in ("3XTeGWJCJDEsg1WF6tZ1REChv1rH6SxGOATuBYaPKhgGPeIHVQwkjKf1PtGUVZTg3gHjE4V4QyCIsZzUytwcMufbBe", "6", "4l3lij9");
explain select * from PK_TCOLLATION3966STROBJSTROBJ where col1 in ("3XTeGWJCJDEsg1WF6tZ1REChv1rH6SxGOATuBYaPKhgGPeIHVQwkjKf1PtGUVZTg3gHjE4V4QyCIsZzUytwcMufbBe", "6", "4l3lij9");

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

MySQL > select * from PK_TCOLLATION3966STROBJSTROBJ where col1 in ("3XTeGWJCJDEsg1WF6tZ1REChv1rH6SxGOATuBYaPKhgGPeIHVQwkjKf1PtGUVZTg3gHjE4V4QyCIsZzUytwcMufbBe", "6", "4l3lij9");

+------+------+------+------+------+
| COL1 | COL2 | COL4 | COL3 | COL5 |
+------+------+------+------+------+

3. What did you see instead (Required)

MySQL > select * from PK_TCOLLATION3966STROBJSTROBJ where col1 in ("3XTeGWJCJDEsg1WF6tZ1REChv1rH6SxGOATuBYaPKhgGPeIHVQwkjKf1PtGUVZTg3gHjE4V4QyCIsZzUytwcMufbBe", "6", "4l3lij9");
+------------------------------------------------------------------------------+-----------------------------------------+---------------------+---------------------+-------------+
| COL1                                                                         | COL2                                    | COL4                | COL3                | COL5        |
+------------------------------------------------------------------------------+-----------------------------------------+---------------------+---------------------+-------------+
| U4G4QRNNFKE?P9Z[R^=BIM]CRFNGDOBPMZMTMJHC3OEW;<WF@BW2GAOZVQJW__DB[6E[OQ9TE4M< | 虡摿驟蚔冿峥仕牅癲ȱ矙榓咯腝縌窄軓旨鵁褪 | 5545-08-08 14:57:40 | 6286550474446791307 | 1.35567e+38 |
+------------------------------------------------------------------------------+-----------------------------------------+---------------------+---------------------+-------------+

1 row in set
Time: 0.053s
MySQL > explain select * from PK_TCOLLATION3966STROBJSTROBJ where col1 in ("3XTeGWJCJDEsg1WF6tZ1REChv1rH6SxGOATuBYaPKhgGPeIHVQwkjKf1PtGUVZTg3gHjE4V4QyCIsZzUytwcMufbBe", "6", "4l3lij9");
+-------------------+---------+------+--------------------------------------------------------------------+------------------------------+
| id                | estRows | task | access object                                                      | operator info                |
+-------------------+---------+------+--------------------------------------------------------------------+------------------------------+
| Batch_Point_Get_1 | 3.00    | root | table:PK_TCOLLATION3966STROBJSTROBJ, clustered index:PRIMARY(COL1) | keep order:false, desc:false |
+-------------------+---------+------+--------------------------------------------------------------------+------------------------------+

4. What is your TiDB version? (Required)

MySQL root@172.16.4.131:hchwang> select tidb_version()\G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v4.0.0-beta.2-2832-gc6c8265e0-dirty
Edition: Community
Git Commit Hash: c6c8265e098b65339a85be2e35678b1c13f0f53a
Git Branch: master
UTC Build Time: 2021-05-10 14:58:41
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/execution SIG execution severity/critical labels May 12, 2021
@aytrack
Copy link
Contributor Author

aytrack commented May 12, 2021

MySQL > select * from `PK_TCOLLATION3966STROBJSTROBJ` where col1 = "6";
+------+------+------+------+------+
| COL1 | COL2 | COL4 | COL3 | COL5 |
+------+------+------+------+------+

0 rows in set
Time: 0.050s
MySQL > select * from `PK_TCOLLATION3966STROBJSTROBJ` where col1 in ("6");
+------------------------------------------------------------------------------+-----------------------------------------+---------------------+---------------------+-------------+
| COL1                                                                         | COL2                                    | COL4                | COL3                | COL5        |
+------------------------------------------------------------------------------+-----------------------------------------+---------------------+---------------------+-------------+
| U4G4QRNNFKE?P9Z[R^=BIM]CRFNGDOBPMZMTMJHC3OEW;<WF@BW2GAOZVQJW__DB[6E[OQ9TE4M< | 虡摿驟蚔冿峥仕牅癲ȱ矙榓咯腝縌窄軓旨鵁褪 | 5545-08-08 14:57:40 | 6286550474446791307 | 1.35567e+38 |
+------------------------------------------------------------------------------+-----------------------------------------+---------------------+---------------------+-------------+

1 row in set
Time: 0.061s

@aytrack aytrack changed the title point get for enum type get wrong result batch point get for enum type get wrong result May 12, 2021
@wshwsh12
Copy link
Contributor

/assign @lzmhhh123

@lzmhhh123
Copy link
Contributor

A more simple case:

create table t(a enum("a","b","c","d"), primary key(a));
insert into t values(1);
select * from t where t.a in ("1","b");

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

Successfully merging a pull request may close this issue.

4 participants