Debian Codegraph @

mysql-test/suite/ndb/t/ndb_bitfield.test

raw
1 -- source include/have_ndb.inc
2
3 create table t1 (
4 pk1 int not null primary key,
5 b bit(64)
6 ) engine=ndbcluster;
7
8 show create table t1;
9
10 insert into t1 values
11 (0,b'1111111111111111111111111111111111111111111111111111111111111111'),
12 (1,b'1000000000000000000000000000000000000000000000000000000000000000'),
13 (2,b'0000000000000000000000000000000000000000000000000000000000000001'),
14 (3,b'1010101010101010101010101010101010101010101010101010101010101010'),
15 (4,b'0101010101010101010101010101010101010101010101010101010101010101');
16 select hex(b) from t1 order by pk1;
17 drop table t1;
18
19 create table t1 (
20 pk1 int not null primary key,
21 b bit(9)
22 ) engine=ndbcluster;
23 insert into t1 values
24 (0,b'000000000'),
25 (1,b'000000001'),
26 (2,b'000000010'),
27 (3,b'000000011'),
28 (4,b'000000100');
29 select hex(b) from t1 order by pk1;
30 update t1 set b = b + b'101010101';
31 select hex(b) from t1 order by pk1;
32 drop table t1;
33
34 create table t1 (a bit(7), b bit(9)) engine = ndbcluster;
35 insert into t1 values
36 (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),
37 (75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),
38 (111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),
39 (116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),
40 (30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),
41 (44, 307), (68, 454), (57, 135);
42 select a+0 from t1 order by a;
43 select b+0 from t1 order by b;
44 drop table t1;
45
46 create table t1 (
47 dummyKey INTEGER NOT NULL,
48 a001 TINYINT,
49 a010 TINYINT,
50 a012 TINYINT,
51 a015 TINYINT,
52 a016 TINYINT,
53 a017 TINYINT,
54 a019 TINYINT,
55 a029 TINYINT,
56 a030 TINYINT,
57 a031 TINYINT,
58 a032 TINYINT,
59 a042 TINYINT,
60 a043 TINYINT,
61 a044 TINYINT,
62 a3001 TINYINT,
63 a3002 TINYINT,
64 a3003 TINYINT,
65 a3004 TINYINT,
66 a3005 TINYINT,
67 a3021 TINYINT,
68 a3022 TINYINT,
69 a BIT(6),
70 b BIT(6),
71 c BIT(6),
72 d TINYINT,
73 e TINYINT,
74 f TINYINT,
75 g TINYINT,
76 h TINYINT,
77 i TINYINT,
78 j TINYINT,
79 k TINYINT,
80 l TINYINT,
81 m TINYINT,
82 n TINYINT,
83 o TINYINT,
84 a034 TINYINT,
85 PRIMARY KEY USING HASH (dummyKey) ) engine=ndb;
86 INSERT INTO `t1` VALUES
87 (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000001',b'111111',b'111110',4,5,5,5,5,5,5,5,5,5,3,2,1),
88 (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000010',b'000000',b'111101',4,5,5,5,5,5,5,5,5,5,3,2,1),
89 (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000100',b'001111',b'111011',4,5,5,5,5,5,5,5,5,5,3,2,1),
90 (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'001000',b'110000',b'110111',4,5,5,5,5,5,5,5,5,5,3,2,1),
91 (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'010000',b'100001',b'101111',4,5,5,5,5,5,5,5,5,5,3,2,1),
92 (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'100000',b'010010',b'011111',4,5,5,5,5,5,5,5,5,5,3,2,1),
93 (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'001100',b'111111',4,5,5,5,5,5,5,5,5,5,3,2,1),
94 (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
95 --exec $MYSQL_DUMP --hex-blob --compact --order-by-primary --skip-extended-insert --no-create-info test t1
96
97 select a001, a010, a012, a015, a016, a017, a019, a029
98 a030, a031, a032, a042, a043, a044, a3001, a3002,
99 a3003, a3004, a3005, a3021, a3022, hex(a), hex(b), hex(c),
100 d, e, f, g, h, i, j, k, l, m, n, o, a034
101 from t1
102 order by dummyKey;
103
104 select a001, a010, a012, a015, a016, a017, a019, a029
105 a030, a031, a032, a042, a043, a044, a3001, a3002,
106 a3003, a3004, a3005, a3021, a3022, hex(a), hex(b), hex(c),
107 d, e, f, g, h, i, j, k, l, m, n, o, a034
108 from t1 where dummyKey = 1;
109
110 drop table t1;
111
112 --error ER_CANT_CREATE_TABLE
113 create table t1 (
114 pk1 bit(9) not null primary key,
115 b int
116 ) engine=ndbcluster;
117 show warnings;
118
119 --error ER_CANT_CREATE_TABLE
120 create table t1 (
121 pk1 int not null primary key,
122 b bit(9),
123 key(b)
124 ) engine=ndbcluster;
125 show warnings;
126
127 # bug#16125
128 create table t1 (
129 pk1 int primary key,
130 b bit(32) not null
131 ) engine=ndbcluster;
132
133 insert into t1 values (1,1);
134 drop table t1;
135
136 # Bug#42046 MySQL Cluster : Too many BIT columns causes cluster failure
137
138 --error ER_CANT_CREATE_TABLE
139 create table bigbits ( k int unsigned primary key, c1 bit(64), c2 bit(64), c3 bit(64), c4 bit(64), c5 bit(64), c6 bit(64), c7 bit(64), c8 bit(64), c9 bit(64), c10 bit(64), c11 bit(64), c12 bit(64), c13 bit(64), c14 bit(64), c15 bit(64), c16 bit(64), c17 bit(64), c18 bit(64), c19 bit(64), c20 bit(64), c21 bit(64), c22 bit(64), c23 bit(64), c24 bit(64), c25 bit(64), c26 bit(64), c27 bit(64), c28 bit(64), c29 bit(64), c30 bit(64), c31 bit(64), c32 bit(64), c33 bit(64), c34 bit(64), c35 bit(64), c36 bit(64), c37 bit(64), c38 bit(64), c39 bit(64), c40 bit(64), c41 bit(64), c42 bit(64), c43 bit(64), c44 bit(64), c45 bit(64), c46 bit(64), c47 bit(64), c48 bit(64), c49 bit(64), c50 bit(64), c51 bit(64), c52 bit(64), c53 bit(64), c54 bit(64), c55 bit(64), c56 bit(64), c57 bit(64), c58 bit(64), c59 bit(64), c60 bit(64), c61 bit(64), c62 bit(64), c63 bit(64), c64 bit(64), c65 bit(64), c66 bit(64), c67 bit(64), c68 bit(64), c69 bit(64), c70 bit(64), c71 bit(64), c72 bit(64), c73 bit(64), c74 bit(64), c75 bit(64), c76 bit(64), c77 bit(64), c78 bit(64), c79 bit(64), c80 bit(64), c81 bit(64), c82 bit(64), c83 bit(64), c84 bit(64), c85 bit(64), c86 bit(64), c87 bit(64), c88 bit(64), c89 bit(64), c90 bit(64), c91 bit(64), c92 bit(64), c93 bit(64), c94 bit(64), c95 bit(64), c96 bit(64), c97 bit(64), c98 bit(64), c99 bit(64), c100 bit(64), c101 bit(64), c102 bit(64), c103 bit(64), c104 bit(64), c105 bit(64), c106 bit(64), c107 bit(64), c108 bit(64), c109 bit(64), c110 bit(64), c111 bit(64), c112 bit(64), c113 bit(64), c114 bit(64), c115 bit(64), c116 bit(64), c117 bit(64), c118 bit(64), c119 bit(64), c120 bit(64), c121 bit(64), c122 bit(64), c123 bit(64), c124 bit(64), c125 bit(64), c126 bit(64)) engine=ndb;
140 --error ER_CANT_CREATE_TABLE
141 create table bigbits ( k int unsigned primary key, c1 bit(64) column_format
142 dynamic, c2 bit(64) column_format dynamic, c3 bit(64) column_format dynamic,
143 c4 bit(64) column_format dynamic, c5 bit(64) column_format dynamic, c6
144 bit(64) column_format dynamic, c7 bit(64) column_format dynamic, c8 bit(64)
145 column_format dynamic, c9 bit(64) column_format dynamic, c10 bit(64)
146 column_format dynamic, c11 bit(64) column_format dynamic, c12 bit(64)
147 column_format dynamic, c13 bit(64) column_format dynamic, c14 bit(64)
148 column_format dynamic, c15 bit(64) column_format dynamic, c16 bit(64)
149 column_format dynamic, c17 bit(64) column_format dynamic, c18 bit(64)
150 column_format dynamic, c19 bit(64) column_format dynamic, c20 bit(64)
151 column_format dynamic, c21 bit(64) column_format dynamic, c22 bit(64)
152 column_format dynamic, c23 bit(64) column_format dynamic, c24 bit(64)
153 column_format dynamic, c25 bit(64) column_format dynamic, c26 bit(64)
154 column_format dynamic, c27 bit(64) column_format dynamic, c28 bit(64)
155 column_format dynamic, c29 bit(64) column_format dynamic, c30 bit(64)
156 column_format dynamic, c31 bit(64) column_format dynamic, c32 bit(64)
157 column_format dynamic, c33 bit(64) column_format dynamic, c34 bit(64)
158 column_format dynamic, c35 bit(64) column_format dynamic, c36 bit(64)
159 column_format dynamic, c37 bit(64) column_format dynamic, c38 bit(64)
160 column_format dynamic, c39 bit(64) column_format dynamic, c40 bit(64)
161 column_format dynamic, c41 bit(64) column_format dynamic, c42 bit(64)
162 column_format dynamic, c43 bit(64) column_format dynamic, c44 bit(64)
163 column_format dynamic, c45 bit(64) column_format dynamic, c46 bit(64)
164 column_format dynamic, c47 bit(64) column_format dynamic, c48 bit(64)
165 column_format dynamic, c49 bit(64) column_format dynamic, c50 bit(64)
166 column_format dynamic, c51 bit(64) column_format dynamic, c52 bit(64)
167 column_format dynamic, c53 bit(64) column_format dynamic, c54 bit(64)
168 column_format dynamic, c55 bit(64) column_format dynamic, c56 bit(64)
169 column_format dynamic, c57 bit(64) column_format dynamic, c58 bit(64)
170 column_format dynamic, c59 bit(64) column_format dynamic, c60 bit(64)
171 column_format dynamic, c61 bit(64) column_format dynamic, c62 bit(64)
172 column_format dynamic, c63 bit(64) column_format dynamic) engine=ndb;
173 show warnings;