Bug #102379 | UNHEX() function not giving the right output in latest MySQL versions | ||
---|---|---|---|
Submitted: | 26 Jan 2021 15:22 | Modified: | 26 Jan 2021 15:59 |
Reporter: | Sri Sakthivel Durai Pandian | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: User-defined functions ( UDF ) | Severity: | S3 (Non-critical) |
Version: | > MySQL 8.0.18 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | #mysql #functions |
[26 Jan 2021 15:22]
Sri Sakthivel Durai Pandian
[26 Jan 2021 15:42]
Frederic Descamps
Hello, This is not an issue of the UDF, you can check with MySQL Shell for example: SQL select hex('string') , unhex('string'), unhex(hex("string")) \G *************************** 1. row *************************** hex('string'): 737472696E67 unhex('string'): NULL unhex(hex("string")): string 1 row in set, 1 warning (0.0009 sec) Warning (code 1411): Incorrect string value: ''string'' for function unhex SQL select version(); +-----------+ | version() | +-----------+ | 8.0.23 | +-----------+ And of course with the classic old mysql client, you can also try with this time using --skip-binary-as-hex: $ mysql --skip-binary-as-hex Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 8.0.23 MySQL Community Server - GPL Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select hex('string') , unhex('string'), unhex(hex("string")) \G *************************** 1. row *************************** hex('string'): 737472696E67 unhex('string'): NULL unhex(hex("string")): string 1 row in set, 1 warning (0.00 sec) See https://bugs.mysql.com/bug.php?id=84391 This is part of the release note: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-19.html and the documentation about this parameter is here: https://dev.mysql.com/doc/refman/8.0/en/mysql-command-options.html#option_mysql_binary-as-... Regards,
[26 Jan 2021 15:59]
MySQL Verification Team
Thank you for the bug report. Not a bug as Frederic pointed.