mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Fix for the bug #1333: COMPRESS(NULL) segfaults.
mysql-test/r/func_compress.result: Test for the bug #1333: COMPRESS(NULL) segfaults. mysql-test/t/func_compress.test: Test for the bug #1333: COMPRESS(NULL) segfaults. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
This commit is contained in:
parent
65aec56c57
commit
334b634c9f
4 changed files with 23 additions and 0 deletions
|
@ -97,6 +97,7 @@ peter@linux.local
|
||||||
peter@mysql.com
|
peter@mysql.com
|
||||||
peterg@mysql.com
|
peterg@mysql.com
|
||||||
pgulutzan@linux.local
|
pgulutzan@linux.local
|
||||||
|
ram@gw.mysql.r18.ru
|
||||||
ram@gw.udmsearch.izhnet.ru
|
ram@gw.udmsearch.izhnet.ru
|
||||||
ram@mysql.r18.ru
|
ram@mysql.r18.ru
|
||||||
ram@ram.(none)
|
ram@ram.(none)
|
||||||
|
|
|
@ -40,3 +40,9 @@ uncompress(compress(""))
|
||||||
select uncompressed_length("");
|
select uncompressed_length("");
|
||||||
uncompressed_length("")
|
uncompressed_length("")
|
||||||
0
|
0
|
||||||
|
select compress(NULL);
|
||||||
|
compress(NULL)
|
||||||
|
NULL
|
||||||
|
select uncompress(NULL);
|
||||||
|
uncompress(NULL)
|
||||||
|
NULL
|
||||||
|
|
|
@ -23,3 +23,9 @@ select uncompress("");
|
||||||
select uncompress(compress(""));
|
select uncompress(compress(""));
|
||||||
select uncompressed_length("");
|
select uncompressed_length("");
|
||||||
|
|
||||||
|
#
|
||||||
|
# NULL (Bug #1333)
|
||||||
|
#
|
||||||
|
|
||||||
|
select compress(NULL);
|
||||||
|
select uncompress(NULL);
|
||||||
|
|
|
@ -2539,6 +2539,11 @@ longlong Item_func_crc32::val_int()
|
||||||
String *Item_func_compress::val_str(String *str)
|
String *Item_func_compress::val_str(String *str)
|
||||||
{
|
{
|
||||||
String *res= args[0]->val_str(str);
|
String *res= args[0]->val_str(str);
|
||||||
|
if (!res)
|
||||||
|
{
|
||||||
|
null_value= 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (res->is_empty()) return res;
|
if (res->is_empty()) return res;
|
||||||
|
|
||||||
int err= Z_OK;
|
int err= Z_OK;
|
||||||
|
@ -2589,6 +2594,11 @@ String *Item_func_compress::val_str(String *str)
|
||||||
String *Item_func_uncompress::val_str(String *str)
|
String *Item_func_uncompress::val_str(String *str)
|
||||||
{
|
{
|
||||||
String *res= args[0]->val_str(str);
|
String *res= args[0]->val_str(str);
|
||||||
|
if (!res)
|
||||||
|
{
|
||||||
|
null_value= 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (res->is_empty()) return res;
|
if (res->is_empty()) return res;
|
||||||
|
|
||||||
ulong new_size= uint4korr(res->c_ptr()) & 0x3FFFFFFF;
|
ulong new_size= uint4korr(res->c_ptr()) & 0x3FFFFFFF;
|
||||||
|
|
Loading…
Add table
Reference in a new issue