summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-03-02 16:18:00 +0200
committerunknown <gkodinov/kgeorge@magare.gmz>2007-03-02 16:18:00 +0200
commit2464f1082649fbca1e9e9f7fddfbf6a032eca2ca (patch)
tree883ceaf8c3a109f65ed4693574c2ee690e115e1b
parent19948e8a7fa9b63220345203a0db3c371514f83e (diff)
parent399bf23c1d9b5666c29bca6779e4459ed8fdbc4d (diff)
downloadmariadb-git-2464f1082649fbca1e9e9f7fddfbf6a032eca2ca.tar.gz
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B26537-5.0-opt
-rw-r--r--mysql-test/r/func_str.result6
-rw-r--r--mysql-test/t/func_str.test6
-rw-r--r--sql/item_strfunc.h6
3 files changed, 17 insertions, 1 deletions
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 052451f8c54..d09d3aeb529 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -1940,4 +1940,10 @@ abcxx
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
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 64b59025d44..2e76dc2ca31 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1008,4 +1008,10 @@ select repeat('a', cast(2 as unsigned int));
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
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 60547d00a5c..778ea6e9496 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -605,7 +605,11 @@ class Item_func_unhex :public Item_str_func
{
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()