~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/t/ctype_uca.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
Import upstream version 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- source include/have_ucs2.inc
 
2
 
 
3
--disable_warnings
 
4
DROP TABLE IF EXISTS t1;
 
5
--enable_warnings
 
6
 
 
7
#
 
8
# Test Unicode collations.
 
9
#
 
10
set names utf8; 
 
11
 
 
12
#
 
13
# Check trailing spaces
 
14
#
 
15
set collation_connection=utf8_unicode_ci;
 
16
 
 
17
select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
 
18
 
 
19
select 'a\t' = 'a' , 'a\t' < 'a' , 'a\t' > 'a';
 
20
select 'a\t' = 'a ', 'a\t' < 'a ', 'a\t' > 'a ';
 
21
 
 
22
select 'a' = 'a\t', 'a' < 'a\t', 'a' > 'a\t';
 
23
select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t';
 
24
 
 
25
select 'a  a' > 'a', 'a  \t' < 'a';
 
26
 
 
27
#
 
28
# Bug #6787 LIKE not working properly with _ and utf8 data
 
29
#
 
30
select 'c' like '\_' as want0; 
 
31
 
 
32
#
 
33
# Bug #5679 utf8_unicode_ci LIKE--trailing % doesn't equal zero characters
 
34
#
 
35
CREATE TABLE t (
 
36
  c char(20) NOT NULL
 
37
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
38
INSERT INTO t VALUES ('a'),('ab'),('aba');
 
39
ALTER TABLE t ADD INDEX (c);
 
40
SELECT c FROM t WHERE c LIKE 'a%';
 
41
#should find 3 rows but only found 2
 
42
DROP TABLE t;
 
43
 
 
44
create table t1 (c1 char(10) character set utf8 collate utf8_bin);
 
45
 
 
46
#
 
47
# Basic Latin
 
48
#
 
49
insert into t1 values ('A'),('a');
 
50
insert into t1 values ('B'),('b');
 
51
insert into t1 values ('C'),('c');
 
52
insert into t1 values ('D'),('d');
 
53
insert into t1 values ('E'),('e');
 
54
insert into t1 values ('F'),('f');
 
55
insert into t1 values ('G'),('g');
 
56
insert into t1 values ('H'),('h');
 
57
insert into t1 values ('I'),('i');
 
58
insert into t1 values ('J'),('j');
 
59
insert into t1 values ('K'),('k');
 
60
insert into t1 values ('L'),('l');
 
61
insert into t1 values ('M'),('m');
 
62
insert into t1 values ('N'),('n');
 
63
insert into t1 values ('O'),('o');
 
64
insert into t1 values ('P'),('p');
 
65
insert into t1 values ('Q'),('q');
 
66
insert into t1 values ('R'),('r');
 
67
insert into t1 values ('S'),('s');
 
68
insert into t1 values ('T'),('t');
 
69
insert into t1 values ('U'),('u');
 
70
insert into t1 values ('V'),('v');
 
71
insert into t1 values ('W'),('w');
 
72
insert into t1 values ('X'),('x');
 
73
insert into t1 values ('Y'),('y');
 
74
insert into t1 values ('Z'),('z');
 
75
 
 
76
#
 
77
# Latin1 suppliment
 
78
#
 
79
insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0);
 
80
insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1);
 
81
insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2);
 
82
insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3);
 
83
insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4);
 
84
insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5);
 
85
insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6);
 
86
insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7);
 
87
insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8);
 
88
insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9);
 
89
insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca);
 
90
insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb);
 
91
insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc);
 
92
insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd);
 
93
insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce);
 
94
insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf);
 
95
 
 
96
insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0);
 
97
insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1);
 
98
insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2);
 
99
insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3);
 
100
insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4);
 
101
insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5);
 
102
insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6);
 
103
insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7);
 
104
insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8);
 
105
insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9);
 
106
insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da);
 
107
insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db);
 
108
insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc);
 
109
insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd);
 
110
insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de);
 
111
insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df);
 
112
 
 
113
#
 
114
# Latin extended-A, 0100-017F
 
115
#
 
116
insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103);
 
117
insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107);
 
118
insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b);
 
119
insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f);
 
120
insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113);
 
121
insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117);
 
122
insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b);
 
123
insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f);
 
124
insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123);
 
125
insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127);
 
126
insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b);
 
127
insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f);
 
128
insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133);
 
129
insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137);
 
130
insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b);
 
131
insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f);
 
132
insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143);
 
133
insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147);
 
134
insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b);
 
135
insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f);
 
136
insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153);
 
137
insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157);
 
138
insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b);
 
139
insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f);
 
140
insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163);
 
141
insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167);
 
142
insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b);
 
143
insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f);
 
144
insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173);
 
145
insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177);
 
146
insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b);
 
147
insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f);
 
148
 
 
149
#
 
150
# Latin extended-B, 0180-024F
 
151
#
 
152
insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183);
 
153
insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187);
 
154
insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b);
 
155
insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f);
 
156
insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193);
 
157
insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197);
 
158
insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b);
 
159
insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f);
 
160
insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3);
 
161
insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7);
 
162
insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab);
 
163
insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af);
 
164
insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3);
 
165
insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7);
 
166
insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb);
 
167
insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf);
 
168
insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3);
 
169
insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7);
 
170
insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb);
 
171
insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf);
 
172
insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3);
 
173
insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7);
 
174
insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db);
 
175
insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df);
 
176
insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3);
 
177
insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7);
 
178
insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb);
 
179
insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef);
 
180
insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3);
 
181
insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7);
 
182
insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb);
 
183
insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff);
 
184
 
 
185
 
 
186
insert into t1 values ('AA'),('Aa'),('aa'),('aA');
 
187
insert into t1 values ('CH'),('Ch'),('ch'),('cH');
 
188
insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
 
189
insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
 
190
insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
 
191
insert into t1 values ('LL'),('Ll'),('ll'),('lL');
 
192
insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
 
193
insert into t1 values ('OE'),('Oe'),('oe'),('oE');
 
194
insert into t1 values ('SS'),('Ss'),('ss'),('sS');
 
195
insert into t1 values ('RR'),('Rr'),('rr'),('rR');
 
196
 
 
197
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci;
 
198
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci;
 
199
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci;
 
200
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci;
 
201
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci;
 
202
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci;
 
203
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci;
 
204
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci;
 
205
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci;
 
206
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci;
 
207
 
 
208
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci;
 
209
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci;
 
210
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci;
 
211
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
 
212
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;
 
213
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci;
 
214
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_esperanto_ci;
 
215
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_hungarian_ci;
 
216
 
 
217
drop table t1;
 
218
 
 
219
#
 
220
# Bug#5324
 
221
#
 
222
SET NAMES utf8;
 
223
#test1
 
224
CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_general_ci, INDEX (c));
 
225
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8));
 
226
#Check one row
 
227
SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8)
 
228
COLLATE utf8_general_ci;
 
229
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8));
 
230
#Check two rows
 
231
SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8)
 
232
COLLATE utf8_general_ci ORDER BY c;
 
233
DROP TABLE t1;
 
234
#test2
 
235
CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE ucs2_unicode_ci, INDEX (c));
 
236
INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308);
 
237
#Check one row
 
238
SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 COLLATE ucs2_unicode_ci;
 
239
INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4);
 
240
#Check two rows
 
241
SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025
 
242
COLLATE ucs2_unicode_ci ORDER BY c;
 
243
DROP TABLE t1;
 
244
#test 3
 
245
CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_unicode_ci, INDEX (c));
 
246
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8));
 
247
#Check one row row
 
248
SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) COLLATE utf8_unicode_ci;
 
249
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8));
 
250
#Check two rows
 
251
SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8)
 
252
COLLATE utf8_unicode_ci ORDER BY c;
 
253
DROP TABLE t1;
 
254
 
 
255
CREATE TABLE t1 (
 
256
  col1 CHAR(32) CHARACTER SET utf8 NOT NULL
 
257
);
 
258
 
 
259
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410627 USING utf8));
 
260
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410628 USING utf8));
 
261
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410647 USING utf8));
 
262
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410648 USING utf8));
 
263
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A0651062F USING utf8));
 
264
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06330646 USING utf8));
 
265
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A USING utf8));
 
266
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06320627062F0647 USING utf8));
 
267
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062806310627064A USING utf8));
 
268
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706450647 USING utf8));
 
269
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634062C0648064A06270646064A USING utf8));
 
270
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90647 USING utf8));
 
271
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06270631064A062E USING utf8));
 
272
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706460642064406270628 USING utf8));
 
273
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0631062706460650 USING utf8));
 
274
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F064806270631062F USING utf8));
 
275
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280631062706480646200C06310627 USING utf8));
 
276
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E064806270646062F0647 USING utf8));
 
277
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648 USING utf8));
 
278
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A062D062A USING utf8));
 
279
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0623062B064A0631 USING utf8));
 
280
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646 USING utf8));
 
281
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0642063106270631 USING utf8));
 
282
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310641062A0647 USING utf8));
 
283
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270646062F USING utf8));
 
284
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062E0635064A0651062A064A USING utf8));
 
285
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062706310632 USING utf8));
 
286
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270633062A USING utf8));
 
287
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906A90633 USING utf8));
 
288
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648060C USING utf8));
 
289
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0631 USING utf8));
 
290
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0648062F USING utf8));
 
291
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0633062A USING utf8));
 
292
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648067E0646062C USING utf8));
 
293
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330627064406AF064A060C USING utf8));
 
294
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306270644 USING utf8));
 
295
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606450627064A0646062F0647 USING utf8));
 
296
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06280631064A0632 USING utf8));
 
297
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062C06440633 USING utf8));
 
298
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F060C USING utf8));
 
299
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0646 USING utf8));
 
300
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06350641062D0627062A USING utf8));
 
301
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0646 USING utf8));
 
302
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9062A06270628 USING utf8));
 
303
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280647 USING utf8));
 
304
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x068606340645 USING utf8));
 
305
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A USING utf8));
 
306
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E06480631062F USING utf8));
 
307
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0686064706310647 USING utf8));
 
308
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A USING utf8));
 
309
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06420648064A USING utf8));
 
310
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450635064506510645 USING utf8));
 
311
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310627 USING utf8));
 
312
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646063406270646 USING utf8));
 
313
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A200C062F0647062F060C USING utf8));
 
314
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647063106860646062F USING utf8));
 
315
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06390645064400BB USING utf8));
 
316
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064806340634 USING utf8));
 
317
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628 USING utf8));
 
318
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706500646064A064606AF USING utf8));
 
319
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062D063306270646 USING utf8));
 
320
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A062706310634062706370631 USING utf8));
 
321
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06340631 USING utf8));
 
322
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F0647 USING utf8));
 
323
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0633062A USING utf8));
 
324
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064806270646 USING utf8));
 
325
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506270646 USING utf8));
 
326
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064806510644 USING utf8));
 
327
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0634062E064A0635 USING utf8));
 
328
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0627062F USING utf8));
 
329
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627 USING utf8));
 
330
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106270648062A USING utf8));
 
331
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06270644062A USING utf8));
 
332
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106A906510631 USING utf8));
 
333
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063A064406280647 USING utf8));
 
334
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270631062F USING utf8));
 
335
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9064A USING utf8));
 
336
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270632 USING utf8));
 
337
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106470628063106270646 USING utf8));
 
338
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606470636062A USING utf8));
 
339
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506340631064806370647 USING utf8));
 
340
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646 USING utf8));
 
341
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646064A0632 USING utf8));
 
342
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9 USING utf8));
 
343
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062D064206510642 USING utf8));
 
344
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0637063106270632 USING utf8));
 
345
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064106310647064606AF USING utf8));
 
346
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0645062F06510646 USING utf8));
 
347
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646064A USING utf8));
 
348
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F USING utf8));
 
349
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627063106470627064A USING utf8));
 
350
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648 USING utf8));
 
351
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639063106350647 USING utf8));
 
352
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064506480631 USING utf8));
 
353
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A06270633064A USING utf8));
 
354
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646060C USING utf8));
 
355
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D064806320647 USING utf8));
 
356
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645 USING utf8));
 
357
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634 USING utf8));
 
358
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450642062706440627062A USING utf8));
 
359
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064A06AF0631 USING utf8));
 
360
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A06980647 USING utf8));
 
361
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646062706450647 USING utf8));
 
362
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506480631062F USING utf8));
 
363
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062D062B USING utf8));
 
364
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628063106310633064A USING utf8));
 
365
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606480634062A0647 USING utf8));
 
366
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646 USING utf8));
 
367
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064606470627 USING utf8));
 
368
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622064606860647 USING utf8));
 
369
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806310647 USING utf8));
 
370
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064206270645062A USING utf8));
 
371
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F062706320645 USING utf8));
 
372
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0698062706460648064A0647 USING utf8));
 
373
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A USING utf8));
 
374
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06390648062A0650 USING utf8));
 
375
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306500631 USING utf8));
 
376
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0646064A0633064F0646 USING utf8));
 
377
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106270633 USING utf8));
 
378
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064A0626062A USING utf8));
 
379
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639064406480645200C063406310642064A USING utf8));
 
380
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280639062F0627064B USING utf8));
 
381
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062F063106330647 USING utf8));
 
382
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206410631064A06420627064A064A USING utf8));
 
383
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270646063406AF06270647 USING utf8));
 
384
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06440646062F0646 USING utf8));
 
385
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E064A06480633062A USING utf8));
 
386
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064606AF06270645064A USING utf8));
 
387
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0633 USING utf8));
 
388
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622063A06270632 USING utf8));
 
389
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064606AF USING utf8));
 
390
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064706270646 USING utf8));
 
391
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806510645 USING utf8));
 
392
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063406470631 USING utf8));
 
393
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064506280631064A062C USING utf8));
 
394
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06420644 USING utf8));
 
395
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90631062F0646062F USING utf8));
 
396
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645 USING utf8));
 
397
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310641062A USING utf8));
 
398
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646062C0627 USING utf8));
 
399
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506270646062F USING utf8));
 
400
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0627 USING utf8));
 
401
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706A9062A06280631 USING utf8));
 
402
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606380631 USING utf8));
 
403
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480644062A USING utf8));
 
404
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480628062706310647 USING utf8));
 
405
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606330628062A USING utf8));
 
406
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645063306270639062F USING utf8));
 
407
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F USING utf8));
 
408
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480632064A0631 USING utf8));
 
409
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062E062A06270631 USING utf8));
 
410
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330641064A0631 USING utf8));
 
411
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064606AF0644064A0633 USING utf8));
 
412
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A200C06320627062F0647 USING utf8));
 
413
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627063206AF0634062A USING utf8));
 
414
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506330631 USING utf8));
 
415
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220644064506270646064A USING utf8));
 
416
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270634 USING utf8));
 
417
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220645062F0647 USING utf8));
 
418
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A906270631064A USING utf8));
 
419
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F0627062E062A0647 USING utf8));
 
420
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645064A USING utf8));
 
421
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F0628064A USING utf8));
 
422
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0651 USING utf8));
 
423
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606280648062F060C USING utf8));
 
424
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480644064A USING utf8));
 
425
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906480636060C USING utf8));
 
426
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06340627064A062F USING utf8));
 
427
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506470645 USING utf8));
 
428
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0631 USING utf8));
 
429
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646060C USING utf8));
 
430
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645063306310634 USING utf8));
 
431
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064606480646 USING utf8));
 
432
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E0627064606480627062F06AF064A USING utf8));
 
433
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310645064A USING utf8));
 
434
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062C0648062F USING utf8));
 
435
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206480631062F USING utf8));
 
436
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0648 USING utf8));
 
437
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064506440627064B USING utf8));
 
438
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9062F064A06AF0631 USING utf8));
 
439
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF USING utf8));
 
440
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064406280633062A0647 USING utf8));
 
441
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F0646062F USING utf8));
 
442
INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450647064506270646 USING utf8));
 
443
SELECT HEX(CONVERT(col1 USING ucs2)) FROM t1 ORDER BY col1 COLLATE utf8_persian_ci, col1 COLLATE utf8_bin;
 
444
DROP TABLE t1;
 
445
 
 
446
SET @test_character_set= 'utf8';
 
447
SET @test_collation= 'utf8_swedish_ci';
 
448
-- source include/ctype_common.inc
 
449
 
 
450
#
 
451
# Bug 7111 server crashes when regexp is used
 
452
#
 
453
create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci;
 
454
insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c');
 
455
select a, a regexp '[a]' from t1 order by binary a;
 
456
drop table t1;
 
457
 
 
458
SET collation_connection='utf8_unicode_ci';
 
459
-- source include/ctype_filesort.inc
 
460
-- source include/ctype_like_escape.inc
 
461
-- source include/ctype_german.inc
 
462
 
 
463
# End of 4.1 tests
 
464
 
 
465
#
 
466
# Check UPPER/LOWER changeing length
 
467
#
 
468
# Result shorter than argument
 
469
CREATE TABLE t1 (id int, a varchar(30) character set utf8);
 
470
INSERT INTO t1 VALUES (1, _ucs2 0x01310069), (2, _ucs2 0x01310131);
 
471
INSERT INTO t1 VALUES (3, _ucs2 0x00690069), (4, _ucs2 0x01300049);
 
472
INSERT INTO t1 VALUES (5, _ucs2 0x01300130), (6, _ucs2 0x00490049);
 
473
SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
 
474
FROM t1 ORDER BY id;
 
475
ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf8 collate utf8_turkish_ci;
 
476
SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
 
477
FROM t1 ORDER BY id;
 
478
DROP TABLE t1;
 
479
 
 
480
#
 
481
# Bug #27079 Crash while grouping empty ucs2 strings
 
482
#
 
483
CREATE TABLE t1 (
 
484
 c1 text character set ucs2 collate ucs2_polish_ci NOT NULL
 
485
) ENGINE=MyISAM;
 
486
insert into t1 values (''),('a');
 
487
SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
 
488
DROP TABLE IF EXISTS t1;
 
489
 
 
490
#
 
491
# Bug#27345 Incorrect data returned when range-read from utf8_danish_ci indexes
 
492
#
 
493
set names utf8;
 
494
create table t1 (
 
495
  a varchar(255),
 
496
  key a(a)
 
497
) character set utf8 collate utf8_danish_ci;
 
498
insert into t1 values ('åaaaa'),('ååaaa'),('aaaaa');
 
499
select a as like_a from t1 where a like 'a%';
 
500
select a as like_aa from t1 where a like 'aa%';
 
501
select a as like_aaa from t1 where a like 'aaa%';
 
502
select a as like_aaaa from t1 where a like 'aaaa%';
 
503
select a as like_aaaaa from t1 where a like 'aaaaa%';
 
504
alter table t1 convert to character set ucs2 collate ucs2_danish_ci;
 
505
select a as like_a from t1 where a like 'a%';
 
506
select a as like_aa from t1 where a like 'aa%';
 
507
select a as like_aaa from t1 where a like 'aaa%';
 
508
select a as like_aaaa from t1 where a like 'aaaa%';
 
509
select a as like_aaaaa from t1 where a like 'aaaaa%';
 
510
drop table t1;
 
511
 
 
512
create table t1 (
 
513
  a varchar(255),
 
514
  key(a)
 
515
) character set utf8 collate utf8_spanish2_ci;
 
516
insert into t1 values ('aaaaa'),('lllll'),('zzzzz');
 
517
select a as like_l from t1 where a like 'l%';
 
518
select a as like_ll from t1 where a like 'll%';
 
519
select a as like_lll from t1 where a like 'lll%';
 
520
select a as like_llll from t1 where a like 'llll%';
 
521
select a as like_lllll from t1 where a like 'lllll%';
 
522
alter table t1 convert to character set ucs2 collate ucs2_spanish2_ci;
 
523
select a as like_l from t1 where a like 'l%';
 
524
select a as like_ll from t1 where a like 'll%';
 
525
select a as like_lll from t1 where a like 'lll%';
 
526
select a as like_llll from t1 where a like 'llll%';
 
527
select a as like_lllll from t1 where a like 'lllll%';
 
528
drop table t1;
 
529
 
 
530
create table t1 (
 
531
  a varchar(255),
 
532
  key a(a)
 
533
) character set utf8 collate utf8_czech_ci;
 
534
# In Czech 'ch' is a single letter between 'h' and 'i'
 
535
insert into t1 values
 
536
('b'),('c'),('d'),('e'),('f'),('g'),('h'),('ch'),('i'),('j');
 
537
select * from t1 where a like 'c%';
 
538
alter table t1 convert to character set ucs2 collate ucs2_czech_ci;
 
539
select * from t1 where a like 'c%';
 
540
drop table t1;
 
541
 
 
542
set collation_connection=ucs2_unicode_ci;
 
543
-- source include/ctype_regex.inc
 
544
-- source include/ctype_like_range_f1f2.inc
 
545
set names utf8;
 
546
 
 
547
-- echo End for 5.0 tests