Skip to content

enum type query result is incorrect while using xxx_ci collation  #24530

Closed
@aytrack

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `PK_MULTI_COL2001STROBJSTROBJ` (  `COL2` enum('A','B','C','D') COLLATE utf8_general_ci NOT NULL,  `COL3` decimal(37,6) NOT NULL,  PRIMARY KEY (`COL2`,`COL3`) /*T![clustered_index] CLUSTERED */) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

insert into `PK_MULTI_COL2001STROBJSTROBJ` values ('A', 10), ('A', 11), ('B', 20);
select * from `PK_MULTI_COL2001STROBJSTROBJ` where col2 = 'a';
select * from `PK_MULTI_COL2001STROBJSTROBJ` where col2 = 'B';

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

MySQL > select * from `PK_MULTI_COL2001STROBJSTROBJ` where col2 = 'a';
+------+-----------+
| COL2 | COL3      |
+------+-----------+
| A    | 10.000000 |
| A    | 11.000000 |
+------+-----------+

3. What did you see instead (Required)

MySQL r> select * from `PK_MULTI_COL2001STROBJSTROBJ` where col2 = 'a';
+------+------+
| COL2 | COL3 |
+------+------+

4. What is your TiDB version? (Required)

tidb_version() | Release Version: v4.0.0-beta.2-2791-g207ce344c-dirty
Edition: Community
Git Commit Hash: 207ce344cbb044ffb1b2681f1ba320a154979f6d
Git Branch: master
UTC Build Time: 2021-05-02 15:24:42
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions