1
DROP TABLE IF EXISTS t1;
6
set collation_connection=utf16_unicode_ci;
7
select hex('a'), hex('a ');
10
select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
11
'a' = 'a' 'a' = 'a ' 'a ' = 'a'
13
select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
14
'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a'
16
select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
17
'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0'
19
select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
20
'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a '
22
select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
23
'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0'
25
select 'a a' > 'a', 'a \0' < 'a';
26
'a a' > 'a' 'a \0' < 'a'
28
select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a';
29
binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a'
31
select 'c' like '\_' as want0;
36
) ENGINE=MyISAM DEFAULT CHARACTER SET utf16 COLLATE utf16_unicode_ci;
37
INSERT INTO t VALUES ('a'),('ab'),('aba');
38
ALTER TABLE t ADD INDEX (c);
39
SELECT c FROM t WHERE c LIKE 'a%';
45
create table t1 (c1 char(10) character set utf16 collate utf16_bin);
46
insert into t1 values ('A'),('a');
47
insert into t1 values ('B'),('b');
48
insert into t1 values ('C'),('c');
49
insert into t1 values ('D'),('d');
50
insert into t1 values ('E'),('e');
51
insert into t1 values ('F'),('f');
52
insert into t1 values ('G'),('g');
53
insert into t1 values ('H'),('h');
54
insert into t1 values ('I'),('i');
55
insert into t1 values ('J'),('j');
56
insert into t1 values ('K'),('k');
57
insert into t1 values ('L'),('l');
58
insert into t1 values ('M'),('m');
59
insert into t1 values ('N'),('n');
60
insert into t1 values ('O'),('o');
61
insert into t1 values ('P'),('p');
62
insert into t1 values ('Q'),('q');
63
insert into t1 values ('R'),('r');
64
insert into t1 values ('S'),('s');
65
insert into t1 values ('T'),('t');
66
insert into t1 values ('U'),('u');
67
insert into t1 values ('V'),('v');
68
insert into t1 values ('W'),('w');
69
insert into t1 values ('X'),('x');
70
insert into t1 values ('Y'),('y');
71
insert into t1 values ('Z'),('z');
72
insert into t1 values (0x00e0),(0x00c0);
73
insert into t1 values (0x00e1),(0x00c1);
74
insert into t1 values (0x00e2),(0x00c2);
75
insert into t1 values (0x00e3),(0x00c3);
76
insert into t1 values (0x00e4),(0x00c4);
77
insert into t1 values (0x00e5),(0x00c5);
78
insert into t1 values (0x00e6),(0x00c6);
79
insert into t1 values (0x00e7),(0x00c7);
80
insert into t1 values (0x00e8),(0x00c8);
81
insert into t1 values (0x00e9),(0x00c9);
82
insert into t1 values (0x00ea),(0x00ca);
83
insert into t1 values (0x00eb),(0x00cb);
84
insert into t1 values (0x00ec),(0x00cc);
85
insert into t1 values (0x00ed),(0x00cd);
86
insert into t1 values (0x00ee),(0x00ce);
87
insert into t1 values (0x00ef),(0x00cf);
88
insert into t1 values (0x00f0),(0x00d0);
89
insert into t1 values (0x00f1),(0x00d1);
90
insert into t1 values (0x00f2),(0x00d2);
91
insert into t1 values (0x00f3),(0x00d3);
92
insert into t1 values (0x00f4),(0x00d4);
93
insert into t1 values (0x00f5),(0x00d5);
94
insert into t1 values (0x00f6),(0x00d6);
95
insert into t1 values (0x00f7),(0x00d7);
96
insert into t1 values (0x00f8),(0x00d8);
97
insert into t1 values (0x00f9),(0x00d9);
98
insert into t1 values (0x00fa),(0x00da);
99
insert into t1 values (0x00fb),(0x00db);
100
insert into t1 values (0x00fc),(0x00dc);
101
insert into t1 values (0x00fd),(0x00dd);
102
insert into t1 values (0x00fe),(0x00de);
103
insert into t1 values (0x00ff),(0x00df);
104
insert into t1 values (0x0100),(0x0101),(0x0102),(0x0103);
105
insert into t1 values (0x0104),(0x0105),(0x0106),(0x0107);
106
insert into t1 values (0x0108),(0x0109),(0x010a),(0x010b);
107
insert into t1 values (0x010c),(0x010d),(0x010e),(0x010f);
108
insert into t1 values (0x0110),(0x0111),(0x0112),(0x0113);
109
insert into t1 values (0x0114),(0x0115),(0x0116),(0x0117);
110
insert into t1 values (0x0118),(0x0119),(0x011a),(0x011b);
111
insert into t1 values (0x011c),(0x011d),(0x011e),(0x011f);
112
insert into t1 values (0x0120),(0x0121),(0x0122),(0x0123);
113
insert into t1 values (0x0124),(0x0125),(0x0126),(0x0127);
114
insert into t1 values (0x0128),(0x0129),(0x012a),(0x012b);
115
insert into t1 values (0x012c),(0x012d),(0x012e),(0x012f);
116
insert into t1 values (0x0130),(0x0131),(0x0132),(0x0133);
117
insert into t1 values (0x0134),(0x0135),(0x0136),(0x0137);
118
insert into t1 values (0x0138),(0x0139),(0x013a),(0x013b);
119
insert into t1 values (0x013c),(0x013d),(0x013e),(0x013f);
120
insert into t1 values (0x0140),(0x0141),(0x0142),(0x0143);
121
insert into t1 values (0x0144),(0x0145),(0x0146),(0x0147);
122
insert into t1 values (0x0148),(0x0149),(0x014a),(0x014b);
123
insert into t1 values (0x014c),(0x014d),(0x014e),(0x014f);
124
insert into t1 values (0x0150),(0x0151),(0x0152),(0x0153);
125
insert into t1 values (0x0154),(0x0155),(0x0156),(0x0157);
126
insert into t1 values (0x0158),(0x0159),(0x015a),(0x015b);
127
insert into t1 values (0x015c),(0x015d),(0x015e),(0x015f);
128
insert into t1 values (0x0160),(0x0161),(0x0162),(0x0163);
129
insert into t1 values (0x0164),(0x0165),(0x0166),(0x0167);
130
insert into t1 values (0x0168),(0x0169),(0x016a),(0x016b);
131
insert into t1 values (0x016c),(0x016d),(0x016e),(0x016f);
132
insert into t1 values (0x0170),(0x0171),(0x0172),(0x0173);
133
insert into t1 values (0x0174),(0x0175),(0x0176),(0x0177);
134
insert into t1 values (0x0178),(0x0179),(0x017a),(0x017b);
135
insert into t1 values (0x017c),(0x017d),(0x017e),(0x017f);
136
insert into t1 values (0x0180),(0x0181),(0x0182),(0x0183);
137
insert into t1 values (0x0184),(0x0185),(0x0186),(0x0187);
138
insert into t1 values (0x0188),(0x0189),(0x018a),(0x018b);
139
insert into t1 values (0x018c),(0x018d),(0x018e),(0x018f);
140
insert into t1 values (0x0190),(0x0191),(0x0192),(0x0193);
141
insert into t1 values (0x0194),(0x0195),(0x0196),(0x0197);
142
insert into t1 values (0x0198),(0x0199),(0x019a),(0x019b);
143
insert into t1 values (0x019c),(0x019d),(0x019e),(0x019f);
144
insert into t1 values (0x01a0),(0x01a1),(0x01a2),(0x01a3);
145
insert into t1 values (0x01a4),(0x01a5),(0x01a6),(0x01a7);
146
insert into t1 values (0x01a8),(0x01a9),(0x01aa),(0x01ab);
147
insert into t1 values (0x01ac),(0x01ad),(0x01ae),(0x01af);
148
insert into t1 values (0x01b0),(0x01b1),(0x01b2),(0x01b3);
149
insert into t1 values (0x01b4),(0x01b5),(0x01b6),(0x01b7);
150
insert into t1 values (0x01b8),(0x01b9),(0x01ba),(0x01bb);
151
insert into t1 values (0x01bc),(0x01bd),(0x01be),(0x01bf);
152
insert into t1 values (0x01c0),(0x01c1),(0x01c2),(0x01c3);
153
insert into t1 values (0x01c4),(0x01c5),(0x01c6),(0x01c7);
154
insert into t1 values (0x01c8),(0x01c9),(0x01ca),(0x01cb);
155
insert into t1 values (0x01cc),(0x01cd),(0x01ce),(0x01cf);
156
insert into t1 values (0x01d0),(0x01d1),(0x01d2),(0x01d3);
157
insert into t1 values (0x01d4),(0x01d5),(0x01d6),(0x01d7);
158
insert into t1 values (0x01d8),(0x01d9),(0x01da),(0x01db);
159
insert into t1 values (0x01dc),(0x01dd),(0x01de),(0x01df);
160
insert into t1 values (0x01e0),(0x01e1),(0x01e2),(0x01e3);
161
insert into t1 values (0x01e4),(0x01e5),(0x01e6),(0x01e7);
162
insert into t1 values (0x01e8),(0x01e9),(0x01ea),(0x01eb);
163
insert into t1 values (0x01ec),(0x01ed),(0x01ee),(0x01ef);
164
insert into t1 values (0x01f0),(0x01f1),(0x01f2),(0x01f3);
165
insert into t1 values (0x01f4),(0x01f5),(0x01f6),(0x01f7);
166
insert into t1 values (0x01f8),(0x01f9),(0x01fa),(0x01fb);
167
insert into t1 values (0x01fc),(0x01fd),(0x01fe),(0x01ff);
168
insert into t1 values ('AA'),('Aa'),('aa'),('aA');
169
insert into t1 values ('CH'),('Ch'),('ch'),('cH');
170
insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
171
insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
172
insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
173
insert into t1 values ('LL'),('Ll'),('ll'),('lL');
174
insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
175
insert into t1 values ('OE'),('Oe'),('oe'),('oE');
176
insert into t1 values ('SS'),('Ss'),('ss'),('sS');
177
insert into t1 values ('RR'),('Rr'),('rr'),('rR');
178
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_unicode_ci;
179
group_concat(c1 order by binary c1 separator '')
182
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
213
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
234
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
256
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
282
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_icelandic_ci;
283
group_concat(c1 order by binary c1 separator '')
286
AaÀÂÃàâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
341
OoÒÔÕòôõŌōŎŏŐőƠơǑǒǪǫǬǭ
364
UuÙÛÜùûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
395
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_latvian_ci;
396
group_concat(c1 order by binary c1 separator '')
399
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
432
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
457
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
481
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
508
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_romanian_ci;
509
group_concat(c1 order by binary c1 separator '')
512
AaÀÁÃÄÅàáãäåĀāĄąǍǎǞǟǠǡǺǻ
567
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
591
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
617
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovenian_ci;
618
group_concat(c1 order by binary c1 separator '')
621
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
653
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
674
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
697
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
724
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_polish_ci;
725
group_concat(c1 order by binary c1 separator '')
728
AaÀÁÂÃÄÅàáâãäåĀāĂăǍǎǞǟǠǡǺǻ
762
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
784
OoÒÔÕÖòôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
808
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
836
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_estonian_ci;
837
group_concat(c1 order by binary c1 separator '')
840
AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻ
872
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
893
OoÒÓÔòóôŌōŎŏŐőƠơǑǒǪǫǬǭ
918
UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
948
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish_ci;
949
group_concat(c1 order by binary c1 separator '')
952
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
983
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
1005
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
1027
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
1053
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_swedish_ci;
1054
group_concat(c1 order by binary c1 separator '')
1057
AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
1074
EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
1088
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
1109
OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭ
1131
UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
1160
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_turkish_ci;
1161
group_concat(c1 order by binary c1 separator '')
1164
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
1182
EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
1199
iÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
1219
OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭ
1243
UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
1270
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_czech_ci;
1271
group_concat(c1 order by binary c1 separator '')
1274
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
1292
EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
1307
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
1328
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
1352
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
1379
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_danish_ci;
1380
group_concat(c1 order by binary c1 separator '')
1383
AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻ
1400
EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
1414
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
1435
OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭ
1457
UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜ
1486
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_lithuanian_ci;
1487
group_concat(c1 order by binary c1 separator '')
1490
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
1508
EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
1522
IYiyÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
1543
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
1566
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
1593
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovak_ci;
1594
group_concat(c1 order by binary c1 separator '')
1597
AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻ
1616
EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
1631
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
1652
OoÒÓÕÖòóõöŌōŎŏŐőƠơǑǒǪǫǬǭ
1676
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
1703
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish2_ci;
1704
group_concat(c1 order by binary c1 separator '')
1707
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
1725
EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
1739
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
1762
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
1784
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
1810
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_roman_ci;
1811
group_concat(c1 order by binary c1 separator '')
1814
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
1831
EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
1845
IJijÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
1869
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
1891
ÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
1917
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_esperanto_ci;
1918
group_concat(c1 order by binary c1 separator '')
1921
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
1939
EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
1955
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
1977
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭ
2000
UuÙÚÛÜùúûüŨũŪūŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜ
2027
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_hungarian_ci;
2028
group_concat(c1 order by binary c1 separator '')
2031
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻ
2048
EeÈÉÊËèéêëĒēĔĕĖėĘęĚě
2062
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐ
2083
OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭ
2106
UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜ
2135
CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_general_ci NOT NULL, INDEX (c));
2136
INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
2137
SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_general_ci;
2140
INSERT INTO t1 VALUES (0x039C03C903B4);
2141
SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
2142
COLLATE utf16_general_ci ORDER BY c;
2147
CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c));
2148
INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
2149
SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci;
2152
INSERT INTO t1 VALUES (0x039C03C903B4);
2153
SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
2154
COLLATE utf16_unicode_ci ORDER BY c;
2159
CREATE TABLE t1 (c varchar(200) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c));
2160
INSERT INTO t1 VALUES (0x039C03C903B403B11F770308);
2161
SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci;
2164
INSERT INTO t1 VALUES (0x039C03C903B4);
2165
SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025
2166
COLLATE utf16_unicode_ci ORDER BY c;
2172
SET @test_character_set='utf16';
2173
SET @test_collation='utf16_swedish_ci';
2174
SET @safe_character_set_server= @@character_set_server;
2175
SET @safe_collation_server= @@collation_server;
2176
SET @safe_character_set_client= @@character_set_client;
2177
SET @safe_character_set_results= @@character_set_results;
2178
SET character_set_server= @test_character_set;
2179
SET collation_server= @test_collation;
2182
CREATE TABLE t1 (c CHAR(10), KEY(c));
2183
SHOW FULL COLUMNS FROM t1;
2184
Field Type Collation Null Key Default Extra Privileges Comment
2185
c char(10) utf16_swedish_ci YES MUL NULL
2186
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
2187
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
2193
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
2194
SHOW FULL COLUMNS FROM t1;
2195
Field Type Collation Null Key Default Extra Privileges Comment
2196
c1 varchar(15) utf16_swedish_ci YES MUL NULL
2197
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
2198
SELECT c1 as want3results from t1 where c1 like 'l%';
2203
SELECT c1 as want3results from t1 where c1 like 'lo%';
2208
SELECT c1 as want1result from t1 where c1 like 'loc%';
2211
SELECT c1 as want1result from t1 where c1 like 'loca%';
2214
SELECT c1 as want1result from t1 where c1 like 'locat%';
2217
SELECT c1 as want1result from t1 where c1 like 'locati%';
2220
SELECT c1 as want1result from t1 where c1 like 'locatio%';
2223
SELECT c1 as want1result from t1 where c1 like 'location%';
2227
create table t1 (a set('a') not null);
2228
insert into t1 values (),();
2230
Warning 1364 Field 'a' doesn't have a default value
2231
select cast(a as char(1)) from t1;
2235
select a sounds like a from t1;
2239
select 1 from t1 order by cast(a as char(1));
2247
level smallint unsigned);
2248
show create table t1;
2250
t1 CREATE TABLE `t1` (
2251
`name` varchar(10) COLLATE utf16_swedish_ci DEFAULT NULL,
2252
`level` smallint(5) unsigned DEFAULT NULL
2253
) ENGINE=MyISAM DEFAULT CHARSET=utf16 COLLATE=utf16_swedish_ci
2254
insert into t1 values ('string',1);
2255
select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
2256
concat(name,space(level)) concat(name, repeat(' ',level))
2261
SET character_set_server= @safe_character_set_server;
2262
SET collation_server= @safe_collation_server;
2263
SET character_set_client= @safe_character_set_client;
2264
SET character_set_results= @safe_character_set_results;
2265
SET collation_connection='utf16_unicode_ci';
2266
create table t1 select repeat('a',4000) a;
2268
insert into t1 values ('a'), ('a '), ('a\t');
2269
select collation(a),hex(a) from t1 order by a;
2271
utf16_unicode_ci 00610009
2272
utf16_unicode_ci 0061
2273
utf16_unicode_ci 00610020
2275
select @@collation_connection;
2276
@@collation_connection
2278
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
2279
insert into t1 values('abcdef');
2280
insert into t1 values('_bcdef');
2281
insert into t1 values('a_cdef');
2282
insert into t1 values('ab_def');
2283
insert into t1 values('abc_ef');
2284
insert into t1 values('abcd_f');
2285
insert into t1 values('abcde_');
2286
select c1 as c1u from t1 where c1 like 'ab\_def';
2289
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
2294
CREATE TABLE t1 (id int, a varchar(30) character set utf16);
2295
INSERT INTO t1 VALUES (1, 0x01310069), (2, 0x01310131);
2296
INSERT INTO t1 VALUES (3, 0x00690069), (4, 0x01300049);
2297
INSERT INTO t1 VALUES (5, 0x01300130), (6, 0x00490049);
2298
SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
2299
FROM t1 ORDER BY id;
2307
ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf16 collate utf16_turkish_ci;
2308
SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
2309
FROM t1 ORDER BY id;
2319
c1 text character set utf16 collate utf16_polish_ci NOT NULL
2321
insert into t1 values (''),('a');
2322
SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
2326
DROP TABLE IF EXISTS t1;
2327
set collation_connection=utf16_unicode_ci;
2328
drop table if exists t1;
2330
select repeat(' ', 64) as s1, repeat(' ',64) as s2
2333
show create table t1;
2335
t1 CREATE TABLE `t1` (
2336
`s1` varchar(64) CHARACTER SET utf16 COLLATE utf16_unicode_ci DEFAULT NULL,
2337
`s2` varchar(64) CHARACTER SET utf16 COLLATE utf16_unicode_ci DEFAULT NULL
2338
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2340
insert into t1 values('aaa','aaa');
2341
insert into t1 values('aaa|qqq','qqq');
2342
insert into t1 values('gheis','^[^a-dXYZ]+$');
2343
insert into t1 values('aab','^aa?b');
2344
insert into t1 values('Baaan','^Ba*n');
2345
insert into t1 values('aaa','qqq|aaa');
2346
insert into t1 values('qqq','qqq|aaa');
2347
insert into t1 values('bbb','qqq|aaa');
2348
insert into t1 values('bbb','qqq');
2349
insert into t1 values('aaa','aba');
2350
insert into t1 values(null,'abc');
2351
insert into t1 values('def',null);
2352
insert into t1 values(null,null);
2353
insert into t1 values('ghi','ghi[');
2354
select HIGH_PRIORITY s1 regexp s2 from t1;