Debian Codegraph @

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

raw
1 -- source include/have_ndb.inc
2 --echo # We are using some debug-only features in this test
3 -- source include/have_debug.inc
4 -- source have_ndb_error_insert.inc
5 --disable_query_log
6 call mtr.add_suppression("Failed to drop fk");
7 call mtr.add_suppression("Failed to list dependent objects for table");
8 --enable_query_log
9
10 # Magically turn off metadata compare since it causes tables and indexes to
11 # be loaded from NDB in an order which is not expected by this test.
12 # For example the test assumes that GET_TABINFOREQ should fail during drop
13 # of table t2, but since t2 table def has already been loaded when comparing
14 # metadata there is no GET_TABINFOREQ signal sent during the drop. This means
15 # there is no timeout and MySQL Server continues with committing the schema
16 # transaction and a hang occurs in NDB since GET_TABINFOREQ is still delayed
17 # endlessly
18 SET SESSION debug="+d,ndb_metadata_compare_skip";
19
20 --echo # bulk delete with timeout error 4012
21 create table t4(id int primary key, val int) engine=ndb;
22 insert into t4 values (1,1), (2,2), (3,3), (4,4), (5,5);
23 --exec $NDB_MGM -e "all error 8108" >> $NDB_TOOLS_OUTPUT
24 set @save_debug = @@session.debug;
25 --echo # Error injection in Ndb::waitCompletedTransactions so that transaction times out quickly
26 SET SESSION debug="+d,early_trans_timeout";
27 --error ER_GET_ERRMSG
28 delete from t4 where id > 0;
29 SET SESSION debug=@save_debug;
30 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
31 drop table t4;
32
33 --echo # bulk delete ignore with timeout error 4012
34 create table t4(id int primary key, val int) engine=ndb;
35 insert into t4 values (1,1), (2,2), (3,3), (4,4), (5,5);
36 --exec $NDB_MGM -e "all error 8108" >> $NDB_TOOLS_OUTPUT
37 set @save_debug = @@session.debug;
38 --echo # Error injection in Ndb::waitCompletedTransactions so that transaction times out quickly
39 SET SESSION debug="+d,early_trans_timeout";
40 # The statement fails although it's using IGNORE since the provoked error is
41 # not in the list of errors to IGNORE, see Ignore_error_handler
42 --error ER_GET_ERRMSG
43 delete ignore from t4 where id > 0;
44 SET SESSION debug=@save_debug;
45 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
46 drop table t4;
47
48 --echo # bulk update with timeout error 4012
49 create table t4(id int primary key, val int) engine=ndb;
50 insert into t4 values (1,1), (2,2), (3,3), (4,4), (5,5);
51 --exec $NDB_MGM -e "all error 8108" >> $NDB_TOOLS_OUTPUT
52 set @save_debug = @@session.debug;
53 --echo # Error injection in Ndb::waitCompletedTransactions so that transaction times out quickly
54 SET SESSION debug="+d,early_trans_timeout";
55 --error ER_GET_ERRMSG
56 update t4 set val = 0 where id > 0;
57 SET SESSION debug=@save_debug;
58 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
59 drop table t4;
60
61 --echo # bulk update ignore is not possible because 'ignore' disables bulk updates
62
63 --echo # mysqld gets timeout error 4008 on GET_TABINFOREQ for table create
64
65 --exec $NDB_MGM -e "all error 6216" >> $NDB_TOOLS_OUTPUT
66 set @save_debug = @@session.debug;
67 SET SESSION debug="+d,ndb_dictsignal_timeout";
68 --error ER_NDB_REPLICATION_SCHEMA_ERROR
69 create table t1(id int primary key, val int)engine=ndb;
70 show warnings;
71 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
72 SET SESSION debug=@save_debug;
73
74 --echo # mysqld gets timeout error 4008 on GET_TABINFOREQ for table drop
75 create table t2(id int primary key, val int)engine=ndb;
76 --exec $NDB_MGM -e "all error 6216" >> $NDB_TOOLS_OUTPUT
77 set @save_debug = @@session.debug;
78 SET SESSION debug="+d,ndb_dictsignal_timeout";
79 --error ER_ENGINE_CANT_DROP_TABLE
80 drop table t2;
81 show warnings;
82 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
83 SET SESSION debug=@save_debug;
84 drop table t2;
85
86 --echo # mysqld gets timeout error 1008 on GET_TABINFOREQ for index create
87 create table t3(id int primary key, val int)engine=ndb;
88 --exec $NDB_MGM -e "all error 6216" >> $NDB_TOOLS_OUTPUT
89 set @save_debug = @@session.debug;
90 SET SESSION debug="+d,ndb_dictsignal_timeout";
91 --error ER_GET_ERRMSG
92 create unique index val_unq on t3(val);
93 show warnings;
94 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
95 SET SESSION debug=@save_debug;
96 drop table t3;
97
98 --echo # mysqld gets timeout error 4008 on GET_TABINFOREQ for index drop
99 create table t4(id int primary key, val int, unique key val_unq(val))engine=ndb;
100 --exec $NDB_MGM -e "all error 6216" >> $NDB_TOOLS_OUTPUT
101 set @save_debug = @@session.debug;
102 SET SESSION debug="+d,ndb_dictsignal_timeout";
103 --error ER_GET_ERRMSG
104 drop index val_unq on t4;
105 show warnings;
106 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
107 SET SESSION debug=@save_debug;
108 drop table t4;
109
110 --echo # mysqld gets timeout error 4008 on GET_TABINFOREQ for hashmap
111 create table t1(id int primary key, val int)engine=ndb;
112 --exec $NDB_MGM -e "all error 6216" >> $NDB_TOOLS_OUTPUT
113 SET SESSION debug="+d,ndb_dictsignal_timeout";
114 --error ER_GET_ERRMSG
115 alter table t1 add partition partitions 2;
116 show warnings;
117 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
118 SET SESSION debug=@save_debug;
119 drop table t1;
120
121 --echo # mysqld gets timeout error 4008 on GET_TABINFOREQ for foreign key
122 create table t1(id int primary key, val int) engine=ndb;
123 create table t2(id int primary key, id2 int, constraint t2_fk foreign key(id2) references t1(id))engine=ndb;
124 --exec $NDB_MGM -e "all error 6216" >> $NDB_TOOLS_OUTPUT
125 SET SESSION debug="+d,ndb_dictsignal_timeout";
126 --error ER_GET_ERRMSG
127 alter table t2 algorithm=inplace, drop foreign key t2_fk;
128 show warnings;
129 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
130 SET SESSION debug=@save_debug;
131 drop table t2;
132 drop table t1;
133
134 create logfile group lg1 add undofile 'undo1.dat' engine=ndb;
135 create tablespace ts1 add datafile 'data1.dat' use logfile group lg1 engine=ndb;
136 --echo # mysqld gets timeout error 4008 on GET_TABINFOREQ for file
137 --exec $NDB_MGM -e "all error 6216" >> $NDB_TOOLS_OUTPUT
138 set @save_debug = @@session.debug;
139 SET SESSION debug="+d,ndb_dictsignal_timeout";
140 --error ER_ALTER_FILEGROUP_FAILED
141 alter tablespace ts1 drop datafile 'data1.dat';
142 show warnings;
143 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
144 SET SESSION debug=@save_debug;
145
146 --echo # mysqld gets timeout error 4008 on GET_TABINFOREQ for filegroup
147 --exec $NDB_MGM -e "all error 6216" >> $NDB_TOOLS_OUTPUT
148 set @save_debug = @@session.debug;
149 SET SESSION debug="+d,ndb_dictsignal_timeout";
150 --error ER_ALTER_FILEGROUP_FAILED
151 alter logfile group lg1 add undofile 'undo2.dat' engine=ndb;
152 show warnings;
153 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
154 SET SESSION debug=@save_debug;
155 alter tablespace ts1 drop datafile 'data1.dat';
156 drop tablespace ts1;
157 drop logfile group lg1 engine=ndb;
158
159 --echo # mysqld gets timeout error 4008 on CREATE_TABLE_REQ
160 --exec $NDB_MGM -e "all error 6217" >> $NDB_TOOLS_OUTPUT
161 set @save_debug = @@session.debug;
162 SET SESSION debug="+d,ndb_dictsignal_timeout";
163 --error ER_CANT_CREATE_TABLE
164 create table t1(id int primary key, val int)engine=ndb;
165 show warnings;
166 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
167 SET SESSION debug=@save_debug;
168
169 --echo # mysqld gets timeout error 4008 on ALTER_TAB_REQ
170 create table t1(id int primary key, val int) engine=ndb;
171 --exec $NDB_MGM -e "all error 6217" >> $NDB_TOOLS_OUTPUT
172 SET SESSION debug="+d,ndb_dictsignal_timeout";
173 --error ER_GET_ERRMSG
174 alter table t1 add partition partitions 2;
175 show warnings;
176 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
177 SET SESSION debug=@save_debug;
178 drop table t1;
179
180 --echo # mysqld gets timeout error 4008 on DROP_TAB_REQ for table drop
181 create table t1(id int primary key, val int) engine=ndb;
182 --exec $NDB_MGM -e "all error 6217" >> $NDB_TOOLS_OUTPUT
183 SET SESSION debug="+d,ndb_dictsignal_timeout";
184 --error ER_ENGINE_CANT_DROP_TABLE
185 drop table t1;
186 show warnings;
187 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
188 SET SESSION debug=@save_debug;
189 drop table t1;
190
191 --echo # mysqld gets timeout error 4008 on CREATE_INDX_REQ
192 create table t1(id int primary key, val int) engine=ndb;
193 --exec $NDB_MGM -e "all error 6218" >> $NDB_TOOLS_OUTPUT
194 set @save_debug = @@session.debug;
195 SET SESSION debug="+d,ndb_dictsignal_timeout";
196 --error ER_GET_ERRMSG
197 create unique index val_unq on t1(val);
198 show warnings;
199 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
200 SET SESSION debug=@save_debug;
201 drop table t1;
202
203 --echo # mysqld gets timeout error 4008 on DROP_INDX_REQ
204 create table t1(id int primary key, val int, unique key val_unq(val))engine=ndb;
205 --exec $NDB_MGM -e "all error 6219" >> $NDB_TOOLS_OUTPUT
206 set @save_debug = @@session.debug;
207 SET SESSION debug="+d,ndb_dictsignal_timeout";
208 --error ER_GET_ERRMSG
209 drop index val_unq on t1;
210 show warnings;
211 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
212 SET SESSION debug=@save_debug;
213 drop table t1;
214
215 --echo # mysqld gets timeout error 4008 on CREATE_FILEGROUP_REQ
216 --exec $NDB_MGM -e "all error 6218" >> $NDB_TOOLS_OUTPUT
217 set @save_debug = @@session.debug;
218 SET SESSION debug="+d,ndb_dictsignal_timeout";
219 --error ER_CREATE_FILEGROUP_FAILED
220 create logfile group lg1 add undofile 'undo1.dat' engine=ndb;
221 show warnings;
222 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
223 SET SESSION debug=@save_debug;
224
225 --echo # mysqld gets timeout error 4008 on DROP_FILEGROUP_REQ
226 create logfile group lg1 add undofile 'undo1.dat' engine=ndb;
227 --exec $NDB_MGM -e "all error 6219" >> $NDB_TOOLS_OUTPUT
228 set @save_debug = @@session.debug;
229 SET SESSION debug="+d,ndb_dictsignal_timeout";
230 --error ER_DROP_FILEGROUP_FAILED
231 drop logfile group lg1 engine=ndb;
232 show warnings;
233 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
234 SET SESSION debug=@save_debug;
235 drop logfile group lg1 engine=ndb;
236
237 --echo # mysqld gets timeout error 4008 on CREATE_FK_REQ for foreign key
238 create table t1(id int primary key, val int) engine=ndb;
239 create table t2(id int primary key, val int) engine=ndb;
240 --exec $NDB_MGM -e "all error 6218" >> $NDB_TOOLS_OUTPUT
241 SET SESSION debug="+d,ndb_dictsignal_timeout";
242 --error ER_GET_ERRMSG
243 alter table t2 add constraint foreign key (id) references t1(id);
244 show warnings;
245 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
246 SET SESSION debug=@save_debug;
247 drop table t2;
248 drop table t1;
249
250 --echo # mysqld gets timeout error 4008 on DROP_FK_REQ for foreign key
251 create table t1(id int primary key, val int) engine=ndb;
252 create table t2(id int primary key, id2 int, constraint t2_fk foreign key(id2) references t1(id))engine=ndb;
253 --exec $NDB_MGM -e "all error 6219" >> $NDB_TOOLS_OUTPUT
254 SET SESSION debug="+d,ndb_dictsignal_timeout";
255 --error ER_GET_ERRMSG
256 alter table t2 algorithm=inplace, drop foreign key t2_fk;
257 --replace_regex /fk '[0-9]+\/[0-9]+/fk 'X\/X/
258 show warnings;
259 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
260 SET SESSION debug=@save_debug;
261 drop table t2;
262 drop table t1;
263
264 --echo # mysqld gets timeout error 4008 on CREATE_FILE_REQ
265 create logfile group lg1 add undofile 'undo1.dat' engine=ndb;
266 create tablespace ts1 add datafile 'data1.dat' use logfile group lg1 engine=ndb;
267 --exec $NDB_MGM -e "all error 6218" >> $NDB_TOOLS_OUTPUT
268 set @save_debug = @@session.debug;
269 SET SESSION debug="+d,ndb_dictsignal_timeout";
270 --error ER_ALTER_FILEGROUP_FAILED
271 alter tablespace ts1 add datafile 'data2.dat';
272 show warnings;
273 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
274 SET SESSION debug=@save_debug;
275 alter tablespace ts1 drop datafile 'data1.dat';
276 drop tablespace ts1;
277 drop logfile group lg1 engine=ndb;
278
279 --echo # mysqld gets timeout error 4008 on DROP_FILE_REQ
280 create logfile group lg1 add undofile 'undo1.dat' engine=ndb;
281 create tablespace ts1 add datafile 'data1.dat' use logfile group lg1 engine=ndb;
282 --exec $NDB_MGM -e "all error 6219" >> $NDB_TOOLS_OUTPUT
283 set @save_debug = @@session.debug;
284 SET SESSION debug="+d,ndb_dictsignal_timeout";
285 --error ER_ALTER_FILEGROUP_FAILED
286 alter tablespace ts1 drop datafile 'data1.dat';
287 show warnings;
288 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
289 SET SESSION debug=@save_debug;
290 alter tablespace ts1 drop datafile 'data1.dat';
291 drop tablespace ts1;
292 drop logfile group lg1 engine=ndb;
293
294 --echo # mysqld gets timeout error 4008 on CREATE_HASH_MAP_REQ
295 --exec $NDB_MGM -e "all error 6222" >> $NDB_TOOLS_OUTPUT
296 set @save_debug = @@session.debug;
297 SET SESSION debug="+d,ndb_dictsignal_timeout";
298 --error ER_CANT_CREATE_TABLE
299 create table t1(id int primary key, val int) engine=ndb;
300 show warnings;
301 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
302 SET SESSION debug=@save_debug;
303
304 --echo # mysqld gets timeout error 4008 on LIST_TABLES_REQ
305 create table t1(id int primary key, val int) engine=ndb;
306 --exec $NDB_MGM -e "all error 6220" >> $NDB_TOOLS_OUTPUT
307 set @save_debug = @@session.debug;
308 SET SESSION debug="+d,ndb_dictsignal_timeout";
309 --error ER_ENGINE_CANT_DROP_TABLE
310 drop table if exists t1;
311 show warnings;
312 --exec $NDB_MGM -e "all error 0" >> $NDB_TOOLS_OUTPUT
313 SET SESSION debug=@save_debug;
314 drop table t1;
315
316 --echo # mysqld gets timeout 4013 while opening index
317 create table t1(id int primary key, val int unique) engine=ndb;
318 set @save_debug = @@session.debug;
319 SET SESSION debug="+d,ndb_simulate_nodefail";
320 --error ER_GET_TEMPORARY_ERRMSG
321 show create table t1;
322 show warnings;
323 SET SESSION debug=@save_debug;
324 drop table t1;
325
326 --echo # mysqld gets timeout error 4009 while creating transaction for bulk update
327 create table t1(id int primary key, val int) engine=ndb;
328 insert into t1 values(1,1), (2,2), (3,3), (4,4), (5,5);
329 set @save_debug = @@session.debug;
330 SET SESSION debug="+d,ndb_start_transaction_fail";
331 --error ER_GET_ERRMSG
332 update t1 set val = 11111 where id > 0;
333 show warnings;
334 SET SESSION debug=@save_debug;
335 drop table t1;
336
337 --remove_file $NDB_TOOLS_OUTPUT