Commit d930d072 authored by Alexander Barkov's avatar Alexander Barkov

Merge branch 'pruet-utf8thai-10.1' into 10.1

parents 9c9747fe fb35b9ad
......@@ -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
Ź,ź
Ž,ž
Ż,ż
ƍ
Ƶ,ƶ
Ʒ
Ǯ,ǯ
Ƹ,ƹ
ƺ
Þ,þ
ƿ,Ƿ
ƻ
Ƨ,ƨ
Ƽ,ƽ
Ƅ,ƅ
ʼn
ǀ
ǁ
ǂ
ǃ
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)
......
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;
SET NAMES utf8;
#
# Testing strnxfrm
#
CREATE TABLE t1 (a VARCHAR(3) CHARACTER SET utf8 COLLATE utf8_thai_520_w2);
INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2));
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1;
HEX(a) HEX(WEIGHT_STRING(a AS CHAR(8)))
020A020A020A020A020A020A020A020A00200020002000200020002000200020
20 020A020A020A020A020A020A020A020A00200020002000200020002000200020
2020 020A020A020A020A020A020A020A020A00200020002000200020002000200020
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1;
HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4)))
020A020A020A020A0020002000200020
20 020A020A020A020A0020002000200020
2020 020A020A020A020A0020002000200020
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1;
HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1))
020A020A020A020A
20 020A020A020A020A
2020 020A020A020A020A
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1;
HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2))
0020002000200020
20 0020002000200020
2020 0020002000200020
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1;
HEX(a) HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3))
0020002000200020
20 0020002000200020
2020 0020002000200020
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2);
INSERT INTO t1 VALUES ('A'),('À'),('Á'),('Â'),('Ã'),('Ä'),('Å');
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
a HEX(WEIGHT_STRING(a LEVEL 2))
A 0020
Á 00200032
À 00200035
 0020003C
Å 00200043
Ä 00200047
à 0020004E
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
a HEX(WEIGHT_STRING(a LEVEL 2))
à 0020004E
Ä 00200047
Å 00200043
 0020003C
À 00200035
Á 00200032
A 0020
ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2;
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
a HEX(WEIGHT_STRING(a LEVEL 2))
A 0020
Á 00200032
À 00200035
 0020003C
Å 00200043
Ä 00200047
à 0020004E
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
a HEX(WEIGHT_STRING(a LEVEL 2))
à 0020004E
Ä 00200047
Å 00200043
 0020003C
À 00200035
Á 00200032
A 0020
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2);
INSERT INTO t1 VALUES ('cota'),('cote'),('cotz');
INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë');
SELECT * FROM t1 ORDER BY a;
a
cota
cote
coté
cotë
côte
côté
côtë
cotz
SELECT * FROM t1 ORDER BY a DESC;
a
cotz
côtë
côté
côte
cotë
coté
cote
cota
DROP TABLE t1;
This diff is collapsed.
......@@ -70,6 +70,7 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_croatian_ci
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_german2_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_520_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_vietnamese_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_thai_520_w2;
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;
......
--source include/have_partition.inc
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;
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;
SELECT * FROM t1 PARTITION (p1) ORDER BY c1;
SELECT * FROM t1 PARTITION (p2) ORDER BY c1;
DROP TABLE t1;
SET NAMES utf8;
--echo #
--echo # Testing strnxfrm
--echo #
CREATE TABLE t1 (a VARCHAR(3) CHARACTER SET utf8 COLLATE utf8_thai_520_w2);
INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2));
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1;
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1;
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1;
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1;
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2);
INSERT INTO t1 VALUES ('A'),('À'),('Á'),('Â'),('Ã'),('Ä'),('Å');
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2;
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_thai_520_w2);
INSERT INTO t1 VALUES ('cota'),('cote'),('cotz');
INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë');
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t1 ORDER BY a DESC;
DROP TABLE t1;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
# Test Unicode Thai collations based on libthai testcases
#
SET NAMES utf8;
CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin);
INSERT INTO t1 VALUES ('-กระแย่ง');
INSERT INTO t1 VALUES ('กก');
INSERT INTO t1 VALUES ('กราบ');
INSERT INTO t1 VALUES ('ข่าง');
INSERT INTO t1 VALUES ('ข้าง');
INSERT INTO t1 VALUES ('ข้างกระดาน');
INSERT INTO t1 VALUES ('ข้างขึ้น');
INSERT INTO t1 VALUES ('ข้างควาย');
INSERT INTO t1 VALUES ('ข้างเงิน');
INSERT INTO t1 VALUES ('ข้างแรม');
INSERT INTO t1 VALUES ('ข้างออก');
INSERT INTO t1 VALUES ('ข้างๆ');
INSERT INTO t1 VALUES ('ข้างๆ คูๆ');
INSERT INTO t1 VALUES ('ขาง');
INSERT INTO t1 VALUES ('แข็ง');
INSERT INTO t1 VALUES ('แข่ง');
INSERT INTO t1 VALUES ('แข่งขัน');
INSERT INTO t1 VALUES ('แข้ง');
INSERT INTO t1 VALUES ('แข้งขวา');
INSERT INTO t1 VALUES ('แข็งขัน');
INSERT INTO t1 VALUES ('ทูลเกล้า');
INSERT INTO t1 VALUES ('ทูลเกล้าทูลกระหม่อม');
INSERT INTO t1 VALUES ('ทูลเกล้าฯ');
INSERT INTO t1 VALUES ('บุญญา');
INSERT INTO t1 VALUES ('บุญ-หลง');
INSERT INTO t1 VALUES ('บุญหลง');
INSERT INTO t1 VALUES ('ป่า');
INSERT INTO t1 VALUES ('ป่าน');
INSERT INTO t1 VALUES ('ป้า');
INSERT INTO t1 VALUES ('ป้าน');
INSERT INTO t1 VALUES ('ป๊า');
INSERT INTO t1 VALUES ('ป๊าน');
INSERT INTO t1 VALUES ('ป๋า');
INSERT INTO t1 VALUES ('ป๋าน');
INSERT INTO t1 VALUES ('ปา');
INSERT INTO t1 VALUES ('ปาน');
INSERT INTO t1 VALUES ('แป้ง');
INSERT INTO t1 VALUES ('พณิชย์');
INSERT INTO t1 VALUES ('ม้า');
INSERT INTO t1 VALUES ('ฯพณฯ');
INSERT INTO t1 VALUES ('A');
INSERT INTO t1 VALUES ('a');
INSERT INTO t1 VALUES ('a\'');
INSERT INTO t1 VALUES ('A-');
INSERT INTO t1 VALUES ('a-');
INSERT INTO t1 VALUES ('-a');
INSERT INTO t1 VALUES ('A.');
INSERT INTO t1 VALUES ('a.');
INSERT INTO t1 VALUES ('A-1');
INSERT INTO t1 VALUES ('aa');
INSERT INTO t1 VALUES ('AA');
INSERT INTO t1 VALUES ('A.A.');
INSERT INTO t1 VALUES ('a.a.');
INSERT INTO t1 VALUES ('AAA');
INSERT INTO t1 VALUES ('A.A.A.');
INSERT INTO t1 VALUES ('AAAA');
INSERT INTO t1 VALUES ('A.A.A.L.');
INSERT INTO t1 VALUES ('A.A.A.S.');
INSERT INTO t1 VALUES ('Aachen');
INSERT INTO t1 VALUES ('A.A.E.');
INSERT INTO t1 VALUES ('A.Ae.E.');
INSERT INTO t1 VALUES ('A.A.E.E.');
INSERT INTO t1 VALUES ('AAES');
INSERT INTO t1 VALUES ('AAF');
INSERT INTO t1 VALUES ('A.Agr');
INSERT INTO t1 VALUES ('aah');
INSERT INTO t1 VALUES ('@@@@@');
INSERT INTO t1 VALUES ('0000');
INSERT INTO t1 VALUES ('9999');
INSERT INTO t1 VALUES ('Aalborg');
INSERT INTO t1 VALUES ('aide');
INSERT INTO t1 VALUES ('air');
INSERT INTO t1 VALUES ('@@@air');
INSERT INTO t1 VALUES ('air@@@');
INSERT INTO t1 VALUES ('C.A.F');
INSERT INTO t1 VALUES ('Canon');
INSERT INTO t1 VALUES ('coop');
INSERT INTO t1 VALUES ('co-op');
INSERT INTO t1 VALUES ('COOP');
INSERT INTO t1 VALUES ('CO-OP');
INSERT INTO t1 VALUES ('Copenhegen');
INSERT INTO t1 VALUES ('McArthur');
INSERT INTO t1 VALUES ('Mc Arthur');
INSERT INTO t1 VALUES ('Mc Mahon');
INSERT INTO t1 VALUES ('vice-president');
INSERT INTO t1 VALUES ('vice versa');
INSERT INTO t1 VALUES ('vice-versa');
INSERT INTO t1 VALUES ('10 ลิตร');
INSERT INTO t1 VALUES ('๑๐ ลิตร');
INSERT INTO t1 VALUES ('10 litre');
INSERT INTO t1 VALUES ('10 litre (10 ลิตร)');
INSERT INTO t1 VALUES ('10 ลิตร (10 litre)');
INSERT INTO t1 VALUES ('10 litre (๑๐ ลิตร)');
INSERT INTO t1 VALUES ('๑๐ ลิตร (10 litre)');
INSERT INTO t1 VALUES ('๑๐ ลิตร [10 litre]');
INSERT INTO t1 VALUES ('๑๐ ลิตร {10 litre}');
# Sort the table according to binary 'a'
# To avoid problems with unpredictable order or 'AA' and 'aa'
ALTER TABLE t1 ORDER BY a;
ALTER TABLE t1
MODIFY a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_thai_520_w2,
ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
ADD KEY a_id (a, id);
--echo #
--echo # Ascending sort, using filesort
--echo #
EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a;
SELECT a FROM t1 ORDER BY a, BINARY a;
--echo #
--echo # Descending sort, using filesort
--echo #
EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
--echo #
--echo # Ascending sort, using index
--echo #
EXPLAIN SELECT a FROM t1 ORDER BY a, id;
SELECT a FROM t1 ORDER BY a, id;
--echo #
--echo # Descending sort, using index
--echo #
EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC;
SELECT a FROM t1 ORDER BY a DESC, id DESC;
DROP TABLE t1;
......@@ -133,6 +133,7 @@ extern struct charset_info_st my_charset_utf8_hungarian_uca_ci;
extern struct charset_info_st my_charset_utf8_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_utf8_sinhala_uca_ci;
extern struct charset_info_st my_charset_utf8_unicode_520_ci;
extern struct charset_info_st my_charset_utf8_thai_520_w2;
extern struct charset_info_st my_charset_utf8_vietnamese_ci;
extern struct charset_info_st my_charset_utf8_croatian_uca_ci;
extern struct charset_info_st my_charset_utf8_myanmar_uca_ci;
......@@ -300,6 +301,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8_croatian_mysql561_uca_ci);
add_compiled_collation(&my_charset_utf8_sinhala_uca_ci);
add_compiled_collation(&my_charset_utf8_unicode_520_ci);
add_compiled_collation(&my_charset_utf8_thai_520_w2);
add_compiled_collation(&my_charset_utf8_vietnamese_ci);
add_compiled_collation(&my_charset_utf8_croatian_uca_ci);
add_compiled_collation(&my_charset_utf8_myanmar_uca_ci);
......
......@@ -3536,7 +3536,7 @@ void Item_func_weight_string::fix_length_and_dec()
{
uint char_length;
char_length= ((cs->state & MY_CS_STRNXFRM_BAD_NWEIGHTS) || !nweights) ?
args[0]->max_char_length() : nweights;
args[0]->max_char_length() : nweights * cs->levels_for_order;
max_length= cs->coll->strnxfrmlen(cs, char_length * cs->mbmaxlen);
}
maybe_null= 1;
......
......@@ -40,7 +40,6 @@
#ifdef HAVE_CHARSET_tis620
#define BUFFER_MULTIPLY 4
#define M L_MIDDLE
#define U L_UPPER
#define L L_LOWER
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment