Commit 5c87b55f authored by unknown's avatar unknown
Browse files

Fix for bug #18643: crazy UNCOMPRESS().


mysql-test/r/func_compress.result:
  Fix for bug #18643: crazy UNCOMPRESS().
    - test-case
mysql-test/t/func_compress.test:
  Fix for bug #18643: crazy UNCOMPRESS().
    - test-case
sql/item_strfunc.cc:
  Fix for bug #18643: crazy UNCOMPRESS().
    - set null_value.
parent d7caa2a0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -72,3 +72,10 @@ set @@max_allowed_packet=1048576*100;
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null
0
create table t1(a blob);
insert into t1 values(NULL), (compress('a'));
select uncompress(a), uncompressed_length(a) from t1;
uncompress(a)	uncompressed_length(a)
NULL	NULL
a	1
drop table t1;
+9 −0
Original line number Diff line number Diff line
@@ -45,4 +45,13 @@ set @@max_allowed_packet=1048576*100;
--replace_result "''" XXX "'1'" XXX
eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null;

#
# Bug #18643: problem with null values
#

create table t1(a blob);
insert into t1 values(NULL), (compress('a'));
select uncompress(a), uncompressed_length(a) from t1;
drop table t1;

# End of 4.1 tests
+1 −0
Original line number Diff line number Diff line
@@ -2850,6 +2850,7 @@ String *Item_func_uncompress::val_str(String *str)

  if (!res)
    goto err;
  null_value= 0;
  if (res->is_empty())
    return res;