2
drop table if exists t1;
3
create table t1 (a bit(65), primary key (a)) engine='MyISAM' 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='MyISAM' partition by key (a);
9
`a` bit(1) NOT NULL DEFAULT '\0',
11
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */
13
create table t1 (a bit(0), primary key (a)) engine='MyISAM'
14
partition by key (a) (
19
t1 CREATE TABLE `t1` (
20
`a` bit(1) NOT NULL DEFAULT '\0',
22
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 ENGINE = MyISAM, PARTITION pa2 ENGINE = MyISAM) */
24
create table t1 (a bit(64), primary key (a)) engine='MyISAM'
25
partition by key (a) partitions 2;
28
t1 CREATE TABLE `t1` (
29
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
31
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 2 */
33
(b'1111111111111111111111111111111111111111111111111111111111111111'),
34
(b'1000000000000000000000000000000000000000000000000000000000000000'),
35
(b'0000000000000000000000000000000000000000000000000000000000000001'),
36
(b'1010101010101010101010101010101010101010101010101010101010101010'),
37
(b'0101010101010101010101010101010101010101010101010101010101010101');
38
select hex(a) from t1;
46
create table t1 (a bit(64), primary key (a)) engine='MyISAM'
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);
54
t1 CREATE TABLE `t1` (
55
`a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
57
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */
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';
67
delete from t1 where a=b'0101010101010101010101010101010101010101010101010101010101010101';
68
select hex(a) from t1;
75
create table t2 (a bit, primary key (a)) engine='MyISAM'
76
partition by key (a) partitions 4;
79
t2 CREATE TABLE `t2` (
80
`a` bit(1) NOT NULL DEFAULT '\0',
82
) ENGINE=MyISAM 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;
88
alter table t2 drop primary key;
91
t2 CREATE TABLE `t2` (
92
`a` bit(1) NOT NULL DEFAULT '\0'
93
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4 */
94
select hex(a) from t2;
98
alter table t2 add primary key (a);
101
t2 CREATE TABLE `t2` (
102
`a` bit(1) NOT NULL DEFAULT '\0',
104
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4 */
105
select hex(a) from t2;
110
create table t3 (a bit(8), primary key (a)) engine='MyISAM'
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;
118
t3 CREATE TABLE `t3` (
119
`a` bit(8) NOT NULL DEFAULT '\0',
121
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (64) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (256) ENGINE = MyISAM) */
123
select hex(a) from t3 where a=b'01010101';
126
delete from t3 where a=b'01010101';
127
select count(*) from t3;
130
select hex(a) from t3;
387
create table t4 (a bit(8), primary key (a)) engine='MyISAM'
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;
394
t4 CREATE TABLE `t4` (
395
`a` bit(8) NOT NULL DEFAULT '\0',
397
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa1 VALUES IN (0,1,2,3) ENGINE = MyISAM, PARTITION pa2 VALUES IN (4,5,6,7,8,9,10,11,12,13,14,15,16) ENGINE = MyISAM, PARTITION pa3 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = MyISAM) */
399
select hex(a) from t4 where a=b'00000001';
402
delete from t4 where a=b'00000001';
403
select count(*) from t4;
406
select hex(a) from t4;