| Bug #106225 | select bin("") should return 0 instead of null | ||
|---|---|---|---|
| Submitted: | 20 Jan 2022 9:54 | Modified: | 20 Jan 2022 10:14 |
| Reporter: | Huaiyu Xu | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
| Version: | 5.7, 8.0, 8.0.32 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[20 Jan 2022 10:14]
MySQL Verification Team
Hello Huaiyu Xu, Thank you for the report and test case. regards, Umesh

Description: mysql> select bin(cast("" as unsigned)); +---------------------------+ | bin(cast("" as unsigned)) | +---------------------------+ | 0 | +---------------------------+ 1 row in set, 1 warning (0.00 sec) mysql> select bin(""); +---------+ | bin("") | +---------+ | NULL | +---------+ 1 row in set (0.00 sec) How to repeat: mysql> select bin(cast("" as unsigned)); +---------------------------+ | bin(cast("" as unsigned)) | +---------------------------+ | 0 | +---------------------------+ 1 row in set, 1 warning (0.00 sec) mysql> select bin(""); +---------+ | bin("") | +---------+ | NULL | +---------+ 1 row in set (0.00 sec) Suggested fix: `select bin("")` should also return 0