~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
SET @max_row = 20;
create table t1 (a bit(65), primary key (a)) partition by key (a);
ERROR 42000: Display width out of range for column 'a' (max = 64)
create table t1 (a bit(0), primary key (a)) partition by key (a);
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` bit(1) NOT NULL DEFAULT '\0',
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a)  */
drop table t1;
create table t1 (a bit(0), primary key (a)) partition by key (a) (
partition pa1 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp',
partition pa2 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp');
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` bit(1) NOT NULL DEFAULT '\0',
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
drop table t1;
create table t1 (a bit(64), primary key (a)) partition by key (a);
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a)  */
insert into t1 values 
(b'1111111111111111111111111111111111111111111111111111111111111111'),
(b'1000000000000000000000000000000000000000000000000000000000000000'),
(b'0000000000000000000000000000000000000000000000000000000000000001'),
(b'1010101010101010101010101010101010101010101010101010101010101010'),
(b'0101010101010101010101010101010101010101010101010101010101010101');
select hex(a) from t1;
hex(a)
1
5555555555555555
8000000000000000
AAAAAAAAAAAAAAAA
FFFFFFFFFFFFFFFF
drop table t1;
create table t1 (a bit(64), primary key (a)) partition by key (a)(
partition pa1 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp' max_rows=20 min_rows=2,
partition pa2 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp' max_rows=30 min_rows=3,
partition pa3 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp' max_rows=30 min_rows=4,
partition pa4 DATA DIRECTORY =
'/tmp' INDEX DIRECTORY =
'/tmp' max_rows=40 min_rows=2);
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
insert into t1 values 
(b'1111111111111111111111111111111111111111111111111111111111111111'),
(b'1000000000000000000000000000000000000000000000000000000000000000'),
(b'0000000000000000000000000000000000000000000000000000000000000001'),
(b'1010101010101010101010101010101010101010101010101010101010101010'),
(b'0101010101010101010101010101010101010101010101010101010101010101');
select hex(a) from t1;
hex(a)
1
5555555555555555
8000000000000000
AAAAAAAAAAAAAAAA
FFFFFFFFFFFFFFFF
drop table t1;
create table t1 (a bit, primary key (a)) partition by key (a);
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` bit(1) NOT NULL DEFAULT '\0',
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a)  */
insert into t1 values (b'0'), (b'1');
select hex(a) from t1;
hex(a)
0
1
alter table t1 drop primary key;
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` bit(1) NOT NULL DEFAULT '\0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a)  */
select hex(a) from t1;
hex(a)
0
1
alter table t1 add primary key (a);
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` bit(1) NOT NULL DEFAULT '\0',
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a)  */
select hex(a) from t1;
hex(a)
0
1
drop table t1;