Bug #26537 UNHEX() IS NULL comparison fails
Submitted: 21 Feb 2007 18:24 Modified: 14 Mar 2007 15:56
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1, 5.0, 51 OS:Any
Assigned to: Georgi Kodinov CPU Architecture:Any

[21 Feb 2007 18:24] Paul DuBois
Description:
A simple comparison of a null result from the
UNHEX() function using IS NULL returns 0 rather
than 1.

How to repeat:
mysql> SELECT UNHEX('G');
+------------+
| UNHEX('G') |
+------------+
| NULL       |
+------------+
1 row in set (0.21 sec)

mysql> SELECT UNHEX('G') IS NULL;
+--------------------+
| UNHEX('G') IS NULL |
+--------------------+
|                  0 |
+--------------------+
1 row in set (0.04 sec)
[21 Feb 2007 19:05] MySQL Verification Team
Thank you for the bug report
[1 Mar 2007 15:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/20916

ChangeSet@1.2425, 2007-03-01 17:56:17+02:00, gkodinov@magare.gmz +3 -0
  Bug #26537: item_unhex() was not expected 
  to return NULL for non-NULL arguments.
  This is not the case as it can return NULL
  for invalid hexidecimal strings.
  Fixed by setting the maybe_null flag.
[2 Mar 2007 10:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/20990

ChangeSet@1.2425, 2007-03-02 12:14:50+02:00, gkodinov@magare.gmz +3 -0
  Bug #26537: item_unhex() was not expected 
  to return NULL for non-NULL arguments.
  This is not the case as it can return NULL
  for invalid hexidecimal strings.
  Fixed by setting the maybe_null flag.
[14 Mar 2007 9:01] Alexey Botchkov
Pushed in 5.0.38 5.1.17
[14 Mar 2007 15:56] Paul DuBois
Noted in 5.0.38, 5.1.17 changelogs.
[7 Jun 2007 11:24] Georgi Kodinov
Pushed only to 5.0 and 5.1 only : 4.1 is out of active support.
[7 Jun 2007 12:40] Paul DuBois
Removed 4.1.23 changelog entry.