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

TiDB 7.5 Cannot convert string with utf8mb4 #50295

Closed
shawn0915 opened this issue Jan 10, 2024 · 1 comment · Fixed by #51191
Closed

TiDB 7.5 Cannot convert string with utf8mb4 #50295

shawn0915 opened this issue Jan 10, 2024 · 1 comment · Fixed by #51191
Assignees
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@shawn0915
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set names utf8mb4;
select cast(compress('b') as char);

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

in mysql 8, we get this:

mysql> set names utf8mb4;
Query OK, 0 rows affected (0.00 sec)

mysql> select cast(compress('b') as char);
+-----------------------------+
| cast(compress('b') as char) |
+-----------------------------+
| NULL                        |
+-----------------------------+
1 row in set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+--------------------------------------------+
| Level   | Code | Message                                    |
+---------+------+--------------------------------------------+
| Warning | 1300 | Invalid utf8mb4 character string: '9C4B02' |
+---------+------+--------------------------------------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

but in tidb, we get error:

MySQL [test]> select version();
+--------------------+
| version()          |
+--------------------+
| 8.0.11-TiDB-v7.5.0 |
+--------------------+
1 row in set (0.001 sec)

MySQL [test]> set names utf8mb4;
Query OK, 0 rows affected (0.000 sec)

MySQL [test]> select cast(compress('b') as char);
ERROR 3854 (HY000): Cannot convert string '

4. What is your TiDB version? (Required)

TiDB-v7.5.0

reference:
https://asktug.com/t/topic/1018862

@kennedy8312
Copy link

Seeing the issue on v5.4.0 as well.

@ti-chi-bot ti-chi-bot added the affects-8.1 This bug affects the 8.1.x(LTS) versions. label Apr 9, 2024
@YangKeao YangKeao added affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. and removed 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 labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants