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

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/r/partition_bit_innodb.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
SET @max_row = 20;
 
2
drop table if exists t1;
 
3
create table t1 (a bit(65), primary key (a)) engine='INNODB' partition by key (a);
 
4
ERROR 42000: Display width out of range for column 'a' (max = 64)
 
5
create table t1 (a bit(0), primary key (a)) engine='INNODB' partition by key (a);
 
6
show create table t1;
 
7
Table   Create Table
 
8
t1      CREATE TABLE `t1` (
 
9
  `a` bit(1) NOT NULL DEFAULT '\0',
 
10
  PRIMARY KEY (`a`)
 
11
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a)  */
 
12
drop table t1;
 
13
create table t1 (a bit(0), primary key (a)) engine='INNODB' 
 
14
partition by key (a) (
 
15
partition pa1,
 
16
partition pa2);
 
17
show create table t1;
 
18
Table   Create Table
 
19
t1      CREATE TABLE `t1` (
 
20
  `a` bit(1) NOT NULL DEFAULT '\0',
 
21
  PRIMARY KEY (`a`)
 
22
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 ENGINE = InnoDB, PARTITION pa2 ENGINE = InnoDB) */
 
23
drop table t1;
 
24
create table t1 (a bit(64), primary key (a)) engine='INNODB' 
 
25
partition by key (a) partitions 2;
 
26
show create table t1;
 
27
Table   Create Table
 
28
t1      CREATE TABLE `t1` (
 
29
  `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
 
30
  PRIMARY KEY (`a`)
 
31
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 2  */
 
32
insert into t1 values 
 
33
(b'1111111111111111111111111111111111111111111111111111111111111111'),
 
34
(b'1000000000000000000000000000000000000000000000000000000000000000'),
 
35
(b'0000000000000000000000000000000000000000000000000000000000000001'),
 
36
(b'1010101010101010101010101010101010101010101010101010101010101010'),
 
37
(b'0101010101010101010101010101010101010101010101010101010101010101');
 
38
select hex(a) from t1;
 
39
hex(a)
 
40
1
 
41
5555555555555555
 
42
8000000000000000
 
43
AAAAAAAAAAAAAAAA
 
44
FFFFFFFFFFFFFFFF
 
45
drop table t1;
 
46
create table t1 (a bit(64), primary key (a)) engine='INNODB' 
 
47
partition by key (a) (
 
48
partition pa1 max_rows=20 min_rows=2,
 
49
partition pa2 max_rows=30 min_rows=3,
 
50
partition pa3 max_rows=30 min_rows=4,
 
51
partition pa4 max_rows=40 min_rows=2);
 
52
show create table t1;
 
53
Table   Create Table
 
54
t1      CREATE TABLE `t1` (
 
55
  `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
 
56
  PRIMARY KEY (`a`)
 
57
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
 
58
insert into t1 values 
 
59
(b'1111111111111111111111111111111111111111111111111111111111111111'),
 
60
(b'1000000000000000000000000000000000000000000000000000000000000000'),
 
61
(b'0000000000000000000000000000000000000000000000000000000000000001'),
 
62
(b'1010101010101010101010101010101010101010101010101010101010101010'),
 
63
(b'0101010101010101010101010101010101010101010101010101010101010101');
 
64
select hex(a) from t1 where a=b'0101010101010101010101010101010101010101010101010101010101010101';
 
65
hex(a)
 
66
5555555555555555
 
67
delete from t1 where a=b'0101010101010101010101010101010101010101010101010101010101010101';
 
68
select hex(a) from t1;
 
69
hex(a)
 
70
1
 
71
8000000000000000
 
72
AAAAAAAAAAAAAAAA
 
73
FFFFFFFFFFFFFFFF
 
74
drop table t1;
 
75
create table t2 (a bit, primary key (a)) engine='INNODB' 
 
76
partition by key (a) partitions 4;
 
77
show create table t2;
 
78
Table   Create Table
 
79
t2      CREATE TABLE `t2` (
 
80
  `a` bit(1) NOT NULL DEFAULT '\0',
 
81
  PRIMARY KEY (`a`)
 
82
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4  */
 
83
insert into t2 values (b'0'), (b'1');
 
84
select hex(a) from t2;
 
85
hex(a)
 
86
0
 
87
1
 
88
alter table t2 drop primary key;
 
89
show create table t2;
 
90
Table   Create Table
 
91
t2      CREATE TABLE `t2` (
 
92
  `a` bit(1) NOT NULL DEFAULT '\0'
 
93
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4  */
 
94
select hex(a) from t2;
 
95
hex(a)
 
96
0
 
97
1
 
98
alter table t2 add primary key (a);
 
99
show create table t2;
 
100
Table   Create Table
 
101
t2      CREATE TABLE `t2` (
 
102
  `a` bit(1) NOT NULL DEFAULT '\0',
 
103
  PRIMARY KEY (`a`)
 
104
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4  */
 
105
select hex(a) from t2;
 
106
hex(a)
 
107
0
 
108
1
 
109
drop table t2;
 
110
create table t3 (a bit(8), primary key (a)) engine='INNODB' 
 
111
partition by range (a) subpartition by key (a) subpartitions 2 (
 
112
partition pa1 values less than (3),
 
113
partition pa2 values less than (16),
 
114
partition pa3 values less than (64),
 
115
partition pa4 values less than (256));
 
116
show create table t3;
 
117
Table   Create Table
 
118
t3      CREATE TABLE `t3` (
 
119
  `a` bit(8) NOT NULL DEFAULT '\0',
 
120
  PRIMARY KEY (`a`)
 
121
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = InnoDB, PARTITION pa2 VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION pa3 VALUES LESS THAN (64) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (256) ENGINE = InnoDB) */
 
122
255 inserts;
 
123
select hex(a) from t3 where a=b'01010101';
 
124
hex(a)
 
125
55
 
126
delete from t3 where a=b'01010101';
 
127
select count(*) from t3;
 
128
count(*)
 
129
254
 
130
select hex(a) from t3;
 
131
hex(a)
 
132
1
 
133
10
 
134
11
 
135
12
 
136
13
 
137
14
 
138
15
 
139
16
 
140
17
 
141
18
 
142
19
 
143
1A
 
144
1B
 
145
1C
 
146
1D
 
147
1E
 
148
1F
 
149
2
 
150
20
 
151
21
 
152
22
 
153
23
 
154
24
 
155
25
 
156
26
 
157
27
 
158
28
 
159
29
 
160
2A
 
161
2B
 
162
2C
 
163
2D
 
164
2E
 
165
2F
 
166
3
 
167
30
 
168
31
 
169
32
 
170
33
 
171
34
 
172
35
 
173
36
 
174
37
 
175
38
 
176
39
 
177
3A
 
178
3B
 
179
3C
 
180
3D
 
181
3E
 
182
3F
 
183
4
 
184
40
 
185
41
 
186
42
 
187
43
 
188
44
 
189
45
 
190
46
 
191
47
 
192
48
 
193
49
 
194
4A
 
195
4B
 
196
4C
 
197
4D
 
198
4E
 
199
4F
 
200
5
 
201
50
 
202
51
 
203
52
 
204
53
 
205
54
 
206
56
 
207
57
 
208
58
 
209
59
 
210
5A
 
211
5B
 
212
5C
 
213
5D
 
214
5E
 
215
5F
 
216
6
 
217
60
 
218
61
 
219
62
 
220
63
 
221
64
 
222
65
 
223
66
 
224
67
 
225
68
 
226
69
 
227
6A
 
228
6B
 
229
6C
 
230
6D
 
231
6E
 
232
6F
 
233
7
 
234
70
 
235
71
 
236
72
 
237
73
 
238
74
 
239
75
 
240
76
 
241
77
 
242
78
 
243
79
 
244
7A
 
245
7B
 
246
7C
 
247
7D
 
248
7E
 
249
7F
 
250
8
 
251
80
 
252
81
 
253
82
 
254
83
 
255
84
 
256
85
 
257
86
 
258
87
 
259
88
 
260
89
 
261
8A
 
262
8B
 
263
8C
 
264
8D
 
265
8E
 
266
8F
 
267
9
 
268
90
 
269
91
 
270
92
 
271
93
 
272
94
 
273
95
 
274
96
 
275
97
 
276
98
 
277
99
 
278
9A
 
279
9B
 
280
9C
 
281
9D
 
282
9E
 
283
9F
 
284
A
 
285
A0
 
286
A1
 
287
A2
 
288
A3
 
289
A4
 
290
A5
 
291
A6
 
292
A7
 
293
A8
 
294
A9
 
295
AA
 
296
AB
 
297
AC
 
298
AD
 
299
AE
 
300
AF
 
301
B
 
302
B0
 
303
B1
 
304
B2
 
305
B3
 
306
B4
 
307
B5
 
308
B6
 
309
B7
 
310
B8
 
311
B9
 
312
BA
 
313
BB
 
314
BC
 
315
BD
 
316
BE
 
317
BF
 
318
C
 
319
C0
 
320
C1
 
321
C2
 
322
C3
 
323
C4
 
324
C5
 
325
C6
 
326
C7
 
327
C8
 
328
C9
 
329
CA
 
330
CB
 
331
CC
 
332
CD
 
333
CE
 
334
CF
 
335
D
 
336
D0
 
337
D1
 
338
D2
 
339
D3
 
340
D4
 
341
D5
 
342
D6
 
343
D7
 
344
D8
 
345
D9
 
346
DA
 
347
DB
 
348
DC
 
349
DD
 
350
DE
 
351
DF
 
352
E
 
353
E0
 
354
E1
 
355
E2
 
356
E3
 
357
E4
 
358
E5
 
359
E6
 
360
E7
 
361
E8
 
362
E9
 
363
EA
 
364
EB
 
365
EC
 
366
ED
 
367
EE
 
368
EF
 
369
F
 
370
F0
 
371
F1
 
372
F2
 
373
F3
 
374
F4
 
375
F5
 
376
F6
 
377
F7
 
378
F8
 
379
F9
 
380
FA
 
381
FB
 
382
FC
 
383
FD
 
384
FE
 
385
FF
 
386
drop table t3;
 
387
create table t4 (a bit(8), primary key (a)) engine='INNODB' 
 
388
partition by list (a) subpartition by key (a) subpartitions 2 (
 
389
partition pa1 values in (0,1,2,3),
 
390
partition pa2 values in (4,5,6,7,8,9,10,11,12,13,14,15,16),
 
391
partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32));
 
392
show create table t4;
 
393
Table   Create Table
 
394
t4      CREATE TABLE `t4` (
 
395
  `a` bit(8) NOT NULL DEFAULT '\0',
 
396
  PRIMARY KEY (`a`)
 
397
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES IN (0,1,2,3) ENGINE = InnoDB, PARTITION pa2 VALUES IN (4,5,6,7,8,9,10,11,12,13,14,15,16) ENGINE = InnoDB, PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = InnoDB) */
 
398
32 inserts;
 
399
select hex(a) from t4 where a=b'00000001';
 
400
hex(a)
 
401
1
 
402
delete from t4 where a=b'00000001';
 
403
select count(*) from t4;
 
404
count(*)
 
405
31
 
406
select hex(a) from t4;
 
407
hex(a)
 
408
10
 
409
11
 
410
12
 
411
13
 
412
14
 
413
15
 
414
16
 
415
17
 
416
18
 
417
19
 
418
1A
 
419
1B
 
420
1C
 
421
1D
 
422
1E
 
423
1F
 
424
2
 
425
20
 
426
3
 
427
4
 
428
5
 
429
6
 
430
7
 
431
8
 
432
9
 
433
A
 
434
B
 
435
C
 
436
D
 
437
E
 
438
F
 
439
drop table t4;