1
create table t1 (a tinyint unsigned not null, primary key(a)) engine='InnoDB'
3
partition pa1 max_rows=20 min_rows=2,
4
partition pa2 max_rows=30 min_rows=3,
5
partition pa3 max_rows=30 min_rows=4,
6
partition pa4 max_rows=40 min_rows=2);
10
`a` tinyint(3) unsigned NOT NULL,
12
) ENGINE=InnoDB DEFAULT CHARSET=latin1
13
/*!50100 PARTITION BY KEY (a)
14
(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
15
PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
16
PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
17
PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
18
insert into t1 values (255), (254), (253), (252), (1), (2), (128);
28
select * from t1 where a=253;
31
delete from t1 where a=253;
41
create table t2 (a tinyint unsigned not null, primary key(a)) engine='InnoDB'
42
partition by key (a) partitions 8;
45
t2 CREATE TABLE `t2` (
46
`a` tinyint(3) unsigned NOT NULL,
48
) ENGINE=InnoDB DEFAULT CHARSET=latin1
49
/*!50100 PARTITION BY KEY (a)
51
insert into t2 values (255), (254), (253), (252);
58
select * from t2 where a=253;
61
delete from t2 where a=253;
69
select count(*) from t2;
73
create table t3 (a tinyint not null, primary key(a)) engine='InnoDB'
74
partition by key (a) partitions 7;
77
t3 CREATE TABLE `t3` (
78
`a` tinyint(4) NOT NULL,
80
) ENGINE=InnoDB DEFAULT CHARSET=latin1
81
/*!50100 PARTITION BY KEY (a)
83
insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0);
95
select * from t3 where a=125;
98
delete from t3 where a=125;
110
create table t1 (a smallint unsigned not null, primary key(a)) engine='InnoDB'
111
partition by key (a) (
112
partition pa1 max_rows=20 min_rows=2,
113
partition pa2 max_rows=30 min_rows=3,
114
partition pa3 max_rows=30 min_rows=4,
115
partition pa4 max_rows=40 min_rows=2);
116
show create table t1;
118
t1 CREATE TABLE `t1` (
119
`a` smallint(5) unsigned NOT NULL,
121
) ENGINE=InnoDB DEFAULT CHARSET=latin1
122
/*!50100 PARTITION BY KEY (a)
123
(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
124
PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
125
PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
126
PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
127
insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256);
137
select * from t1 where a=65533;
140
delete from t1 where a=65533;
150
create table t2 (a smallint unsigned not null, primary key(a)) engine='InnoDB'
151
partition by key (a) partitions 8;
152
show create table t2;
154
t2 CREATE TABLE `t2` (
155
`a` smallint(5) unsigned NOT NULL,
157
) ENGINE=InnoDB DEFAULT CHARSET=latin1
158
/*!50100 PARTITION BY KEY (a)
160
insert into t2 values (65535), (65534), (65533), (65532);
167
select * from t2 where a=65533;
170
delete from t2 where a=65533;
178
select count(*) from t2;
182
create table t3 (a smallint not null, primary key(a)) engine='InnoDB'
183
partition by key (a) partitions 7;
184
show create table t3;
186
t3 CREATE TABLE `t3` (
187
`a` smallint(6) NOT NULL,
189
) ENGINE=InnoDB DEFAULT CHARSET=latin1
190
/*!50100 PARTITION BY KEY (a)
192
insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0);
204
select * from t3 where a=32765;
207
delete from t3 where a=32765;
219
create table t1 (a int unsigned not null, primary key(a)) engine='InnoDB'
220
partition by key (a) (
221
partition pa1 max_rows=20 min_rows=2,
222
partition pa2 max_rows=30 min_rows=3,
223
partition pa3 max_rows=30 min_rows=4,
224
partition pa4 max_rows=40 min_rows=2);
225
show create table t1;
227
t1 CREATE TABLE `t1` (
228
`a` int(10) unsigned NOT NULL,
230
) ENGINE=InnoDB DEFAULT CHARSET=latin1
231
/*!50100 PARTITION BY KEY (a)
232
(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
233
PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
234
PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
235
PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
236
insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535);
246
select * from t1 where a=4294967293;
249
delete from t1 where a=4294967293;
259
create table t2 (a int unsigned not null, primary key(a)) engine='InnoDB'
260
partition by key (a) partitions 8;
261
show create table t2;
263
t2 CREATE TABLE `t2` (
264
`a` int(10) unsigned NOT NULL,
266
) ENGINE=InnoDB DEFAULT CHARSET=latin1
267
/*!50100 PARTITION BY KEY (a)
269
insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292);
276
select * from t2 where a=4294967293;
279
delete from t2 where a=4294967293;
287
select count(*) from t2;
291
create table t3 (a int not null, primary key(a)) engine='InnoDB'
292
partition by key (a) partitions 7;
293
show create table t3;
295
t3 CREATE TABLE `t3` (
296
`a` int(11) NOT NULL,
298
) ENGINE=InnoDB DEFAULT CHARSET=latin1
299
/*!50100 PARTITION BY KEY (a)
301
insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0);
313
select * from t3 where a=2147483645;
316
delete from t3 where a=2147483645;
328
create table t1 (a mediumint unsigned not null, primary key(a)) engine='InnoDB'
329
partition by key (a) (
330
partition pa1 max_rows=20 min_rows=2,
331
partition pa2 max_rows=30 min_rows=3,
332
partition pa3 max_rows=30 min_rows=4,
333
partition pa4 max_rows=40 min_rows=2);
334
show create table t1;
336
t1 CREATE TABLE `t1` (
337
`a` mediumint(8) unsigned NOT NULL,
339
) ENGINE=InnoDB DEFAULT CHARSET=latin1
340
/*!50100 PARTITION BY KEY (a)
341
(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
342
PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
343
PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
344
PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
345
insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535);
355
select * from t1 where a=16777213;
358
delete from t1 where a=16777213;
368
create table t2 (a mediumint unsigned not null, primary key(a)) engine='InnoDB'
369
partition by key (a) partitions 8;
370
show create table t2;
372
t2 CREATE TABLE `t2` (
373
`a` mediumint(8) unsigned NOT NULL,
375
) ENGINE=InnoDB DEFAULT CHARSET=latin1
376
/*!50100 PARTITION BY KEY (a)
378
insert into t2 values (16777215), (16777214), (16777213), (16777212);
385
select * from t2 where a=16777213;
388
delete from t2 where a=16777213;
396
select count(*) from t2;
400
create table t3 (a mediumint not null, primary key(a)) engine='InnoDB'
401
partition by key (a) partitions 7;
402
show create table t3;
404
t3 CREATE TABLE `t3` (
405
`a` mediumint(9) NOT NULL,
407
) ENGINE=InnoDB DEFAULT CHARSET=latin1
408
/*!50100 PARTITION BY KEY (a)
410
insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0);
422
select * from t3 where a=8388605;
425
delete from t3 where a=8388605;
437
create table t1 (a bigint unsigned not null, primary key(a)) engine='InnoDB'
438
partition by key (a) (
439
partition pa1 max_rows=20 min_rows=2,
440
partition pa2 max_rows=30 min_rows=3,
441
partition pa3 max_rows=30 min_rows=4,
442
partition pa4 max_rows=40 min_rows=2);
443
show create table t1;
445
t1 CREATE TABLE `t1` (
446
`a` bigint(20) unsigned NOT NULL,
448
) ENGINE=InnoDB DEFAULT CHARSET=latin1
449
/*!50100 PARTITION BY KEY (a)
450
(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB,
451
PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB,
452
PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB,
453
PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
454
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535);
464
select * from t1 where a=-2;
466
delete from t1 where a=-2;
476
select * from t1 where a=18446744073709551615;
479
delete from t1 where a=18446744073709551615;
489
create table t2 (a bigint unsigned not null, primary key(a)) engine='InnoDB'
490
partition by key (a) partitions 8;
491
show create table t2;
493
t2 CREATE TABLE `t2` (
494
`a` bigint(20) unsigned NOT NULL,
496
) ENGINE=InnoDB DEFAULT CHARSET=latin1
497
/*!50100 PARTITION BY KEY (a)
499
insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
506
select * from t2 where a=18446744073709551615;
509
delete from t2 where a=18446744073709551615;
517
select count(*) from t2;
521
create table t3 (a bigint not null, primary key(a)) engine='InnoDB'
522
partition by key (a) partitions 7;
523
show create table t3;
525
t3 CREATE TABLE `t3` (
526
`a` bigint(20) NOT NULL,
528
) ENGINE=InnoDB DEFAULT CHARSET=latin1
529
/*!50100 PARTITION BY KEY (a)
531
insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0);
543
select * from t3 where a=9223372036854775806;
546
delete from t3 where a=9223372036854775806;