-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
LOCATE is ignoring the _latin1 literal and treating this as a utf8 string. #29741
Comments
https://docs.pingcap.com/tidb/stable/character-set-and-collation
|
/remove-type bug |
/type enhancement |
According to the doc, it's more like enhancement better than bug. |
/type compatibility |
--It works
select POSITION(_utf8mb4'B' IN _utf8mb4'abcd' COLLATE utf8mb4_general_ci);
--Not works
select POSITION(_utf8mb4'B' IN _utf8mb4'abcd');
select POSITION(_latin1'B' IN _latin1'aBcd');
--In Mysql
mysql> select POSITION(_utf8mb4'B' IN _utf8mb4'abcd');
+-----------------------------------------+
| POSITION(_utf8mb4'B' IN _utf8mb4'abcd') |
+-----------------------------------------+
| 2 |
+-----------------------------------------+
1 row in set (0.00 sec)
mysql> select POSITION(_latin1'b' IN _latin1'aBcd');
+---------------------------------------+
| POSITION(_latin1'b' IN _latin1'aBcd') |
+---------------------------------------+
| 2 |
+---------------------------------------+
1 row in set (0.00 sec)
--IN TIDB
mysql> select POSITION(_utf8mb4'B' IN _utf8mb4'abcd');
+-----------------------------------------+
| POSITION(_utf8mb4'B' IN _utf8mb4'abcd') |
+-----------------------------------------+
| 0 |
+-----------------------------------------+
1 row in set (0.00 sec)
mysql> select POSITION(_latin1'b' IN _latin1'aBcd');
+---------------------------------------+
| POSITION(_latin1'b' IN _latin1'aBcd') |
+---------------------------------------+
| 0 |
+---------------------------------------+
1 row in set (0.00 sec)
|
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
select locate(_latin1 0xD0B1, _latin1 0xD0B0D0B1D0B2) ;
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: