diff options
author | Alexander Barkov <bar@mysql.com> | 2009-02-02 17:25:42 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mysql.com> | 2009-02-02 17:25:42 +0400 |
commit | a491bcc4e5fd4af459708c90a80b1e39a2bac432 (patch) | |
tree | 5a9fc6fc251aa5ee96fa3dfe3fc1fb28504b17ee /mysql-test | |
parent | b6542a374b309a61abc6e72c9a4760272194b14a (diff) | |
download | mariadb-git-a491bcc4e5fd4af459708c90a80b1e39a2bac432.tar.gz |
Bug#41084 full-text index added to custom UCA collation not working
Problem:
Custom UCA collations didn't set the MY_CS_STRNXFRM flag,
which resulted in "prefix_search" method instead of
the required "seq_search".
Problem2: (not metioned in the bug report)
Custom UCA collations didn't also set the MY_CS_UNICODE flag,
so an attempt to compare a column with a custom UCA collation
to another column with a non-Unicode character set led to
the "illegal mix of collation" error.
Fix:
the two missing flags was added into collation initialization.
Upgrade:
- All fulltext indexes with custom UCA collations should be rebuilt.
- Non-fulltext custom UCA indexes should likely be rebuild as well.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/ctype_ldml.result | 19 | ||||
-rw-r--r-- | mysql-test/t/ctype_ldml.test | 16 |
2 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result index f3d3ff700f0..5dc9ea35cc3 100644 --- a/mysql-test/r/ctype_ldml.result +++ b/mysql-test/r/ctype_ldml.result @@ -21,6 +21,25 @@ 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 +ALTER TABLE t1 ADD (col2 varchar(100) character set latin1); +UPDATE t1 SET col2=col1; +SELECT * FROM t1 WHERE col1=col2 ORDER BY col1; +col1 col2 +abcd abcd +efgh efgh +ijkl ijkl +DROP TABLE t1; show collation like 'ucs2_vn_ci'; Collation Charset Id Default Compiled Sortlen ucs2_vn_ci ucs2 242 8 diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test index fc6ed0f2579..73a23a751e8 100644 --- a/mysql-test/t/ctype_ldml.test +++ b/mysql-test/t/ctype_ldml.test @@ -21,6 +21,22 @@ 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); +ALTER TABLE t1 ADD (col2 varchar(100) character set latin1); +UPDATE t1 SET col2=col1; +SELECT * FROM t1 WHERE col1=col2 ORDER BY col1; +DROP TABLE t1; + # # Vietnamese experimental collation # |