Commit e9d23b5a authored by Kristofer Pettersson's avatar Kristofer Pettersson

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.
parent 39175b92
......@@ -2789,7 +2789,7 @@ DROP TABLE t1;
#
SELECT CONV(1,-2147483648,-2147483648);
CONV(1,-2147483648,-2147483648)
NULL
#
# End of 5.5 tests
#
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment