Bug #103906 mysql client returns NULL for empty string when --binary-as-hex=1
Submitted: 3 Jun 2021 16:21 Modified: 6 Aug 2021 14:06
Reporter: Herman Lee Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:8.0.24/8.0.25 OS:Any
Assigned to: CPU Architecture:Any

[3 Jun 2021 16:21] Herman Lee
Description:
There were some fixes for the mysql client printing "0x" for NULL fields, but it also looks to treat empty strings as NULL.

The behavior on 8.0.17 seems to be the correct one.

How to repeat:
On 8.0.24

mysql -P 13000 -u root -h 127.0.0.1 --binary-as-hex=1

mysql> select _binary"";
+----+
|    |
+----+
| NULL |
+----+
1 row in set (0.00 sec)

On 8.0.17

mysql -P 13000 -u root -h 127.0.0.1 --binary-as-hex=1

mysql> select _binary"";
+----+
|    |
+----+
| 0x |
+----+
[3 Jun 2021 17:13] MySQL Verification Team
Thank you for the bug report.
[6 Aug 2021 14:06] Margaret Fisher
Posted by developer:
 
Changelog entry added for MySQL 8.0.27:

 When the –binary-as-hex option is enabled for the mysql client, empty strings are now printed as 0x instead of NULL.