From: Alexander Barkov Date: March 20 2012 5:18am Subject: bzr push into mysql-5.5 branch (alexander.barkov:3760 to 3761) Bug#13832953 List-Archive: http://lists.mysql.com/commits/143244 X-Bug: 13832953 Message-Id: <201203200522.q2K5MpNs014941@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3761 Alexander Barkov 2012-03-20 Bug#13832953 MY_STRNXFRM_UNICODE: ASSERTION `SRC' FAILED. | MY_STRNXFRM_UNICODE/MAKE_SORTKEY Problem: Field_set::val_str in case of an empty SET value returned a String with str_length==0 and Ptr==0, which is not expected by some pieces of the code. Fix: Returning an empty string with str_length==0 and Ptr=="", like Field_enum does. modified: mysql-test/r/ctype_ucs.result mysql-test/t/ctype_ucs.test sql/field.cc 3760 Bjorn Munch 2012-03-16 BUG #13619394: fixing incorrect revert Doing this for Sayantan whose VPN is not working ATM modified: unittest/mysys/my_vsnprintf-t.c === modified file 'mysql-test/r/ctype_ucs.result' --- a/mysql-test/r/ctype_ucs.result 2011-05-11 11:11:57 +0000 +++ b/mysql-test/r/ctype_ucs.result 2012-03-20 05:16:51 +0000 @@ -4107,5 +4107,16 @@ DROP TABLE t1; SET sql_mode=default; SET NAMES latin1; # +# Bug #13832953 MY_STRNXFRM_UNICODE: ASSERTION `SRC' FAILED +# +CREATE TABLE t1 (c1 SET('','') CHARACTER SET ucs2); +Warnings: +Note 1291 Column 'c1' has duplicated value '' in SET +INSERT INTO t1 VALUES (''); +SELECT COALESCE(c1) FROM t1 ORDER BY 1; +COALESCE(c1) + +DROP TABLE t1; +# # End of 5.5 tests # === modified file 'mysql-test/t/ctype_ucs.test' --- a/mysql-test/t/ctype_ucs.test 2011-03-03 15:46:30 +0000 +++ b/mysql-test/t/ctype_ucs.test 2012-03-20 05:16:51 +0000 @@ -760,5 +760,14 @@ SET collation_connection=ucs2_general_ci SET NAMES latin1; --echo # +--echo # Bug #13832953 MY_STRNXFRM_UNICODE: ASSERTION `SRC' FAILED +--echo # +CREATE TABLE t1 (c1 SET('','') CHARACTER SET ucs2); +INSERT INTO t1 VALUES (''); +SELECT COALESCE(c1) FROM t1 ORDER BY 1; +DROP TABLE t1; + + +--echo # --echo # End of 5.5 tests --echo # === modified file 'sql/field.cc' --- a/sql/field.cc 2011-08-19 07:06:50 +0000 +++ b/sql/field.cc 2012-03-20 05:16:51 +0000 @@ -8257,8 +8257,7 @@ String *Field_set::val_str(String *val_b ulonglong tmp=(ulonglong) Field_enum::val_int(); uint bitnr=0; - val_buffer->length(0); - val_buffer->set_charset(field_charset); + val_buffer->set("", 0, field_charset); while (tmp && bitnr < (uint) typelib->count) { if (tmp & 1) No bundle (reason: useless for push emails).