~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

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

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

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;
 
241
set names cp1250 collate cp1250_czech_cs;
 
242
SELECT strcmp('a','a ');
 
243
strcmp('a','a ')
 
244
0
 
245
SELECT strcmp('a\0','a' );
 
246
strcmp('a\0','a' )
 
247
-1
 
248
SELECT strcmp('a\0','a ');
 
249
strcmp('a\0','a ')
 
250
-1
 
251
SELECT strcmp('a\t','a' );
 
252
strcmp('a\t','a' )
 
253
-1
 
254
SELECT strcmp('a\t','a ');
 
255
strcmp('a\t','a ')
 
256
-1
 
257
create table t1 select repeat('a',4000) a;
 
258
delete from t1;
 
259
insert into t1 values ('a'), ('a '), ('a\t');
 
260
select collation(a),hex(a) from t1 order by a;
 
261
collation(a)    hex(a)
 
262
cp1250_czech_cs 6109
 
263
cp1250_czech_cs 61
 
264
cp1250_czech_cs 6120
 
265
drop table t1;
 
266
select @@collation_connection;
 
267
@@collation_connection
 
268
cp1250_czech_cs
 
269
select hex(weight_string('a'));
 
270
hex(weight_string('a'))
 
271
A402
 
272
select hex(weight_string('A'));
 
273
hex(weight_string('A'))
 
274
A401
 
275
select hex(weight_string('abc'));
 
276
hex(weight_string('abc'))
 
277
A4A5A6020202
 
278
select hex(weight_string('abc' as char(2)));
 
279
hex(weight_string('abc' as char(2)))
 
280
A4A50202
 
281
select hex(weight_string('abc' as char(3)));
 
282
hex(weight_string('abc' as char(3)))
 
283
A4A5A6020202
 
284
select hex(weight_string('abc' as char(5)));
 
285
hex(weight_string('abc' as char(5)))
 
286
A4A5A682820202020101
 
287
select @@collation_connection;
 
288
@@collation_connection
 
289
cp1250_czech_cs
 
290
select collation(cast(_latin1 0xDF as char));
 
291
collation(cast(_latin1 0xDF as char))
 
292
cp1250_czech_cs
 
293
select hex(weight_string('s'));
 
294
hex(weight_string('s'))
 
295
B902
 
296
select hex(weight_string(cast(_latin1 0xDF as char)));
 
297
hex(weight_string(cast(_latin1 0xDF as char)))
 
298
BB01
 
299
select hex(weight_string(cast(_latin1 0xDF as char) as char(1)));
 
300
hex(weight_string(cast(_latin1 0xDF as char) as char(1)))
 
301
BB01
 
302
select hex(weight_string('c'));
 
303
hex(weight_string('c'))
 
304
A602
 
305
select hex(weight_string('h'));
 
306
hex(weight_string('h'))
 
307
AC02
 
308
select hex(weight_string('ch'));
 
309
hex(weight_string('ch'))
 
310
AD03
 
311
select hex(weight_string('i'));
 
312
hex(weight_string('i'))
 
313
AE02
 
314
select hex(weight_string(cast(_latin1 0x6368DF as char)));
 
315
hex(weight_string(cast(_latin1 0x6368DF as char)))
 
316
ADBB0301
 
317
select hex(weight_string(cast(_latin1 0x6368DF as char) as char(1)));
 
318
hex(weight_string(cast(_latin1 0x6368DF as char) as char(1)))
 
319
AD03
 
320
select hex(weight_string(cast(_latin1 0x6368DF as char) as char(2)));
 
321
hex(weight_string(cast(_latin1 0x6368DF as char) as char(2)))
 
322
ADBB0301
 
323
select hex(weight_string(cast(_latin1 0x6368DF as char) as char(3)));
 
324
hex(weight_string(cast(_latin1 0x6368DF as char) as char(3)))
 
325
ADBB82030101
 
326
select hex(weight_string(cast(_latin1 0x6368DF as char) as char(4)));
 
327
hex(weight_string(cast(_latin1 0x6368DF as char) as char(4)))
 
328
ADBB828203010101
 
329
select hex(weight_string(cast(_latin1 0xDF6368 as char)));
 
330
hex(weight_string(cast(_latin1 0xDF6368 as char)))
 
331
BBAD0103
 
332
select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1)));
 
333
hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1)))
 
334
BB01
 
335
select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2)));
 
336
hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2)))
 
337
BBAD0103
 
338
select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3)));
 
339
hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3)))
 
340
BBAD82010301
 
341
select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4)));
 
342
hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4)))
 
343
BBAD828201030101
 
344
select @@collation_connection;
 
345
@@collation_connection
 
346
cp1250_czech_cs
 
347
select hex(weight_string('a' LEVEL 1));
 
348
hex(weight_string('a' LEVEL 1))
 
349
A4
 
350
select hex(weight_string('A' LEVEL 1));
 
351
hex(weight_string('A' LEVEL 1))
 
352
A4
 
353
select hex(weight_string('abc' LEVEL 1));
 
354
hex(weight_string('abc' LEVEL 1))
 
355
A4A5A6
 
356
select hex(weight_string('abc' as char(2) LEVEL 1));
 
357
hex(weight_string('abc' as char(2) LEVEL 1))
 
358
A4A5
 
359
select hex(weight_string('abc' as char(3) LEVEL 1));
 
360
hex(weight_string('abc' as char(3) LEVEL 1))
 
361
A4A5A6
 
362
select hex(weight_string('abc' as char(5) LEVEL 1));
 
363
hex(weight_string('abc' as char(5) LEVEL 1))
 
364
A4A5A68282
 
365
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
 
366
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
 
367
8282A6A5A4
 
368
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
 
369
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
 
370
5B5A597D7D
 
371
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
 
372
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
 
373
7D7D595A5B
 
374
select @@collation_connection;
 
375
@@collation_connection
 
376
cp1250_czech_cs
 
377
select hex(weight_string('a' LEVEL 2));
 
378
hex(weight_string('a' LEVEL 2))
 
379
02
 
380
select hex(weight_string('A' LEVEL 2));
 
381
hex(weight_string('A' LEVEL 2))
 
382
01
 
383
select hex(weight_string('abc' LEVEL 2));
 
384
hex(weight_string('abc' LEVEL 2))
 
385
020202
 
386
select hex(weight_string('abc' as char(2) LEVEL 2));
 
387
hex(weight_string('abc' as char(2) LEVEL 2))
 
388
0202
 
389
select hex(weight_string('abc' as char(3) LEVEL 2));
 
390
hex(weight_string('abc' as char(3) LEVEL 2))
 
391
020202
 
392
select hex(weight_string('abc' as char(5) LEVEL 2));
 
393
hex(weight_string('abc' as char(5) LEVEL 2))
 
394
0202020101
 
395
select @@collation_connection;
 
396
@@collation_connection
 
397
cp1250_czech_cs
 
398
select hex(weight_string('a' LEVEL 1,2));
 
399
hex(weight_string('a' LEVEL 1,2))
 
400
A402
 
401
select hex(weight_string('a' LEVEL 1-2));
 
402
hex(weight_string('a' LEVEL 1-2))
 
403
A402
 
404
select hex(weight_string('A' LEVEL 1,2));
 
405
hex(weight_string('A' LEVEL 1,2))
 
406
A401
 
407
select hex(weight_string('A' LEVEL 1-2));
 
408
hex(weight_string('A' LEVEL 1-2))
 
409
A401