Permalink
Browse files

Multi-level collation in UCA, Thai sorting with contraction for UTF8.

  • Loading branch information...
pruet committed May 26, 2016
1 parent 9c9747f commit fb35b9ad07f11c8beb24e579f365eca57bbda28a
View
@@ -101,7 +101,7 @@ extern MY_UNICASE_INFO my_unicase_unicode520;
*/
#define MY_UCA_MAX_WEIGHT_SIZE (8+1) /* Including 0 terminator */
#define MY_UCA_CONTRACTION_MAX_WEIGHT_SIZE (2*8+1) /* Including 0 terminator */
-#define MY_UCA_WEIGHT_LEVELS 1
+#define MY_UCA_WEIGHT_LEVELS 2
typedef struct my_contraction_t
{
@@ -2706,6 +2706,261 @@ Z,z,Ź,ź,Ż,ż,Ž,ž
ǁ
ǂ
ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_thai_520_w2;
+group_concat(c1 order by c1)
+A,a
+Á,á
+À,à
+Ă,ă
+Ắ,ắ
+Ằ,ằ
+Ẵ,ẵ
+Ẳ,ẳ
+Â,â
+Ấ,ấ
+Ầ,ầ
+Ẫ,ẫ
+Ẩ,ẩ
+Ǎ,ǎ
+Å,å
+Ǻ,ǻ
+Ä,ä
+Ǟ,ǟ
+Ã,ã
+Ǡ,ǡ
+Ą,ą
+Ā,ā
+Ả,ả
+Ạ,ạ
+Ặ,ặ
+Ậ,ậ
+AA,Aa,aA,aa
+AE,Ae,aE,ae
+Æ,æ
+Ǽ,ǽ
+Ǣ,ǣ
+B,b
+Ƃ,ƃ
+C,c
+Ć,ć
+Ĉ,ĉ
+Č,č
+Ċ,ċ
+Ç,ç
+CH,Ch,cH,ch
+Ƈ,ƈ
+D,d
+Ď,ď
+Đ,đ
+Ð,ð
+DZ,Dz,dZ,dz,DZ,Dz,dz
+DŽ,Dž,dŽ,dž,DŽ,Dž,dž
+Ƌ,ƌ
+E,e
+É,é
+È,è
+Ĕ,ĕ
+Ê,ê
+Ế,ế
+Ề,ề
+Ễ,ễ
+Ể,ể
+Ě,ě
+Ë,ë
+Ẽ,ẽ
+Ė,ė
+Ę,ę
+Ē,ē
+Ẻ,ẻ
+Ẹ,ẹ
+Ệ,ệ
+Ǝ,ǝ
+F,f
+Ƒ,ƒ
+G,g
+Ǵ,ǵ
+Ğ,ğ
+Ĝ,ĝ
+Ǧ,ǧ
+Ġ,ġ
+Ģ,ģ
+Ǥ,ǥ
+Ƣ,ƣ
+H,h
+Ĥ,ĥ
+Ħ,ħ
+ƕ,Ƕ
+I,i
+Í,í
+Ì,ì
+Ĭ,ĭ
+Î,î
+Ǐ,ǐ
+Ï,ï
+Ĩ,ĩ
+Į,į
+Ī,ī
+Ỉ,ỉ
+Ị,ị
+IJ,Ij,iJ,ij,IJ,ij
+J,j
+Ĵ,ĵ
+K,k
+Ǩ,ǩ
+Ķ,ķ
+Ƙ,ƙ
+L,l
+Ĺ,ĺ
+Ľ,ľ
+Ļ,ļ
+Ł,ł
+Ŀ,ŀ
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+M,m
+N,n
+Ń,ń
+Ǹ,ǹ
+Ň,ň
+Ñ,ñ
+Ņ,ņ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Ŋ,ŋ
+O,o
+Ó,ó
+Ò,ò
+Ŏ,ŏ
+Ô,ô
+Ố,ố
+Ồ,ồ
+Ỗ,ỗ
+Ổ,ổ
+Ǒ,ǒ
+Ö,ö
+Ő,ő
+Õ,õ
+Ø,ø
+Ǿ,ǿ
+Ǫ,ǫ
+Ǭ,ǭ
+Ō,ō
+Ỏ,ỏ
+Ơ,ơ
+Ớ,ớ
+Ờ,ờ
+Ỡ,ỡ
+Ở,ở
+Ợ,ợ
+Ọ,ọ
+Ộ,ộ
+OE,Oe,oE,oe
+Œ,œ
+P,p
+Ƥ,ƥ
+Q,q
+R,r
+Ŕ,ŕ
+Ř,ř
+Ŗ,ŗ
+RR,Rr,rR,rr
+S,s
+Ś,ś
+Ŝ,ŝ
+Š,š
+Ş,ş
+ſ
+SS,Ss,sS,ss
+T,t
+Ť,ť
+Ţ,ţ
+Ŧ,ŧ
+Ƭ,ƭ
+U,u
+Ú,ú
+Ù,ù
+Ŭ,ŭ
+Û,û
+Ǔ,ǔ
+Ů,ů
+Ü,ü
+Ǘ,ǘ
+Ǜ,ǜ
+Ǚ,ǚ
+Ǖ,ǖ
+Ű,ű
+Ũ,ũ
+Ų,ų
+Ū,ū
+Ủ,ủ
+Ư,ư
+Ứ,ứ
+Ừ,ừ
+Ữ,ữ
+Ử,ử
+Ự,ự
+Ụ,ụ
+V,v
+W,w
+Ŵ,ŵ
+X,x
+Y,y
+Ý,ý
+Ŷ,ŷ
+ÿ,Ÿ
+Ƴ,ƴ
+Z,z
+Ź,ź
+Ž,ž
+Ż,ż
+Ƶ,ƶ
+Ǯ,ǯ
+Ƹ,ƹ
+Þ,þ
+ƿ,Ƿ
+Ƨ,ƨ
+Ƽ,ƽ
+Ƅ,ƅ
ALTER TABLE t1 CONVERT TO CHARACTER SET ucs2 COLLATE ucs2_bin;
SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_unicode_ci;
GROUP_CONCAT(c1 ORDER BY c1)
@@ -0,0 +1,86 @@
+SET NAMES utf8;
+CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2)
+PARTITION BY KEY(c1) PARTITIONS 3;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c1)
+PARTITIONS 3 */
+INSERT INTO t1 VALUES ('A'),('À'),('Á'),('Â'),('Ã'),('Ä'),('Å');
+INSERT INTO t1 VALUES ('B');
+INSERT INTO t1 VALUES ('C');
+INSERT INTO t1 VALUES ('D');
+INSERT INTO t1 VALUES ('E');
+INSERT INTO t1 VALUES ('F');
+INSERT INTO t1 VALUES ('G');
+INSERT INTO t1 VALUES ('H');
+INSERT INTO t1 VALUES ('I');
+INSERT INTO t1 VALUES ('J');
+INSERT INTO t1 VALUES ('K');
+INSERT INTO t1 VALUES ('L'),('Ĺ'),('Ļ'),('Ľ'),('Ŀ'),('Ł');
+INSERT INTO t1 VALUES ('M');
+INSERT INTO t1 VALUES ('N');
+INSERT INTO t1 VALUES ('O'),('Ò'),('Ó'),('Ô'),('Õ'),('Ö'),('Ø');
+INSERT INTO t1 VALUES ('P');
+INSERT INTO t1 VALUES ('Q');
+INSERT INTO t1 VALUES ('R');
+INSERT INTO t1 VALUES ('S');
+INSERT INTO t1 VALUES ('T');
+INSERT INTO t1 VALUES ('U');
+INSERT INTO t1 VALUES ('V');
+INSERT INTO t1 VALUES ('W');
+INSERT INTO t1 VALUES ('X');
+INSERT INTO t1 VALUES ('Y');
+INSERT INTO t1 VALUES ('Z');
+SELECT * FROM t1 PARTITION (p0) ORDER BY c1;
+c1
+J
+K
+L
+Ŀ
+M
+Q
+R
+T
+V
+X
+SELECT * FROM t1 PARTITION (p1) ORDER BY c1;
+c1
+A
+D
+E
+F
+G
+I
+N
+S
+U
+W
+Z
+SELECT * FROM t1 PARTITION (p2) ORDER BY c1;
+c1
+B
+C
+H
+O
+P
+Y
+DROP TABLE t1;
Oops, something went wrong.

0 comments on commit fb35b9a

Please sign in to comment.