-
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
Selecting INT column with COLLATE utf8mb4_general_ci throws an error #34349
Labels
affects-5.4
This bug affects 5.4.x versions.
affects-6.1
affects-6.5
affects-7.1
affects-7.5
report/customer
Customers have encountered this bug.
severity/moderate
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Comments
Both mysql and tidb, the collation of 1 is binary: MySQL root@127.0.0.1:test> select collation(1);
+--------------+
| collation(1) |
+--------------+
| binary |
+--------------+ |
mysql> show create table t;
+-------+--------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+--------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select a collate utf8mb4_general_ci from t;
+------------------------------+
| a collate utf8mb4_general_ci |
+------------------------------+
| 1 |
+------------------------------+
1 row in set (0.00 sec) seems number will convert to string if use collate clause |
ti-chi-bot
added
affects-5.4
This bug affects 5.4.x versions.
affects-6.1
affects-6.5
affects-7.1
affects-7.5
labels
Apr 12, 2024
/found customer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-5.4
This bug affects 5.4.x versions.
affects-6.1
affects-6.5
affects-7.1
affects-7.5
report/customer
Customers have encountered this bug.
severity/moderate
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
in MySQL, we can get this,
3. What did you see instead (Required)
but in TiDB, got this one,
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: