2 set @@collation_connection=latin1_german2_ci;
3 select @@collation_connection;
6 drop table if exists t1;
7 create table t1 (a char (20) not null, b int not null auto_increment, index (a,b));
8 insert into t1 (a) values ('ä'),('ac'),('ae'),('ad'),('Äc'),('aeb');
9 insert into t1 (a) values ('üc'),('uc'),('ue'),('ud'),('Ü'),('ueb'),('uf');
10 insert into t1 (a) values ('ö'),('oc'),('Öa'),('oe'),('od'),('Öc'),('oeb');
11 insert into t1 (a) values ('s'),('ss'),('ß'),('ßb'),('ssa'),('ssc'),('ßa');
12 insert into t1 (a) values ('eä'),('uü'),('öo'),('ää'),('ääa'),('aeae');
13 insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'),('a');
14 select a,b from t1 order by a,b;
56 select a,b from t1 order by upper(a),b;
98 select a from t1 order by a desc;
141 Table Op Msg_type Msg_text
142 test.t1 check status OK
143 select * from t1 where a like "ö%";
149 select * from t1 where a like binary "%É%";
152 select * from t1 where a like "%Á%";
165 select * from t1 where a like "%U%";
174 select * from t1 where a like "%ss%";
180 select strcmp('ä','ae'),strcmp('ae','ä'),strcmp('aeq','äq'),strcmp('äq','aeq');
181 strcmp('ä','ae') strcmp('ae','ä') strcmp('aeq','äq') strcmp('äq','aeq')
183 select strcmp('ss','ß'),strcmp('ß','ss'),strcmp('ßs','sss'),strcmp('ßq','ssq');
184 strcmp('ss','ß') strcmp('ß','ss') strcmp('ßs','sss') strcmp('ßq','ssq')
186 select strcmp('ä','af'),strcmp('a','ä'),strcmp('ää','aeq'),strcmp('ää','aeaeq');
187 strcmp('ä','af') strcmp('a','ä') strcmp('ää','aeq') strcmp('ää','aeaeq')
189 select strcmp('ss','ßa'),strcmp('ß','ssa'),strcmp('sßa','sssb'),strcmp('s','ß');
190 strcmp('ss','ßa') strcmp('ß','ssa') strcmp('sßa','sssb') strcmp('s','ß')
192 select strcmp('ö','oö'),strcmp('Ü','uü'),strcmp('ö','oeb');
193 strcmp('ö','oö') strcmp('Ü','uü') strcmp('ö','oeb')
195 select strcmp('af','ä'),strcmp('ä','a'),strcmp('aeq','ää'),strcmp('aeaeq','ää');
196 strcmp('af','ä') strcmp('ä','a') strcmp('aeq','ää') strcmp('aeaeq','ää')
198 select strcmp('ßa','ss'),strcmp('ssa','ß'),strcmp('sssb','sßa'),strcmp('ß','s');
199 strcmp('ßa','ss') strcmp('ssa','ß') strcmp('sssb','sßa') strcmp('ß','s')
201 select strcmp('u','öa'),strcmp('u','ö');
202 strcmp('u','öa') strcmp('u','ö')
204 select strcmp('sä', 'ßa'), strcmp('aä', 'äx');
205 strcmp('sä', 'ßa') strcmp('aä', 'äx')
207 create table t1 (a varchar(10), key(a), fulltext (a));
208 insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
209 select * from t1 where a like "abc%";
213 select * from t1 where a like "test%";
216 select * from t1 where a like "te_t";
219 select * from t1 where match a against ("te*" in boolean mode)+0;
223 create table t1 (word varchar(255) not null, word2 varchar(255) not null default '', index(word));
224 show create table t1;
226 t1 CREATE TABLE `t1` (
227 `word` varchar(255) COLLATE latin1_german2_ci NOT NULL,
228 `word2` varchar(255) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
230 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
231 insert into t1 (word) values ('ss'),(0xDF),(0xE4),('ae');
232 update t1 set word2=word;
233 select word, word=binary 0xdf as t from t1 having t > 0;
236 select word, word=cast(0xdf AS CHAR) as t from t1 having t > 0;
240 select * from t1 where word=binary 0xDF;
243 select * from t1 where word=CAST(0xDF as CHAR);
247 select * from t1 where word2=binary 0xDF;
250 select * from t1 where word2=CAST(0xDF as CHAR);
254 select * from t1 where word='ae';
258 select * from t1 where word= 0xe4 or word=CAST(0xe4 as CHAR);
262 select * from t1 where word between binary 0xDF and binary 0xDF;
265 select * from t1 where word between CAST(0xDF AS CHAR) and CAST(0xDF AS CHAR);
269 select * from t1 where word like 'ae';
272 select * from t1 where word like 'AE';
275 select * from t1 where word like binary 0xDF;
278 select * from t1 where word like CAST(0xDF as CHAR);
283 autor varchar(80) NOT NULL default '',
286 INSERT INTO t1 VALUES ('Powell, B.'),('Powell, Bud.'),('Powell, L. H.'),('Power, H.'),
287 ('Poynter, M. A. L. Lane'),('Poynting, J. H. und J. J. Thomson.'),('Pozzi, S(amuel-Jean).'),
288 ('Pozzi, Samuel-Jean.'),('Pozzo, A.'),('Pozzoli, Serge.');
289 SELECT * FROM t1 WHERE autor LIKE 'Poz%' ORDER BY autor;
291 Pozzi, S(amuel-Jean).
297 s1 CHAR(5) CHARACTER SET latin1 COLLATE latin1_german2_ci
299 show create table t1;
301 t1 CREATE TABLE `t1` (
302 `s1` char(5) COLLATE latin1_german2_ci DEFAULT NULL
303 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
304 INSERT INTO t1 VALUES ('Ü');
305 INSERT INTO t1 VALUES ('ue');
306 SELECT DISTINCT s1 FROM t1;
309 SELECT s1,COUNT(*) FROM t1 GROUP BY s1;
312 SELECT COUNT(DISTINCT s1) FROM t1;
315 SELECT FIELD('ue',s1), FIELD('Ü',s1), s1='ue', s1='Ü' FROM t1;
316 FIELD('ue',s1) FIELD('Ü',s1) s1='ue' s1='Ü'
320 create table t1 select repeat('a',4000) a;
322 insert into t1 values ('a'), ('a '), ('a\t');
323 select collation(a),hex(a) from t1 order by a;
325 latin1_german2_ci 6109
327 latin1_german2_ci 6120
329 drop table if exists t1;
330 create table t1 as select repeat(' ', 64) as s1;
331 select collation(s1) from t1;
335 insert into t1 values ('a'),('ae'),(_latin1 0xE4);
336 insert into t1 values ('o'),('oe'),(_latin1 0xF6);
337 insert into t1 values ('s'),('ss'),(_latin1 0xDF);
338 insert into t1 values ('u'),('ue'),(_latin1 0xFC);
339 select s1, hex(s1) from t1 order by s1, binary s1;
353 select group_concat(s1 order by binary s1) from t1 group by s1;
354 group_concat(s1 order by binary s1)
366 col1 varchar(255) NOT NULL default ''
367 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 collate latin1_german2_ci;
368 INSERT INTO t1 VALUES ('ß'),('ss'),('ss');
369 ALTER TABLE t1 ADD KEY ifword(col1);
370 SELECT * FROM t1 WHERE col1='ß' ORDER BY col1, BINARY col1;
376 create table t1 (s1 char(5) character set latin1 collate latin1_german2_ci);
377 insert into t1 values (0xf6) /* this is o-umlaut */;
378 select * from t1 where length(s1)=1 and s1='oe';