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

« back to all changes in this revision

Viewing changes to mysql-test/r/ctype_cp1250_ch.result

  • 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
drop table if exists t1;
 
2
DROP TABLE IF EXISTS t1;
 
3
SHOW COLLATION LIKE 'cp1250_czech_cs';
 
4
Collation       Charset Id      Default Compiled        Sortlen
 
5
cp1250_czech_cs cp1250  34              Yes     2
 
6
SET @test_character_set= 'cp1250';
 
7
SET @test_collation= 'cp1250_general_ci';
 
8
SET @safe_character_set_server= @@character_set_server;
 
9
SET @safe_collation_server= @@collation_server;
 
10
SET @safe_character_set_client= @@character_set_client;
 
11
SET @safe_character_set_results= @@character_set_results;
 
12
SET character_set_server= @test_character_set;
 
13
SET collation_server= @test_collation;
 
14
CREATE DATABASE d1;
 
15
USE d1;
 
16
CREATE TABLE t1 (c CHAR(10), KEY(c));
 
17
SHOW FULL COLUMNS FROM t1;
 
18
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
 
19
c       char(10)        cp1250_general_ci       YES     MUL     NULL                    
 
20
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
 
21
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
 
22
want3results
 
23
aaa
 
24
aaaa
 
25
aaaaa
 
26
DROP TABLE t1;
 
27
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
 
28
SHOW FULL COLUMNS FROM t1;
 
29
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
 
30
c1      varchar(15)     cp1250_general_ci       YES     MUL     NULL                    
 
31
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
 
32
SELECT c1 as want3results from t1 where c1 like 'l%';
 
33
want3results
 
34
location
 
35
loberge
 
36
lotre
 
37
SELECT c1 as want3results from t1 where c1 like 'lo%';
 
38
want3results
 
39
location
 
40
loberge
 
41
lotre
 
42
SELECT c1 as want1result  from t1 where c1 like 'loc%';
 
43
want1result
 
44
location
 
45
SELECT c1 as want1result  from t1 where c1 like 'loca%';
 
46
want1result
 
47
location
 
48
SELECT c1 as want1result  from t1 where c1 like 'locat%';
 
49
want1result
 
50
location
 
51
SELECT c1 as want1result  from t1 where c1 like 'locati%';
 
52
want1result
 
53
location
 
54
SELECT c1 as want1result  from t1 where c1 like 'locatio%';
 
55
want1result
 
56
location
 
57
SELECT c1 as want1result  from t1 where c1 like 'location%';
 
58
want1result
 
59
location
 
60
DROP TABLE t1;
 
61
create table t1 (a set('a') not null);
 
62
insert into t1 values (),();
 
63
Warnings:
 
64
Warning 1364    Field 'a' doesn't have a default value
 
65
select cast(a as char(1)) from t1;
 
66
cast(a as char(1))
 
67
 
 
68
 
 
69
select a sounds like a from t1;
 
70
a sounds like a
 
71
1
 
72
1
 
73
select 1 from t1 order by cast(a as char(1));
 
74
1
 
75
1
 
76
1
 
77
drop table t1;
 
78
set names utf8;
 
79
create table t1 (
 
80
name varchar(10),
 
81
level smallint unsigned);
 
82
show create table t1;
 
83
Table   Create Table
 
84
t1      CREATE TABLE `t1` (
 
85
  `name` varchar(10) DEFAULT NULL,
 
86
  `level` smallint(5) unsigned DEFAULT NULL
 
87
) ENGINE=MyISAM DEFAULT CHARSET=cp1250
 
88
insert into t1 values ('string',1);
 
89
select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
 
90
concat(name,space(level))       concat(name, repeat(' ',level))
 
91
string  string 
 
92
drop table t1;
 
93
DROP DATABASE d1;
 
94
USE test;
 
95
SET character_set_server= @safe_character_set_server;
 
96
SET collation_server= @safe_collation_server;
 
97
SET character_set_client= @safe_character_set_client;
 
98
SET character_set_results= @safe_character_set_results;
 
99
SET @test_character_set= 'cp1250';
 
100
SET @test_collation= 'cp1250_czech_cs';
 
101
SET @safe_character_set_server= @@character_set_server;
 
102
SET @safe_collation_server= @@collation_server;
 
103
SET @safe_character_set_client= @@character_set_client;
 
104
SET @safe_character_set_results= @@character_set_results;
 
105
SET character_set_server= @test_character_set;
 
106
SET collation_server= @test_collation;
 
107
CREATE DATABASE d1;
 
108
USE d1;
 
109
CREATE TABLE t1 (c CHAR(10), KEY(c));
 
110
SHOW FULL COLUMNS FROM t1;
 
111
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
 
112
c       char(10)        cp1250_czech_cs YES     MUL     NULL                    
 
113
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
 
114
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
 
115
want3results
 
116
aaa
 
117
aaaa
 
118
aaaaa
 
119
DROP TABLE t1;
 
120
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
 
121
SHOW FULL COLUMNS FROM t1;
 
122
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
 
123
c1      varchar(15)     cp1250_czech_cs YES     MUL     NULL                    
 
124
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
 
125
SELECT c1 as want3results from t1 where c1 like 'l%';
 
126
want3results
 
127
location
 
128
loberge
 
129
lotre
 
130
SELECT c1 as want3results from t1 where c1 like 'lo%';
 
131
want3results
 
132
location
 
133
loberge
 
134
lotre
 
135
SELECT c1 as want1result  from t1 where c1 like 'loc%';
 
136
want1result
 
137
location
 
138
SELECT c1 as want1result  from t1 where c1 like 'loca%';
 
139
want1result
 
140
location
 
141
SELECT c1 as want1result  from t1 where c1 like 'locat%';
 
142
want1result
 
143
location
 
144
SELECT c1 as want1result  from t1 where c1 like 'locati%';
 
145
want1result
 
146
location
 
147
SELECT c1 as want1result  from t1 where c1 like 'locatio%';
 
148
want1result
 
149
location
 
150
SELECT c1 as want1result  from t1 where c1 like 'location%';
 
151
want1result
 
152
location
 
153
DROP TABLE t1;
 
154
create table t1 (a set('a') not null);
 
155
insert into t1 values (),();
 
156
Warnings:
 
157
Warning 1364    Field 'a' doesn't have a default value
 
158
select cast(a as char(1)) from t1;
 
159
cast(a as char(1))
 
160
 
 
161
 
 
162
select a sounds like a from t1;
 
163
a sounds like a
 
164
1
 
165
1
 
166
select 1 from t1 order by cast(a as char(1));
 
167
1
 
168
1
 
169
1
 
170
drop table t1;
 
171
set names utf8;
 
172
create table t1 (
 
173
name varchar(10),
 
174
level smallint unsigned);
 
175
show create table t1;
 
176
Table   Create Table
 
177
t1      CREATE TABLE `t1` (
 
178
  `name` varchar(10) COLLATE cp1250_czech_cs DEFAULT NULL,
 
179
  `level` smallint(5) unsigned DEFAULT NULL
 
180
) ENGINE=MyISAM DEFAULT CHARSET=cp1250 COLLATE=cp1250_czech_cs
 
181
insert into t1 values ('string',1);
 
182
select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
 
183
concat(name,space(level))       concat(name, repeat(' ',level))
 
184
string  string 
 
185
drop table t1;
 
186
DROP DATABASE d1;
 
187
USE test;
 
188
SET character_set_server= @safe_character_set_server;
 
189
SET collation_server= @safe_collation_server;
 
190
SET character_set_client= @safe_character_set_client;
 
191
SET character_set_results= @safe_character_set_results;
 
192
CREATE TABLE t1 (a char(16)) character set cp1250 collate cp1250_czech_cs;
 
193
INSERT INTO t1 VALUES ('');
 
194
SELECT a, length(a), a='', a=' ', a='  ' FROM t1;
 
195
a       length(a)       a=''    a=' '   a='  '
 
196
        0       1       1       1
 
197
DROP TABLE t1;
 
198
CREATE TABLE t1 (
 
199
popisek varchar(30) collate cp1250_general_ci NOT NULL default '',
 
200
PRIMARY KEY  (`popisek`)
 
201
);
 
202
INSERT INTO t1 VALUES ('2005-01-1');
 
203
SELECT * FROM t1 WHERE popisek = '2005-01-1';
 
204
popisek
 
205
2005-01-1
 
206
SELECT * FROM t1 WHERE popisek LIKE '2005-01-1';
 
207
popisek
 
208
2005-01-1
 
209
drop table t1;
 
210
set names cp1250;
 
211
CREATE TABLE t1
 
212
(
 
213
id  INT AUTO_INCREMENT PRIMARY KEY,
 
214
str VARCHAR(32)  CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL default '',
 
215
UNIQUE KEY (str)
 
216
);
 
217
INSERT INTO t1 VALUES (NULL, 'a');
 
218
INSERT INTO t1 VALUES (NULL, 'aa');
 
219
INSERT INTO t1 VALUES (NULL, 'aaa');
 
220
INSERT INTO t1 VALUES (NULL, 'aaaa');
 
221
INSERT INTO t1 VALUES (NULL, 'aaaaa');
 
222
INSERT INTO t1 VALUES (NULL, 'aaaaaa');
 
223
INSERT INTO t1 VALUES (NULL, 'aaaaaaa');
 
224
select * from t1 where str like 'aa%';
 
225
id      str
 
226
2       aa
 
227
3       aaa
 
228
4       aaaa
 
229
5       aaaaa
 
230
6       aaaaaa
 
231
7       aaaaaaa
 
232
drop table t1;
 
233
set names cp1250;
 
234
create table t1 (a varchar(15) collate cp1250_czech_cs NOT NULL, primary key(a));
 
235
insert into t1 values("abcdefgh�");
 
236
insert into t1 values("����");
 
237
select a from t1 where a like "abcdefgh�";
 
238
a
 
239
abcdefgh�
 
240
drop table t1;