summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorramil@production.mysql.com <>2006-04-21 13:56:40 +0200
committerramil@production.mysql.com <>2006-04-21 13:56:40 +0200
commitaed861fd86e8d0f46ddac2e43c421a1082ef815e (patch)
treec0fbe0a2e835d064b75931f4e86ae05b344a395c
parent5109b3ce026d8202fd6bc806150f2bf0b1d95531 (diff)
parent23988820977b82cbe94b78b415ffd028dc7681a0 (diff)
downloadmariadb-git-aed861fd86e8d0f46ddac2e43c421a1082ef815e.tar.gz
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into production.mysql.com:/usersnfs/rkalimullin/4.1.b18643
-rw-r--r--mysql-test/r/func_compress.result7
-rw-r--r--mysql-test/t/func_compress.test9
-rw-r--r--sql/item_strfunc.cc1
3 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result
index 9bc8e417e19..8d6fa9927ce 100644
--- a/mysql-test/r/func_compress.result
+++ b/mysql-test/r/func_compress.result
@@ -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;
diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test
index 6b85062b9fa..0f3c3cab307 100644
--- a/mysql-test/t/func_compress.test
+++ b/mysql-test/t/func_compress.test
@@ -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
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 04765e18191..f0127ed2a5d 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -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;