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

« back to all changes in this revision

Viewing changes to mysql-test/r/partition_datatype.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
# test with not null
 
3
create table t1 (a bit not null) partition by key (a);
 
4
insert into t1 values (b'1');
 
5
select hex(a) from t1 where a = b'1';
 
6
hex(a)
 
7
1
 
8
drop table t1;
 
9
create table t1 (a tinyint not null) partition by key (a);
 
10
insert into t1 values (2);
 
11
select * from t1 where a = 2;
 
12
a
 
13
2
 
14
drop table t1;
 
15
create table t1 (a smallint not null) partition by key (a);
 
16
insert into t1 values (2);
 
17
select * from t1 where a = 2;
 
18
a
 
19
2
 
20
drop table t1;
 
21
create table t1 (a mediumint not null) partition by key (a);
 
22
insert into t1 values (2);
 
23
select * from t1 where a = 2;
 
24
a
 
25
2
 
26
drop table t1;
 
27
create table t1 (a int not null) partition by key (a);
 
28
insert into t1 values (2);
 
29
select * from t1 where a = 2;
 
30
a
 
31
2
 
32
drop table t1;
 
33
create table t1 (a bigint not null) partition by key (a);
 
34
insert into t1 values (2);
 
35
select * from t1 where a = 2;
 
36
a
 
37
2
 
38
drop table t1;
 
39
create table t1 (a float not null) partition by key (a);
 
40
insert into t1 values (0.5);
 
41
select * from t1 where a = 0.5;
 
42
a
 
43
0.5
 
44
drop table t1;
 
45
create table t1 (a double not null) partition by key (a);
 
46
insert into t1 values (0.5);
 
47
select * from t1 where a = 0.5;
 
48
a
 
49
0.5
 
50
drop table t1;
 
51
create table t1 (a decimal(4,2) not null) partition by key (a);
 
52
insert into t1 values (2.1);
 
53
select * from t1 where a = 2.1;
 
54
a
 
55
2.10
 
56
drop table t1;
 
57
create table t1 (a date not null) partition by key (a);
 
58
insert into t1 values ('2001-01-01');
 
59
select * from t1 where a = '2001-01-01';
 
60
a
 
61
2001-01-01
 
62
drop table t1;
 
63
create table t1 (a datetime not null) partition by key (a);
 
64
insert into t1 values ('2001-01-01 01:02:03');
 
65
select * from t1 where a = '2001-01-01 01:02:03';
 
66
a
 
67
2001-01-01 01:02:03
 
68
drop table t1;
 
69
create table t1 (a timestamp not null) partition by key (a);
 
70
insert into t1 values ('2001-01-01 01:02:03');
 
71
select * from t1 where a = '2001-01-01 01:02:03';
 
72
a
 
73
2001-01-01 01:02:03
 
74
drop table t1;
 
75
create table t1 (a time not null) partition by key (a);
 
76
insert into t1 values ('01:02:03');
 
77
select * from t1 where a = '01:02:03';
 
78
a
 
79
01:02:03
 
80
drop table t1;
 
81
create table t1 (a year not null) partition by key (a);
 
82
insert into t1 values ('2001');
 
83
select * from t1 where a = '2001';
 
84
a
 
85
2001
 
86
drop table t1;
 
87
create table t1 (a varchar(10) character set utf8 not null) partition by key (a);
 
88
insert into t1 values ('abc');
 
89
select * from t1 where a = 'abc';
 
90
a
 
91
abc
 
92
drop table t1;
 
93
create table t1 (a varchar(300) character set utf8 not null) partition by key (a);
 
94
insert into t1 values ('abc');
 
95
select * from t1 where a = 'abc';
 
96
a
 
97
abc
 
98
drop table t1;
 
99
create table t1 (a varchar(10) character set latin1 not null) partition by key (a);
 
100
insert into t1 values ('abc');
 
101
select * from t1 where a = 'abc';
 
102
a
 
103
abc
 
104
drop table t1;
 
105
create table t1 (a varchar(300) character set latin1 not null) partition by key (a);
 
106
insert into t1 values ('abc');
 
107
select * from t1 where a = 'abc';
 
108
a
 
109
abc
 
110
drop table t1;
 
111
create table t1 (a char(10) character set utf8 not null) partition by key (a);
 
112
insert into t1 values ('abc');
 
113
select * from t1 where a = 'abc';
 
114
a
 
115
abc
 
116
drop table t1;
 
117
create table t1 (a char(10) character set latin1 not null) partition by key (a);
 
118
insert into t1 values ('abc');
 
119
select * from t1 where a = 'abc';
 
120
a
 
121
abc
 
122
drop table t1;
 
123
create table t1 (a enum('y','n') not null) partition by key (a);
 
124
insert into t1 values ('y');
 
125
select * from t1 where a = 'y';
 
126
a
 
127
y
 
128
drop table t1;
 
129
create table t1 (a set('y','n') not null) partition by key (a);
 
130
insert into t1 values ('y');
 
131
select * from t1 where a = 'y';
 
132
a
 
133
y
 
134
drop table t1;
 
135
# test with null allowed
 
136
create table t1 (a bit) partition by key (a);
 
137
insert into t1 values (b'1');
 
138
insert into t1 values (NULL);
 
139
select hex(a) from t1 where a = b'1';
 
140
hex(a)
 
141
1
 
142
select hex(a) from t1 where a is NULL;
 
143
hex(a)
 
144
NULL
 
145
select hex(a) from t1 order by a;
 
146
hex(a)
 
147
NULL
 
148
1
 
149
drop table t1;
 
150
create table t1 (a tinyint) partition by key (a);
 
151
insert into t1 values (2);
 
152
select * from t1 where a = 2;
 
153
a
 
154
2
 
155
drop table t1;
 
156
create table t1 (a smallint) partition by key (a);
 
157
insert into t1 values (2);
 
158
select * from t1 where a = 2;
 
159
a
 
160
2
 
161
drop table t1;
 
162
create table t1 (a mediumint) partition by key (a);
 
163
insert into t1 values (2);
 
164
select * from t1 where a = 2;
 
165
a
 
166
2
 
167
drop table t1;
 
168
create table t1 (a int) partition by key (a);
 
169
insert into t1 values (2);
 
170
select * from t1 where a = 2;
 
171
a
 
172
2
 
173
drop table t1;
 
174
create table t1 (a bigint) partition by key (a);
 
175
insert into t1 values (2);
 
176
select * from t1 where a = 2;
 
177
a
 
178
2
 
179
drop table t1;
 
180
create table t1 (a float) partition by key (a);
 
181
insert into t1 values (0.5);
 
182
select * from t1 where a = 0.5;
 
183
a
 
184
0.5
 
185
drop table t1;
 
186
create table t1 (a double) partition by key (a);
 
187
insert into t1 values (0.5);
 
188
select * from t1 where a = 0.5;
 
189
a
 
190
0.5
 
191
drop table t1;
 
192
create table t1 (a decimal(4,2)) partition by key (a);
 
193
insert into t1 values (2.1);
 
194
select * from t1 where a = 2.1;
 
195
a
 
196
2.10
 
197
drop table t1;
 
198
create table t1 (a date) partition by key (a);
 
199
insert into t1 values ('2001-01-01');
 
200
select * from t1 where a = '2001-01-01';
 
201
a
 
202
2001-01-01
 
203
drop table t1;
 
204
create table t1 (a datetime) partition by key (a);
 
205
insert into t1 values ('2001-01-01 01:02:03');
 
206
select * from t1 where a = '2001-01-01 01:02:03';
 
207
a
 
208
2001-01-01 01:02:03
 
209
drop table t1;
 
210
create table t1 (a timestamp null) partition by key (a);
 
211
insert into t1 values ('2001-01-01 01:02:03');
 
212
select * from t1 where a = '2001-01-01 01:02:03';
 
213
a
 
214
2001-01-01 01:02:03
 
215
drop table t1;
 
216
create table t1 (a time) partition by key (a);
 
217
insert into t1 values ('01:02:03');
 
218
select * from t1 where a = '01:02:03';
 
219
a
 
220
01:02:03
 
221
drop table t1;
 
222
create table t1 (a year) partition by key (a);
 
223
insert into t1 values ('2001');
 
224
select * from t1 where a = '2001';
 
225
a
 
226
2001
 
227
drop table t1;
 
228
create table t1 (a varchar(10) character set utf8) partition by key (a);
 
229
insert into t1 values ('abc');
 
230
select * from t1 where a = 'abc';
 
231
a
 
232
abc
 
233
drop table t1;
 
234
create table t1 (a varchar(300) character set utf8) partition by key (a);
 
235
insert into t1 values ('abc');
 
236
select * from t1 where a = 'abc';
 
237
a
 
238
abc
 
239
drop table t1;
 
240
create table t1 (a varchar(10) character set latin1) partition by key (a);
 
241
insert into t1 values ('abc');
 
242
select * from t1 where a = 'abc';
 
243
a
 
244
abc
 
245
drop table t1;
 
246
create table t1 (a varchar(300) character set latin1) partition by key (a);
 
247
insert into t1 values ('abc');
 
248
select * from t1 where a = 'abc';
 
249
a
 
250
abc
 
251
drop table t1;
 
252
create table t1 (a char(10) character set utf8) partition by key (a);
 
253
insert into t1 values ('abc');
 
254
select * from t1 where a = 'abc';
 
255
a
 
256
abc
 
257
drop table t1;
 
258
create table t1 (a char(10) character set latin1) partition by key (a);
 
259
insert into t1 values ('abc');
 
260
select * from t1 where a = 'abc';
 
261
a
 
262
abc
 
263
drop table t1;
 
264
create table t1 (a enum('y','n')) partition by key (a);
 
265
insert into t1 values ('y');
 
266
select * from t1 where a = 'y';
 
267
a
 
268
y
 
269
drop table t1;
 
270
create table t1 (a set('y','n')) partition by key (a);
 
271
insert into t1 values ('y');
 
272
select * from t1 where a = 'y';
 
273
a
 
274
y
 
275
drop table t1;
 
276
create table t1 (a varchar(65531)) partition by key (a);
 
277
insert into t1 values ('bbbb');
 
278
insert into t1 values ('aaaa');
 
279
select * from t1 where a = 'aaaa';
 
280
a
 
281
aaaa
 
282
select * from t1 where a like 'aaa%';
 
283
a
 
284
aaaa
 
285
select * from t1 where a = 'bbbb';
 
286
a
 
287
bbbb
 
288
drop table t1;
 
289
create table t1 (a varchar(65532)) partition by key (a);
 
290
insert into t1 values ('bbbb');
 
291
insert into t1 values ('aaaa');
 
292
select * from t1 where a = 'aaaa';
 
293
a
 
294
aaaa
 
295
select * from t1 where a like 'aaa%';
 
296
a
 
297
aaaa
 
298
select * from t1 where a = 'bbbb';
 
299
a
 
300
bbbb
 
301
drop table t1;
 
302
create table t1 (a varchar(65533) not null) partition by key (a);
 
303
insert into t1 values ('bbbb');
 
304
insert into t1 values ('aaaa');
 
305
select * from t1 where a = 'aaaa';
 
306
a
 
307
aaaa
 
308
select * from t1 where a like 'aaa%';
 
309
a
 
310
aaaa
 
311
select * from t1 where a = 'bbbb';
 
312
a
 
313
bbbb
 
314
drop table t1;
 
315
create table t1 (a varchar(65533)) partition by key (a);
 
316
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
 
317
create table t1 (a varchar(65534) not null) partition by key (a);
 
318
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
 
319
create table t1 (a varchar(65535)) partition by key (a);
 
320
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
 
321
create table t1 (a bit(27), primary key (a)) engine=myisam
 
322
partition by hash (a)
 
323
(partition p0, partition p1, partition p2);
 
324
show create table t1;
 
325
Table   Create Table
 
326
t1      CREATE TABLE `t1` (
 
327
  `a` bit(27) NOT NULL DEFAULT b'0',
 
328
  PRIMARY KEY (`a`)
 
329
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
330
/*!50100 PARTITION BY HASH (a)
 
331
(PARTITION p0 ENGINE = MyISAM,
 
332
 PARTITION p1 ENGINE = MyISAM,
 
333
 PARTITION p2 ENGINE = MyISAM) */
 
334
insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34);
 
335
select hex(a) from t1 where a = 7;
 
336
hex(a)
 
337
7
 
338
drop table t1;