List:Commits« Previous MessageNext Message »
From:kgeorge Date:March 2 2007 11:14am
Subject:bk commit into 5.0 tree (gkodinov:1.2425) BUG#26537
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-03-02 12:14:50+02:00, gkodinov@stripped +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.

  mysql-test/r/func_str.result@stripped, 2007-03-02 12:14:49+02:00, gkodinov@stripped +6 -0
    Bug #26537: test case

  mysql-test/t/func_str.test@stripped, 2007-03-02 12:14:49+02:00, gkodinov@stripped +6 -0
    Bug #26537: test case

  sql/item_strfunc.h@stripped, 2007-03-02 12:14:49+02:00, gkodinov@stripped +5 -1
    Bug #26537: item_unhex() can return NULLs
    even for guaranteed non-null arguments.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gkodinov
# Host:	magare.gmz
# Root:	/home/kgeorge/mysql/work/B26537-5.0-opt

--- 1.120/sql/item_strfunc.h	2007-01-12 15:40:31 +02:00
+++ 1.121/sql/item_strfunc.h	2007-03-02 12:14:49 +02:00
@@ -605,7 +605,11 @@
 {
   String tmp_value;
 public:
-  Item_func_unhex(Item *a) :Item_str_func(a) {}
+  Item_func_unhex(Item *a) :Item_str_func(a) 
+  { 
+    /* there can be bad hex strings */
+    maybe_null= 1; 
+  }
   const char *func_name() const { return "unhex"; }
   String *val_str(String *);
   void fix_length_and_dec()

--- 1.126/mysql-test/r/func_str.result	2007-01-12 16:34:59 +02:00
+++ 1.127/mysql-test/r/func_str.result	2007-03-02 12:14:49 +02:00
@@ -1940,4 +1940,10 @@
 select lpad('abc', cast(5 as unsigned integer), 'x');
 lpad('abc', cast(5 as unsigned integer), 'x')
 xxabc
+SELECT UNHEX('G');
+UNHEX('G')
+NULL
+SELECT UNHEX('G') IS NULL;
+UNHEX('G') IS NULL
+1
 End of 5.0 tests

--- 1.99/mysql-test/t/func_str.test	2007-01-12 15:40:31 +02:00
+++ 1.100/mysql-test/t/func_str.test	2007-03-02 12:14:49 +02:00
@@ -1008,4 +1008,10 @@
 select rpad('abc', cast(5 as unsigned integer), 'x');
 select lpad('abc', cast(5 as unsigned integer), 'x');
 
+#
+# Bug #26537: UNHEX() IS NULL comparison fails
+#
+SELECT UNHEX('G');
+SELECT UNHEX('G') IS NULL;
+
 --echo End of 5.0 tests
Thread
bk commit into 5.0 tree (gkodinov:1.2425) BUG#26537kgeorge2 Mar