From: Date: October 13 2006 3:40pm Subject: bk commit into 4.1 tree (ramil:1.2587) BUG#23254 List-Archive: http://lists.mysql.com/commits/13656 X-Bug: 23254 Message-Id: <200610131340.k9DDelAN001906@myoffice.izhnet.ru> Below is the list of changes that have just been committed into a local 4.1 repository of ram. When ram does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2006-10-13 18:40:43+05:00, ramil@stripped +3 -0 Fix for bug #23254: COMPRESS(NULL) makes all futher COMPRESS() calls on same Item return NULL We don't set null_value to 0 in the Item_func_compress::val_str() for not-NULL results. mysql-test/r/func_compress.result@stripped, 2006-10-13 18:40:39+05:00, ramil@stripped +5 -0 Fix for bug #23254: COMPRESS(NULL) makes all futher COMPRESS() calls on same Item return NULL - test result. mysql-test/t/func_compress.test@stripped, 2006-10-13 18:40:40+05:00, ramil@stripped +12 -1 Fix for bug #23254: COMPRESS(NULL) makes all futher COMPRESS() calls on same Item return NULL - test case. sql/item_strfunc.cc@stripped, 2006-10-13 18:40:40+05:00, ramil@stripped +1 -0 Fix for bug #23254: COMPRESS(NULL) makes all futher COMPRESS() calls on same Item return NULL - set null_value. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: ramil # Host: myoffice.izhnet.ru # Root: /usr/home/ram/work/bug23254/my41-bug23254 --- 1.251/sql/item_strfunc.cc 2006-10-13 18:40:48 +05:00 +++ 1.252/sql/item_strfunc.cc 2006-10-13 18:40:48 +05:00 @@ -2838,6 +2838,7 @@ String *Item_func_compress::val_str(Stri null_value= 1; return 0; } + null_value= 0; if (res->is_empty()) return res; /* --- 1.16/mysql-test/r/func_compress.result 2006-10-13 18:40:48 +05:00 +++ 1.17/mysql-test/r/func_compress.result 2006-10-13 18:40:48 +05:00 @@ -79,3 +79,8 @@ uncompress(a) uncompressed_length(a) NULL NULL a 1 drop table t1; +create table t1(a blob); +insert into t1 values (NULL), ('0'); +select compress(a), compress(a) from t1; +drop table t1; +End of 4.1 tests --- 1.12/mysql-test/t/func_compress.test 2006-10-13 18:40:48 +05:00 +++ 1.13/mysql-test/t/func_compress.test 2006-10-13 18:40:48 +05:00 @@ -54,4 +54,15 @@ insert into t1 values(NULL), (compress(' select uncompress(a), uncompressed_length(a) from t1; drop table t1; -# End of 4.1 tests +# +# Bug #23254: problem with compress(NULL) +# + +create table t1(a blob); +insert into t1 values (NULL), ('0'); +--disable_result_log +select compress(a), compress(a) from t1; +--enable_result_log +drop table t1; + +--echo End of 4.1 tests