2
# Test latin_de character set
6
set @@collation_connection=latin1_german2_ci;
8
select @@collation_connection;
11
drop table if exists t1;
14
create table t1 (a char (20) not null, b int not null auto_increment, index (a,b));
15
insert into t1 (a) values ('�'),('ac'),('ae'),('ad'),('�c'),('aeb');
16
insert into t1 (a) values ('�c'),('uc'),('ue'),('ud'),('�'),('ueb'),('uf');
17
insert into t1 (a) values ('�'),('oc'),('�a'),('oe'),('od'),('�c'),('oeb');
18
insert into t1 (a) values ('s'),('ss'),('�'),('�b'),('ssa'),('ssc'),('�a');
19
insert into t1 (a) values ('e�'),('u�'),('�o'),('��'),('��a'),('aeae');
20
insert into t1 (a) values ('q'),('a'),('u'),('o'),('�'),('�'),('a');
21
select a,b from t1 order by a,b;
22
select a,b from t1 order by upper(a),b;
23
select a from t1 order by a desc;
25
select * from t1 where a like "�%";
26
select * from t1 where a like binary "%�%";
27
select * from t1 where a like "%�%";
28
select * from t1 where a like "%U%";
29
select * from t1 where a like "%ss%";
32
# The following should all be true
33
select strcmp('�','ae'),strcmp('ae','�'),strcmp('aeq','�q'),strcmp('�q','aeq');
34
select strcmp('ss','�'),strcmp('�','ss'),strcmp('�s','sss'),strcmp('�q','ssq');
36
# The following should all return -1
37
select strcmp('�','af'),strcmp('a','�'),strcmp('��','aeq'),strcmp('��','aeaeq');
38
select strcmp('ss','�a'),strcmp('�','ssa'),strcmp('s�a','sssb'),strcmp('s','�');
39
select strcmp('�','o�'),strcmp('�','u�'),strcmp('�','oeb');
41
# The following should all return 1
42
select strcmp('af','�'),strcmp('�','a'),strcmp('aeq','��'),strcmp('aeaeq','��');
43
select strcmp('�a','ss'),strcmp('ssa','�'),strcmp('sssb','s�a'),strcmp('�','s');
44
select strcmp('u','�a'),strcmp('u','�');
49
select strcmp('s�', '�a'), strcmp('a�', '�x');
51
# Some other simple tests with the current character set
54
create table t1 (a varchar(10), key(a), fulltext (a));
55
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
56
select * from t1 where a like "abc%";
57
select * from t1 where a like "test%";
58
select * from t1 where a like "te_t";
59
select * from t1 where match a against ("te*" in boolean mode)+0;
63
# Test bug report #152 (problem with index on latin1_de)
67
# The below checks both binary and character comparisons.
69
create table t1 (word varchar(255) not null, word2 varchar(255) not null default '', index(word));
71
insert into t1 (word) values ('ss'),(0xDF),(0xE4),('ae');
72
update t1 set word2=word;
73
select word, word=binary 0xdf as t from t1 having t > 0;
74
select word, word=cast(0xdf AS CHAR) as t from t1 having t > 0;
75
select * from t1 where word=binary 0xDF;
76
select * from t1 where word=CAST(0xDF as CHAR);
77
select * from t1 where word2=binary 0xDF;
78
select * from t1 where word2=CAST(0xDF as CHAR);
79
select * from t1 where word='ae';
80
select * from t1 where word= 0xe4 or word=CAST(0xe4 as CHAR);
81
select * from t1 where word between binary 0xDF and binary 0xDF;
82
select * from t1 where word between CAST(0xDF AS CHAR) and CAST(0xDF AS CHAR);
83
select * from t1 where word like 'ae';
84
select * from t1 where word like 'AE';
85
select * from t1 where word like binary 0xDF;
86
select * from t1 where word like CAST(0xDF as CHAR);
90
# Bug #5447 Select does not find records
93
autor varchar(80) NOT NULL default '',
96
INSERT INTO t1 VALUES ('Powell, B.'),('Powell, Bud.'),('Powell, L. H.'),('Power, H.'),
97
('Poynter, M. A. L. Lane'),('Poynting, J. H. und J. J. Thomson.'),('Pozzi, S(amuel-Jean).'),
98
('Pozzi, Samuel-Jean.'),('Pozzo, A.'),('Pozzoli, Serge.');
99
SELECT * FROM t1 WHERE autor LIKE 'Poz%' ORDER BY autor;
103
# Test of special character in german collation
107
s1 CHAR(5) CHARACTER SET latin1 COLLATE latin1_german2_ci
109
show create table t1;
110
INSERT INTO t1 VALUES ('�');
111
INSERT INTO t1 VALUES ('ue');
112
SELECT DISTINCT s1 FROM t1;
113
SELECT s1,COUNT(*) FROM t1 GROUP BY s1;
114
SELECT COUNT(DISTINCT s1) FROM t1;
115
SELECT FIELD('ue',s1), FIELD('�',s1), s1='ue', s1='�' FROM t1;
118
-- source include/ctype_filesort.inc
119
-- source include/ctype_german.inc
122
# Bug#7878 with utf8_general_ci, equals (=) has problem with
123
# accent insensitivity.
124
# Although originally this problem was found with UTF8 character set,
125
# '=' behaved wrong for latin1_german2_ci as well.
126
# Let's check it does not work incorrect anymore.
130
col1 varchar(255) NOT NULL default ''
131
) ENGINE=MyISAM DEFAULT CHARSET=latin1 collate latin1_german2_ci;
132
INSERT INTO t1 VALUES ('�'),('ss'),('ss');
133
ALTER TABLE t1 ADD KEY ifword(col1);
134
SELECT * FROM t1 WHERE col1='�' ORDER BY col1, BINARY col1;
142
create table t1 (s1 char(5) character set latin1 collate latin1_german2_ci);
143
insert into t1 values (0xf6) /* this is o-umlaut */;
144
select * from t1 where length(s1)=1 and s1='oe';