diff options
author | Kristofer Pettersson <kristofer.pettersson@oracle.com> | 2011-09-15 10:01:15 +0200 |
---|---|---|
committer | Kristofer Pettersson <kristofer.pettersson@oracle.com> | 2011-09-15 10:01:15 +0200 |
commit | e9d23b5a89241ccd290ad3da43e7947f7e161222 (patch) | |
tree | 153393cd9a51cf76d0421e789e1b21b3489f141c /sql | |
parent | 39175b922504c8e459040657e48c89ea14256683 (diff) | |
download | mariadb-git-e9d23b5a89241ccd290ad3da43e7947f7e161222.tar.gz |
Bug#11764310 - 57132: CONV FUNCTION CRASHES, NEGATIVE ARGUMENT TO MEMCPY
Amendment to previous patch:
Failure in CONV() should return NULL instead of
empty set.
When compiled on Windows or Solaris the function
Item_func_conv::val_str() doesn't fail on
longlong2str() but finds an earlier exit path
based on the attributes of the arguments.
This exit path returns NULL on failure and as a
consequence the original patch caused different
test results depending on the OS used.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_strfunc.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index c6e9384bc5e..a0fdb3cf811 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2954,7 +2954,10 @@ String *Item_func_conv::val_str(String *str) if (!(ptr= longlong2str(dec, ans, to_base)) || str->copy(ans, (uint32) (ptr - ans), default_charset())) - return make_empty_result(); + { + null_value= 1; + return NULL; + } return str; } |