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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants