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

« back to all changes in this revision

Viewing changes to mysql-test/r/ctype_gb2312.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
SET @test_character_set= 'gb2312';
 
3
SET @test_collation= 'gb2312_chinese_ci';
 
4
SET @safe_character_set_server= @@character_set_server;
 
5
SET @safe_collation_server= @@collation_server;
 
6
SET @safe_character_set_client= @@character_set_client;
 
7
SET @safe_character_set_results= @@character_set_results;
 
8
SET character_set_server= @test_character_set;
 
9
SET collation_server= @test_collation;
 
10
CREATE DATABASE d1;
 
11
USE d1;
 
12
CREATE TABLE t1 (c CHAR(10), KEY(c));
 
13
SHOW FULL COLUMNS FROM t1;
 
14
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
 
15
c       char(10)        gb2312_chinese_ci       YES     MUL     NULL                    
 
16
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
 
17
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
 
18
want3results
 
19
aaa
 
20
aaaa
 
21
aaaaa
 
22
DROP TABLE t1;
 
23
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
 
24
SHOW FULL COLUMNS FROM t1;
 
25
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
 
26
c1      varchar(15)     gb2312_chinese_ci       YES     MUL     NULL                    
 
27
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
 
28
SELECT c1 as want3results from t1 where c1 like 'l%';
 
29
want3results
 
30
location
 
31
loberge
 
32
lotre
 
33
SELECT c1 as want3results from t1 where c1 like 'lo%';
 
34
want3results
 
35
location
 
36
loberge
 
37
lotre
 
38
SELECT c1 as want1result  from t1 where c1 like 'loc%';
 
39
want1result
 
40
location
 
41
SELECT c1 as want1result  from t1 where c1 like 'loca%';
 
42
want1result
 
43
location
 
44
SELECT c1 as want1result  from t1 where c1 like 'locat%';
 
45
want1result
 
46
location
 
47
SELECT c1 as want1result  from t1 where c1 like 'locati%';
 
48
want1result
 
49
location
 
50
SELECT c1 as want1result  from t1 where c1 like 'locatio%';
 
51
want1result
 
52
location
 
53
SELECT c1 as want1result  from t1 where c1 like 'location%';
 
54
want1result
 
55
location
 
56
DROP TABLE t1;
 
57
create table t1 (a set('a') not null);
 
58
insert into t1 values (),();
 
59
Warnings:
 
60
Warning 1364    Field 'a' doesn't have a default value
 
61
select cast(a as char(1)) from t1;
 
62
cast(a as char(1))
 
63
 
 
64
 
 
65
select a sounds like a from t1;
 
66
a sounds like a
 
67
1
 
68
1
 
69
select 1 from t1 order by cast(a as char(1));
 
70
1
 
71
1
 
72
1
 
73
drop table t1;
 
74
set names utf8;
 
75
create table t1 (
 
76
name varchar(10),
 
77
level smallint unsigned);
 
78
show create table t1;
 
79
Table   Create Table
 
80
t1      CREATE TABLE `t1` (
 
81
  `name` varchar(10) DEFAULT NULL,
 
82
  `level` smallint(5) unsigned DEFAULT NULL
 
83
) ENGINE=MyISAM DEFAULT CHARSET=gb2312
 
84
insert into t1 values ('string',1);
 
85
select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
 
86
concat(name,space(level))       concat(name, repeat(' ',level))
 
87
string  string 
 
88
drop table t1;
 
89
DROP DATABASE d1;
 
90
USE test;
 
91
SET character_set_server= @safe_character_set_server;
 
92
SET collation_server= @safe_collation_server;
 
93
SET character_set_client= @safe_character_set_client;
 
94
SET character_set_results= @safe_character_set_results;
 
95
SET NAMES gb2312;
 
96
SET collation_connection='gb2312_chinese_ci';
 
97
create table t1 select repeat('a',4000) a;
 
98
delete from t1;
 
99
insert into t1 values ('a'), ('a '), ('a\t');
 
100
select collation(a),hex(a) from t1 order by a;
 
101
collation(a)    hex(a)
 
102
gb2312_chinese_ci       6109
 
103
gb2312_chinese_ci       61
 
104
gb2312_chinese_ci       6120
 
105
drop table t1;
 
106
create table t1 engine=innodb select repeat('a',50) as c1;
 
107
alter table t1 add index(c1(5));
 
108
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
 
109
select collation(c1) from t1 limit 1;
 
110
collation(c1)
 
111
gb2312_chinese_ci
 
112
select c1 from t1 where c1 like 'abcdef%' order by c1;
 
113
c1
 
114
abcdefg
 
115
select c1 from t1 where c1 like 'abcde1%' order by c1;
 
116
c1
 
117
abcde100
 
118
abcde110
 
119
abcde111
 
120
select c1 from t1 where c1 like 'abcde11%' order by c1;
 
121
c1
 
122
abcde110
 
123
abcde111
 
124
select c1 from t1 where c1 like 'abcde111%' order by c1;
 
125
c1
 
126
abcde111
 
127
drop table t1;
 
128
select @@collation_connection;
 
129
@@collation_connection
 
130
gb2312_chinese_ci
 
131
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
 
132
insert into t1 values('abcdef');
 
133
insert into t1 values('_bcdef');
 
134
insert into t1 values('a_cdef');
 
135
insert into t1 values('ab_def');
 
136
insert into t1 values('abc_ef');
 
137
insert into t1 values('abcd_f');
 
138
insert into t1 values('abcde_');
 
139
select c1 as c1u from t1 where c1 like 'ab\_def';
 
140
c1u
 
141
ab_def
 
142
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
 
143
c2h
 
144
ab_def
 
145
drop table t1;
 
146
CREATE TABLE t1 AS
 
147
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
 
148
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
 
149
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
 
150
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
 
151
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
 
152
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
 
153
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
 
154
hex(concat(repeat(0xF1F2, 10), '%'))
 
155
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
 
156
3 rows expected
 
157
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
 
158
a       hex(b)  c
 
159
2       F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2        
 
160
3       F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2    
 
161
4       F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2        
 
162
DROP TABLE t1;
 
163
SET collation_connection='gb2312_bin';
 
164
create table t1 select repeat('a',4000) a;
 
165
delete from t1;
 
166
insert into t1 values ('a'), ('a '), ('a\t');
 
167
select collation(a),hex(a) from t1 order by a;
 
168
collation(a)    hex(a)
 
169
gb2312_bin      6109
 
170
gb2312_bin      61
 
171
gb2312_bin      6120
 
172
drop table t1;
 
173
create table t1 engine=innodb select repeat('a',50) as c1;
 
174
alter table t1 add index(c1(5));
 
175
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
 
176
select collation(c1) from t1 limit 1;
 
177
collation(c1)
 
178
gb2312_bin
 
179
select c1 from t1 where c1 like 'abcdef%' order by c1;
 
180
c1
 
181
abcdefg
 
182
select c1 from t1 where c1 like 'abcde1%' order by c1;
 
183
c1
 
184
abcde100
 
185
abcde110
 
186
abcde111
 
187
select c1 from t1 where c1 like 'abcde11%' order by c1;
 
188
c1
 
189
abcde110
 
190
abcde111
 
191
select c1 from t1 where c1 like 'abcde111%' order by c1;
 
192
c1
 
193
abcde111
 
194
drop table t1;
 
195
select @@collation_connection;
 
196
@@collation_connection
 
197
gb2312_bin
 
198
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
 
199
insert into t1 values('abcdef');
 
200
insert into t1 values('_bcdef');
 
201
insert into t1 values('a_cdef');
 
202
insert into t1 values('ab_def');
 
203
insert into t1 values('abc_ef');
 
204
insert into t1 values('abcd_f');
 
205
insert into t1 values('abcde_');
 
206
select c1 as c1u from t1 where c1 like 'ab\_def';
 
207
c1u
 
208
ab_def
 
209
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
 
210
c2h
 
211
ab_def
 
212
drop table t1;
 
213
CREATE TABLE t1 AS
 
214
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
 
215
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
 
216
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
 
217
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
 
218
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
 
219
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
 
220
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
 
221
hex(concat(repeat(0xF1F2, 10), '%'))
 
222
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
 
223
3 rows expected
 
224
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
 
225
a       hex(b)  c
 
226
2       F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2        
 
227
3       F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2    
 
228
4       F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2        
 
229
DROP TABLE t1;
 
230
SET NAMES gb2312;
 
231
CREATE TABLE t1 (a text) character set gb2312;
 
232
INSERT INTO t1 VALUES (0xA2A1),(0xD7FE);
 
233
SELECT hex(a) FROM t1 ORDER BY a;
 
234
hex(a)
 
235
A2A1
 
236
D7FE
 
237
DROP TABLE t1;
 
238
set names gb2312;
 
239
select @@collation_connection;
 
240
@@collation_connection
 
241
gb2312_chinese_ci
 
242
select hex(weight_string('a'));
 
243
hex(weight_string('a'))
 
244
41
 
245
select hex(weight_string('A'));
 
246
hex(weight_string('A'))
 
247
41
 
248
select hex(weight_string('abc'));
 
249
hex(weight_string('abc'))
 
250
414243
 
251
select hex(weight_string('abc' as char(2)));
 
252
hex(weight_string('abc' as char(2)))
 
253
4142
 
254
select hex(weight_string('abc' as char(3)));
 
255
hex(weight_string('abc' as char(3)))
 
256
414243
 
257
select hex(weight_string('abc' as char(5)));
 
258
hex(weight_string('abc' as char(5)))
 
259
4142432020
 
260
select @@collation_connection;
 
261
@@collation_connection
 
262
gb2312_chinese_ci
 
263
select hex(weight_string('a' LEVEL 1));
 
264
hex(weight_string('a' LEVEL 1))
 
265
41
 
266
select hex(weight_string('A' LEVEL 1));
 
267
hex(weight_string('A' LEVEL 1))
 
268
41
 
269
select hex(weight_string('abc' LEVEL 1));
 
270
hex(weight_string('abc' LEVEL 1))
 
271
414243
 
272
select hex(weight_string('abc' as char(2) LEVEL 1));
 
273
hex(weight_string('abc' as char(2) LEVEL 1))
 
274
4142
 
275
select hex(weight_string('abc' as char(3) LEVEL 1));
 
276
hex(weight_string('abc' as char(3) LEVEL 1))
 
277
414243
 
278
select hex(weight_string('abc' as char(5) LEVEL 1));
 
279
hex(weight_string('abc' as char(5) LEVEL 1))
 
280
4142432020
 
281
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
 
282
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
 
283
2020434241
 
284
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
 
285
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
 
286
BEBDBCDFDF
 
287
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
 
288
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
 
289
DFDFBCBDBE
 
290
select collation(cast(0xA1A1 as char));
 
291
collation(cast(0xA1A1 as char))
 
292
gb2312_chinese_ci
 
293
select hex(weight_string(cast(0x6141 as char)));
 
294
hex(weight_string(cast(0x6141 as char)))
 
295
4141
 
296
select hex(weight_string(cast(0xA1A1 as char)));
 
297
hex(weight_string(cast(0xA1A1 as char)))
 
298
A1A1
 
299
select hex(weight_string(cast(0xA1A1 as char) as char(1)));
 
300
hex(weight_string(cast(0xA1A1 as char) as char(1)))
 
301
A1A1
 
302
select hex(weight_string(cast(0xA1A1A1A1 as char) as char(1)));
 
303
hex(weight_string(cast(0xA1A1A1A1 as char) as char(1)))
 
304
A1A1
 
305
select hex(weight_string(cast(0xA1A1 as char) as char(3)));
 
306
hex(weight_string(cast(0xA1A1 as char) as char(3)))
 
307
A1A12020
 
308
select hex(weight_string(cast(0xA1A1A1A1 as char) as char(3)));
 
309
hex(weight_string(cast(0xA1A1A1A1 as char) as char(3)))
 
310
A1A1A1A120
 
311
select hex(weight_string(cast(0x40A1A1 as char) as char(3)));
 
312
hex(weight_string(cast(0x40A1A1 as char) as char(3)))
 
313
40A1A120
 
314
select hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3)));
 
315
hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3)))
 
316
40A1A1A1A1
 
317
select hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3)));
 
318
hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3)))
 
319
40A1A1A1A1
 
320
select hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3)));
 
321
hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3)))
 
322
4040A1A1
 
323
set collation_connection=gb2312_bin;
 
324
select @@collation_connection;
 
325
@@collation_connection
 
326
gb2312_bin
 
327
select hex(weight_string('a'));
 
328
hex(weight_string('a'))
 
329
61
 
330
select hex(weight_string('A'));
 
331
hex(weight_string('A'))
 
332
41
 
333
select hex(weight_string('abc'));
 
334
hex(weight_string('abc'))
 
335
616263
 
336
select hex(weight_string('abc' as char(2)));
 
337
hex(weight_string('abc' as char(2)))
 
338
6162
 
339
select hex(weight_string('abc' as char(3)));
 
340
hex(weight_string('abc' as char(3)))
 
341
616263
 
342
select hex(weight_string('abc' as char(5)));
 
343
hex(weight_string('abc' as char(5)))
 
344
6162632020
 
345
select @@collation_connection;
 
346
@@collation_connection
 
347
gb2312_bin
 
348
select hex(weight_string('a' LEVEL 1));
 
349
hex(weight_string('a' LEVEL 1))
 
350
61
 
351
select hex(weight_string('A' LEVEL 1));
 
352
hex(weight_string('A' LEVEL 1))
 
353
41
 
354
select hex(weight_string('abc' LEVEL 1));
 
355
hex(weight_string('abc' LEVEL 1))
 
356
616263
 
357
select hex(weight_string('abc' as char(2) LEVEL 1));
 
358
hex(weight_string('abc' as char(2) LEVEL 1))
 
359
6162
 
360
select hex(weight_string('abc' as char(3) LEVEL 1));
 
361
hex(weight_string('abc' as char(3) LEVEL 1))
 
362
616263
 
363
select hex(weight_string('abc' as char(5) LEVEL 1));
 
364
hex(weight_string('abc' as char(5) LEVEL 1))
 
365
6162632020
 
366
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
 
367
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
 
368
2020636261
 
369
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
 
370
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
 
371
9E9D9CDFDF
 
372
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
 
373
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
 
374
DFDF9C9D9E
 
375
select collation(cast(0xA1A1 as char));
 
376
collation(cast(0xA1A1 as char))
 
377
gb2312_bin
 
378
select hex(weight_string(cast(0x6141 as char)));
 
379
hex(weight_string(cast(0x6141 as char)))
 
380
6141
 
381
select hex(weight_string(cast(0xA1A1 as char)));
 
382
hex(weight_string(cast(0xA1A1 as char)))
 
383
A1A1
 
384
select hex(weight_string(cast(0xA1A1 as char) as char(1)));
 
385
hex(weight_string(cast(0xA1A1 as char) as char(1)))
 
386
A1A1
 
387
select hex(weight_string(cast(0xA1A1A1A1 as char) as char(1)));
 
388
hex(weight_string(cast(0xA1A1A1A1 as char) as char(1)))
 
389
A1A1
 
390
select hex(weight_string(cast(0xA1A1 as char) as char(3)));
 
391
hex(weight_string(cast(0xA1A1 as char) as char(3)))
 
392
A1A12020
 
393
select hex(weight_string(cast(0xA1A1A1A1 as char) as char(3)));
 
394
hex(weight_string(cast(0xA1A1A1A1 as char) as char(3)))
 
395
A1A1A1A120
 
396
select hex(weight_string(cast(0x40A1A1 as char) as char(3)));
 
397
hex(weight_string(cast(0x40A1A1 as char) as char(3)))
 
398
40A1A120
 
399
select hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3)));
 
400
hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3)))
 
401
40A1A1A1A1
 
402
select hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3)));
 
403
hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3)))
 
404
40A1A1A1A1
 
405
select hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3)));
 
406
hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3)))
 
407
4040A1A1