summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraelkin@mysql.com <>2006-04-23 12:32:39 +0300
committeraelkin@mysql.com <>2006-04-23 12:32:39 +0300
commitc5219d0d670e6f8c28d447ac662e5c5cc9eba3e7 (patch)
treed9ace40adfab722a50d0f1aeaf05485ca3f80c0b
parent8301e6f62526b63a1153e8bb624f04da4c9d8927 (diff)
parent50e8e58c8ab527c1d07d38a3311bc741d452c94e (diff)
downloadmariadb-git-c5219d0d670e6f8c28d447ac662e5c5cc9eba3e7.tar.gz
Merge mysql.com:/usr_rh9/home/elkin.rh9/MySQL/BARE/4.1
into mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/5.0
-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 a78017ddb2f..4ae749f2343 100644
--- a/mysql-test/t/func_compress.test
+++ b/mysql-test/t/func_compress.test
@@ -47,4 +47,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 60183ac9b5a..a1743aa1181 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2941,6 +2941,7 @@ String *Item_func_uncompress::val_str(String *str)
if (!res)
goto err;
+ null_value= 0;
if (res->is_empty())
return res;