1--echo "BEGIN ctype_german.inc"
2#
3# Bug #27877 incorrect german order in utf8_general_ci
4#
5# Testing if "SHARP S" is equal to "S",
6# like in latin1_german1_ci, utf8_general_ci, ucs2_general_ci
7# Or if "SHART S" is equal to "SS",
8# like in latin1_german2_ci, utf8_unicode_ci, ucs2_unicode_ci
9#
10# Also testing A-uml, O-uml, U-uml
11#
12
13--disable_warnings
14drop table if exists t1;
15--enable_warnings
16
17#
18# Create a table with a varchar(x) column,
19# using current values of
20# @@character_set_connection and  @@collation_connection.
21#
22
23create table t1 as select repeat(' ', 64) as s1;
24select collation(s1) from t1;
25delete from t1;
26
27#
28# Populate data
29#
30
31INSERT INTO t1 VALUES ('ud'),('uf');
32INSERT INTO t1 VALUES ('od'),('of');
33INSERT INTO t1 VALUES ('e');
34INSERT INTO t1 VALUES ('ad'),('af');
35
36insert into t1 values ('a'),('ae'),(_latin1 0xE4);
37insert into t1 values ('o'),('oe'),(_latin1 0xF6);
38insert into t1 values ('s'),('ss'),(_latin1 0xDF);
39insert into t1 values ('u'),('ue'),(_latin1 0xFC);
40
41# LIGATURE AE
42INSERT INTO t1 VALUES (_latin1 0xE6), (_latin1 0xC6);
43# LIGATURE OE
44INSERT INTO t1 VALUES (_latin1 0x9C), (_latin1 0x8C);
45
46#
47# Check order
48#
49select s1, hex(s1) from t1 order by s1, binary s1;
50select group_concat(s1 order by binary s1) from t1 group by s1;
51
52SELECT s1, hex(s1), hex(weight_string(s1)) FROM t1 ORDER BY s1, BINARY(s1);
53SELECT s1, hex(s1) FROM t1 WHERE s1='ae' ORDER BY s1, BINARY(s1);
54
55drop table t1;
56
57
58#
59# Check filesort for 'S' and "U+00DF SHARP S",
60# for field and for item.
61#
62CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
63SHOW CREATE TABLE t1;
64INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
65SELECT * FROM t1 ORDER BY a, b;
66SELECT * FROM t1 ORDER BY a DESC, b;
67SELECT * FROM t1 ORDER BY CONCAT(a), b;
68SELECT * FROM t1 ORDER BY CONCAT(a) DESC, b;
69DROP TABLE t1;
70
71--echo "END ctype_german.inc"
72