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;
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%';
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%';
37
SELECT c1 as want3results from t1 where c1 like 'lo%';
42
SELECT c1 as want1result from t1 where c1 like 'loc%';
45
SELECT c1 as want1result from t1 where c1 like 'loca%';
48
SELECT c1 as want1result from t1 where c1 like 'locat%';
51
SELECT c1 as want1result from t1 where c1 like 'locati%';
54
SELECT c1 as want1result from t1 where c1 like 'locatio%';
57
SELECT c1 as want1result from t1 where c1 like 'location%';
61
create table t1 (a set('a') not null);
62
insert into t1 values (),();
64
Warning 1364 Field 'a' doesn't have a default value
65
select cast(a as char(1)) from t1;
69
select a sounds like a from t1;
73
select 1 from t1 order by cast(a as char(1));
81
level smallint unsigned);
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))
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;
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%';
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%';
130
SELECT c1 as want3results from t1 where c1 like 'lo%';
135
SELECT c1 as want1result from t1 where c1 like 'loc%';
138
SELECT c1 as want1result from t1 where c1 like 'loca%';
141
SELECT c1 as want1result from t1 where c1 like 'locat%';
144
SELECT c1 as want1result from t1 where c1 like 'locati%';
147
SELECT c1 as want1result from t1 where c1 like 'locatio%';
150
SELECT c1 as want1result from t1 where c1 like 'location%';
154
create table t1 (a set('a') not null);
155
insert into t1 values (),();
157
Warning 1364 Field 'a' doesn't have a default value
158
select cast(a as char(1)) from t1;
162
select a sounds like a from t1;
166
select 1 from t1 order by cast(a as char(1));
174
level smallint unsigned);
175
show create table t1;
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))
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=' '
199
popisek varchar(30) collate cp1250_general_ci NOT NULL default '',
200
PRIMARY KEY (`popisek`)
202
INSERT INTO t1 VALUES ('2005-01-1');
203
SELECT * FROM t1 WHERE popisek = '2005-01-1';
206
SELECT * FROM t1 WHERE popisek LIKE '2005-01-1';
213
id INT AUTO_INCREMENT PRIMARY KEY,
214
str VARCHAR(32) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL default '',
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%';
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�";
241
set names cp1250 collate cp1250_czech_cs;
242
SELECT strcmp('a','a ');
245
SELECT strcmp('a\0','a' );
248
SELECT strcmp('a\0','a ');
251
SELECT strcmp('a\t','a' );
254
SELECT strcmp('a\t','a ');
257
create table t1 select repeat('a',4000) a;
259
insert into t1 values ('a'), ('a '), ('a\t');
260
select collation(a),hex(a) from t1 order by a;
266
select @@collation_connection;
267
@@collation_connection
269
select hex(weight_string('a'));
270
hex(weight_string('a'))
272
select hex(weight_string('A'));
273
hex(weight_string('A'))
275
select hex(weight_string('abc'));
276
hex(weight_string('abc'))
278
select hex(weight_string('abc' as char(2)));
279
hex(weight_string('abc' as char(2)))
281
select hex(weight_string('abc' as char(3)));
282
hex(weight_string('abc' as char(3)))
284
select hex(weight_string('abc' as char(5)));
285
hex(weight_string('abc' as char(5)))
287
select @@collation_connection;
288
@@collation_connection
290
select collation(cast(_latin1 0xDF as char));
291
collation(cast(_latin1 0xDF as char))
293
select hex(weight_string('s'));
294
hex(weight_string('s'))
296
select hex(weight_string(cast(_latin1 0xDF as char)));
297
hex(weight_string(cast(_latin1 0xDF as char)))
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)))
302
select hex(weight_string('c'));
303
hex(weight_string('c'))
305
select hex(weight_string('h'));
306
hex(weight_string('h'))
308
select hex(weight_string('ch'));
309
hex(weight_string('ch'))
311
select hex(weight_string('i'));
312
hex(weight_string('i'))
314
select hex(weight_string(cast(_latin1 0x6368DF as char)));
315
hex(weight_string(cast(_latin1 0x6368DF as char)))
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)))
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)))
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)))
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)))
329
select hex(weight_string(cast(_latin1 0xDF6368 as char)));
330
hex(weight_string(cast(_latin1 0xDF6368 as char)))
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)))
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)))
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)))
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)))
344
select @@collation_connection;
345
@@collation_connection
347
select hex(weight_string('a' LEVEL 1));
348
hex(weight_string('a' LEVEL 1))
350
select hex(weight_string('A' LEVEL 1));
351
hex(weight_string('A' LEVEL 1))
353
select hex(weight_string('abc' LEVEL 1));
354
hex(weight_string('abc' LEVEL 1))
356
select hex(weight_string('abc' as char(2) LEVEL 1));
357
hex(weight_string('abc' as char(2) LEVEL 1))
359
select hex(weight_string('abc' as char(3) LEVEL 1));
360
hex(weight_string('abc' as char(3) LEVEL 1))
362
select hex(weight_string('abc' as char(5) LEVEL 1));
363
hex(weight_string('abc' as char(5) LEVEL 1))
365
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
366
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
368
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
369
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
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))
374
select @@collation_connection;
375
@@collation_connection
377
select hex(weight_string('a' LEVEL 2));
378
hex(weight_string('a' LEVEL 2))
380
select hex(weight_string('A' LEVEL 2));
381
hex(weight_string('A' LEVEL 2))
383
select hex(weight_string('abc' LEVEL 2));
384
hex(weight_string('abc' LEVEL 2))
386
select hex(weight_string('abc' as char(2) LEVEL 2));
387
hex(weight_string('abc' as char(2) LEVEL 2))
389
select hex(weight_string('abc' as char(3) LEVEL 2));
390
hex(weight_string('abc' as char(3) LEVEL 2))
392
select hex(weight_string('abc' as char(5) LEVEL 2));
393
hex(weight_string('abc' as char(5) LEVEL 2))
395
select @@collation_connection;
396
@@collation_connection
398
select hex(weight_string('a' LEVEL 1,2));
399
hex(weight_string('a' LEVEL 1,2))
401
select hex(weight_string('a' LEVEL 1-2));
402
hex(weight_string('a' LEVEL 1-2))
404
select hex(weight_string('A' LEVEL 1,2));
405
hex(weight_string('A' LEVEL 1,2))
407
select hex(weight_string('A' LEVEL 1-2));
408
hex(weight_string('A' LEVEL 1-2))