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

Get wrong result with field func and utf8mb4_general_ci in real TiKV env #47688

Closed
Defined2014 opened this issue Oct 17, 2023 · 3 comments
Closed
Assignees
Labels
may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@Defined2014
Copy link
Contributor

Defined2014 commented Oct 17, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t;
create table t(a varchar(10) collate utf8mb4_bin, b varchar(10) collate utf8mb4_general_ci);
insert into t (a, b) values ('a', 'A');
select * from t where field('A', a collate utf8mb4_general_ci, b) > 1;

also has problem below

select * from t where field('A', a, b collate utf8mb4_general_ci) > 1;
select * from t where field('A' collate utf8mb4_general_ci, a, b) > 1;

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

mysql> select * from t where field('A', a collate utf8mb4_general_ci, b) > 1;
Empty set (0.01 sec)

3. What did you see instead (Required)

mysql> select * from t where field('A', a collate utf8mb4_general_ci, b) > 1;
+------+------+
| a    | b    |
+------+------+
| a    | A    |
+------+------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

mysql> SELECT tidb_version()
    -> ;
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                             |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.5.0-alpha
Edition: Community
Git Commit Hash: 4765838f4dc093bb2b2a16b0fd20a73e397532c6
Git Branch: heads/refs/tags/v7.5.0-alpha
UTC Build Time: 2023-10-16 14:25:07
GoVersion: go1.21.3
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
@Defined2014 Defined2014 added the type/bug The issue is confirmed as a bug. label Oct 17, 2023
@Defined2014
Copy link
Contributor Author

maybe #18662 only fixed TiDB part.

@Defined2014 Defined2014 added the sig/sql-infra SIG: SQL Infra label Oct 17, 2023
@Defined2014 Defined2014 changed the title Get wrong result with field func in real TiKV env Get wrong result with field func and utf8mb4_general_ci in real TiKV env Oct 17, 2023
@aytrack
Copy link
Contributor

aytrack commented Oct 17, 2023

/severity critical

@Defined2014
Copy link
Contributor Author

Close it by tikv/tikv#15878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

3 participants