summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorgkodinov/kgeorge@magare.gmz <>2007-03-02 12:14:50 +0200
committergkodinov/kgeorge@magare.gmz <>2007-03-02 12:14:50 +0200
commit4a6efcd664791457ee2793e1d6286705bebcee86 (patch)
tree5ad96de4d1308f8e66de478889fd2215aa0c3f8b /sql/item_strfunc.h
parentb3cb8466804f1ab6d888c027948bb6ad3c5d0cb8 (diff)
downloadmariadb-git-4a6efcd664791457ee2793e1d6286705bebcee86.tar.gz
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.
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h6
1 files changed, 5 insertions, 1 deletions
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()