Debian Codegraph @

mysql-test/suite/parts/inc/partition_bit.inc

raw
1 --disable_warnings
2 drop table if exists t1;
3 --enable_warnings
4
5 --error ER_TOO_BIG_DISPLAYWIDTH
6 eval create table t1 (a bit(65), primary key (a)) engine=$engine partition by key (a);
7
8 --error ER_INVALID_FIELD_SIZE
9 eval create table t1 (a bit(0), primary key (a)) engine=$engine partition by key (a);
10
11 --error ER_INVALID_FIELD_SIZE
12 eval create table t1 (a bit(0), primary key (a)) engine=$engine
13 partition by key (a) (
14 partition pa1,
15 partition pa2);
16
17 eval create table t1 (a bit(64), primary key (a)) engine=$engine
18 partition by key (a) partitions 2;
19 show create table t1;
20 insert into t1 values
21 (b'1111111111111111111111111111111111111111111111111111111111111111'),
22 (b'1000000000000000000000000000000000000000000000000000000000000000'),
23 (b'0000000000000000000000000000000000000000000000000000000000000001'),
24 (b'1010101010101010101010101010101010101010101010101010101010101010'),
25 (b'0101010101010101010101010101010101010101010101010101010101010101');
26 --sorted_result
27 select hex(a) from t1;
28 drop table t1;
29
30 eval create table t1 (a bit(64), primary key (a)) engine=$engine
31 partition by key (a) (
32 partition pa1 max_rows=20 min_rows=2,
33 partition pa2 max_rows=30 min_rows=3,
34 partition pa3 max_rows=30 min_rows=4,
35 partition pa4 max_rows=40 min_rows=2);
36 show create table t1;
37 insert into t1 values
38 (b'1111111111111111111111111111111111111111111111111111111111111111'),
39 (b'1000000000000000000000000000000000000000000000000000000000000000'),
40 (b'0000000000000000000000000000000000000000000000000000000000000001'),
41 (b'1010101010101010101010101010101010101010101010101010101010101010'),
42 (b'0101010101010101010101010101010101010101010101010101010101010101');
43 select hex(a) from t1 where a=b'0101010101010101010101010101010101010101010101010101010101010101';
44 delete from t1 where a=b'0101010101010101010101010101010101010101010101010101010101010101';
45 --sorted_result
46 select hex(a) from t1;
47 drop table t1;
48
49 eval create table t2 (a bit, primary key (a)) engine=$engine
50 partition by key (a) partitions 4;
51 show create table t2;
52 insert into t2 values (b'0'), (b'1');
53 --sorted_result
54 select hex(a) from t2;
55 alter table t2 drop primary key;
56 show create table t2;
57 --sorted_result
58 select hex(a) from t2;
59 alter table t2 add primary key (a);
60 show create table t2;
61 --sorted_result
62 select hex(a) from t2;
63 drop table t2;
64
65 eval create table t3 (a bit(8), primary key (a)) engine=$engine
66 partition by range (a) subpartition by key (a) subpartitions 2 (
67 partition pa1 values less than (3),
68 partition pa2 values less than (16),
69 partition pa3 values less than (64),
70 partition pa4 values less than (256));
71 show create table t3;
72 let $count=255;
73 --echo $count inserts;
74 --disable_query_log
75 while ($count)
76 {
77 eval insert into t3 values ($count);
78 dec $count;
79 }
80 --enable_query_log
81 select hex(a) from t3 where a=b'01010101';
82 delete from t3 where a=b'01010101';
83 select count(*) from t3;
84 --sorted_result
85 select hex(a) from t3;
86 drop table t3;
87
88 eval create table t4 (a bit(8), primary key (a)) engine=$engine
89 partition by list (a) subpartition by key (a) subpartitions 2 (
90 partition pa1 values in (0,1,2,3),
91 partition pa2 values in (4,5,6,7,8,9,10,11,12,13,14,15,16),
92 partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32));
93 show create table t4;
94 let $count=32;
95 --echo $count inserts;
96 --disable_query_log
97 while ($count)
98 {
99 eval insert into t4 values ($count);
100 dec $count;
101 }
102 --enable_query_log
103 select hex(a) from t4 where a=b'00000001';
104 delete from t4 where a=b'00000001';
105 select count(*) from t4;
106 --sorted_result
107 select hex(a) from t4;
108 drop table t4;