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