From bd3dc54261f10f387a03ad99ce74c3824c42e462 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 31 Oct 2013 14:24:24 +0400 Subject: A few minor Unicode collation customization improvements were made, which makes it possible to add more world language collations with very complex collation rules (e.g. Myanmar): - Weight string for a single character in a user defined collation was erroneously limited to 7 weights (instead of 8 weights). Added an extra element in the user-defined weight arrays, to fit 8 non-zero weights. - Weight string limit for contractions was made two times longer (16 weights), which allows longer contractions without affecting the performance of filesort. - A user-defined collation now refuses to initialize and reports an error in case if a weight string gets longer than 8 weights for a single character, or longer than 16 weights for a contraction. Previously weight strings for such characters (and contractions) were cut, so a collation could silently start with wrong rules. - Fixed a bug in handling rules like "&a << b" in combination with shift-after-method="expand". The primary weight for "b" was not correctly calculated, which erroneously made "b" primary greater than "a" instead of primary equal to "a". --- mysql-test/r/ctype_ldml.result | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mysql-test/r/ctype_ldml.result') diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result index 0373d74afb4..bd96a1f6255 100644 --- a/mysql-test/r/ctype_ldml.result +++ b/mysql-test/r/ctype_ldml.result @@ -425,6 +425,7 @@ ucs2_test_ci ucs2 358 8 ucs2_vn_ci ucs2 359 8 ucs2_5624_1 ucs2 360 8 utf8_5624_5 utf8 368 8 +utf8_5624_5_bad utf8 369 8 utf32_test_ci utf32 391 8 utf8_maxuserid_ci utf8 2047 8 show collation like '%test%'; @@ -1030,9 +1031,12 @@ INSERT INTO t1 VALUES ('A'),('B'),('C'),('D'),('E'),('F'),('G'),('H'),('I'); INSERT INTO t1 VALUES ('J'),('K'),('L'),('M'),('N'),('O'),('P'),('Q'),('R'); INSERT INTO t1 VALUES ('S'),('T'),('U'),('V'),('W'),('X'),('Y'),('Z'); INSERT INTO t1 VALUES ('AA'),('AAA'); +INSERT INTO t1 VALUES ('001'),('002'); SELECT a, HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a, LENGTH(a), BINARY(a); a HEX(WEIGHT_STRING(a)) 0 0E29 +001 0E29 +002 0E29 0z 0E290E292357 0ン 0E291E81 a 0E29233E @@ -1093,6 +1097,12 @@ AA 0E293358 AAA 0E293359 1 0E2A DROP TABLE t1; +SET NAMES utf8 COLLATE utf8_5624_5_bad; +ERROR HY000: Unknown collation: 'utf8_5624_5_bad' +SHOW WARNINGS; +Level Code Message +Error 1273 Unknown collation: 'utf8_5624_5_bad' +Warning 1273 Expansion too long: 'a\u002Daaaaaa10' # # End of WL#5624 # -- cgit v1.2.1