From: Date: December 25 2008 12:09pm Subject: bzr commit into mysql-5.1-bugteam branch (bar:2750) Bug#41084 List-Archive: http://lists.mysql.com/commits/62323 X-Bug: 41084 Message-Id: <200812251109.mBPB9sVS032227@bar.myoffice.izhnet.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///home/bar/mysql-bzr/mysql-5.1-b41084/ 2750 Alexander Barkov 2008-12-25 Bug#41084 full-text index added to custom UCA collation not working Problem: Custom UCA collations didn't set MY_CS_STRNXFRM flag, which resulted in "prefix_search" method instead of the required "seq_search". Fix: the missing flag was added. Upgrade: - All fulltext indexes with custom UCA collations should be rebuilt. - Non-fulltext custom UCA indexes should likely be rebuild as well. modified: mysql-test/r/ctype_ldml.result mysql-test/t/ctype_ldml.test mysys/charset.c === modified file 'mysql-test/r/ctype_ldml.result' --- a/mysql-test/r/ctype_ldml.result 2007-06-07 12:55:55 +0000 +++ b/mysql-test/r/ctype_ldml.result 2008-12-25 11:03:52 +0000 @@ -21,6 +21,18 @@ select * from t1 where c1='b'; c1 a drop table t1; +CREATE TABLE t1 ( +col1 varchar(100) character set utf8 collate utf8_test_ci +); +INSERT INTO t1 (col1) VALUES ('abcd'),('efgh'),('ijkl'); +ALTER TABLE t1 ADD FULLTEXT INDEX (col1); +SELECT * FROM t1 where match (col1) against ('abcd'); +col1 +abcd +SELECT * FROM t1 where match (col1) against ('abcd' IN BOOLEAN MODE); +col1 +abcd +DROP TABLE t1; show collation like 'ucs2_vn_ci'; Collation Charset Id Default Compiled Sortlen ucs2_vn_ci ucs2 242 8 === modified file 'mysql-test/t/ctype_ldml.test' --- a/mysql-test/t/ctype_ldml.test 2007-06-07 12:55:55 +0000 +++ b/mysql-test/t/ctype_ldml.test 2008-12-25 11:03:52 +0000 @@ -21,6 +21,19 @@ insert into t1 values ('a'); select * from t1 where c1='b'; drop table t1; + +# +# Bug#41084 full-text index added to custom UCA collation not working +# +CREATE TABLE t1 ( + col1 varchar(100) character set utf8 collate utf8_test_ci +); +INSERT INTO t1 (col1) VALUES ('abcd'),('efgh'),('ijkl'); +ALTER TABLE t1 ADD FULLTEXT INDEX (col1); +SELECT * FROM t1 where match (col1) against ('abcd'); +SELECT * FROM t1 where match (col1) against ('abcd' IN BOOLEAN MODE); +DROP TABLE t1; + # # Vietnamese experimental collation # === modified file 'mysys/charset.c' --- a/mysys/charset.c 2008-02-18 22:29:39 +0000 +++ b/mysys/charset.c 2008-12-25 11:03:52 +0000 @@ -212,6 +212,7 @@ copy_uca_collation(CHARSET_INFO *to, CHA to->max_sort_char= from->max_sort_char; to->mbminlen= from->mbminlen; to->mbmaxlen= from->mbmaxlen; + to->state|= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_STRNXFRM; } @@ -246,14 +247,12 @@ static int add_collation(CHARSET_INFO *c { #if defined(HAVE_CHARSET_ucs2) && defined(HAVE_UCA_COLLATIONS) copy_uca_collation(newcs, &my_charset_ucs2_unicode_ci); - newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED; #endif } else if (!strcmp(cs->csname, "utf8")) { #if defined (HAVE_CHARSET_utf8) && defined(HAVE_UCA_COLLATIONS) copy_uca_collation(newcs, &my_charset_utf8_unicode_ci); - newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED; #endif } else