@@ -178,180 +178,6 @@ source include/show_binlog_events.inc;
178
178
--source include/restore_default_binlog_format.inc
179
179
180
180
181
- --echo #
182
- --echo # Bug#22681959 : SELECT ON I_S TABLES WITH CONCURRENT DDL MAY CRASH SERVER
183
- --echo # Bug#22285643 : I_S QUERIES OPENING TMP TABLES FROM ALTER INVALIDATES REFERENCE COUNTER
184
- --echo #
185
-
186
- #
187
- # Preparative cleanup.
188
- #
189
- --disable_warnings
190
- SET DEBUG_SYNC= 'RESET';
191
- DROP SCHEMA IF EXISTS test_i_s;
192
- --enable_warnings
193
-
194
- #
195
- # This is test case to check assert in Bug#22681959.
196
- #
197
- CREATE SCHEMA test_i_s;
198
- USE test_i_s;
199
- CREATE TABLE t1(a INT) ENGINE=MYISAM;
200
-
201
- --echo # Create new connections
202
- --enable_connect_log
203
- connect (con1,localhost,root,,);
204
- connect (con2,localhost,root,,);
205
- connect (con3,localhost,root,,);
206
- connect (con4,localhost,root,,);
207
- connect (con5,localhost,root,,);
208
-
209
- --connection default
210
- SET GLOBAL DEBUG='d,alter_table_after_rename';
211
- SET DEBUG_SYNC=
212
- 'before_rename_in_dd SIGNAL blocked WAIT_FOR i_s_select';
213
- SET DEBUG_SYNC=
214
- 'after_rename_in_dd SIGNAL blocked_2 WAIT_FOR i_s_select_2';
215
-
216
- --echo # Sending ALTER Command
217
- --send ALTER TABLE t1 add column (c2 int);
218
-
219
- --connection con1
220
- SET DEBUG_SYNC= 'now WAIT_FOR blocked';
221
- SET DEBUG_SYNC=
222
- 'show_after_table_list_prep SIGNAL i_s_select WAIT_FOR blocked_2';
223
- --send SELECT table_name FROM information_schema.partitions WHERE SUBSTR(table_name,1,1)='#';
224
-
225
- --connection con2
226
- # Without Fix, ALTER command gets signal to continue from above.
227
- # It asserts trying to put dd::Table object in the Dictionary Cache.
228
- # With the Fix, ALTER gets MDL on the temporary table name.
229
- # SELECT on I_S waits for ALTER to finish.
230
- let $wait_condition=
231
- select count(*) = 1 from information_schema.processlist
232
- where state = "Waiting for table metadata lock" and
233
- info = "SELECT table_name FROM information_schema.partitions WHERE SUBSTR(table_name,1,1)='#'";
234
- --source include/wait_condition.inc
235
- SET DEBUG_SYNC= 'now SIGNAL i_s_select_2';
236
-
237
- --connection default
238
- --echo #Reaping "ALTER ..."
239
- --reap
240
-
241
- --connection con1
242
- --echo #Reaping "SELECT"
243
- --reap
244
-
245
- SET DEBUG_SYNC= 'RESET';
246
- SET GLOBAL DEBUG='';
247
-
248
- #
249
- # This is test case to check assert in Bug#22285643.
250
- #
251
-
252
- --connection con3
253
- USE test_i_s;
254
-
255
- SET GLOBAL DEBUG='d,alter_table_after_rename';
256
- SET DEBUG_SYNC=
257
- 'before_rename_in_dd SIGNAL blocked WAIT_FOR i_s_select';
258
-
259
- --echo # Sending:
260
- --send ALTER TABLE t1 add column (c3 int)
261
-
262
- --connection con4
263
- SET DEBUG_SYNC= 'now WAIT_FOR blocked';
264
- SET DEBUG_SYNC=
265
- 'after_acquire_abstract_table SIGNAL i_s_select WAIT_FOR blocked_2';
266
-
267
- --send SELECT table_name FROM information_schema.partitions WHERE table_schema='test_i_s' and table_name LIKE '#sql%\_%'
268
-
269
- --connection con5
270
- let $wait_condition=
271
- select count(*) = 1 from information_schema.processlist
272
- where state = "Waiting for table metadata lock" and
273
- info LIKE "SELECT table_name FROM information_schema.partitions WHERE table_schema='test_i_s' and table_name LI%";
274
- --source include/wait_condition.inc
275
- SET DEBUG_SYNC= 'now SIGNAL i_s_select';
276
-
277
- --connection con3
278
- --echo #Reaping "ALTER ..."
279
- --reap
280
- SET DEBUG_SYNC= 'now SIGNAL blocked_2';
281
-
282
- --connection con4
283
- --echo #Reaping "SELECT"
284
- --reap
285
-
286
- --connection default
287
- SET DEBUG_SYNC= 'RESET';
288
- SET GLOBAL DEBUG='';
289
-
290
-
291
- #
292
- # This is test case to check error paths in Bug#22681959 and Bug#22285643.
293
- #
294
-
295
- --connection default
296
- USE test_i_s;
297
- CREATE TABLE pid_table(pid_no INT);
298
-
299
- SET @conn_id= connection_id();
300
- --let $pid_file=`SELECT @@pid_file`
301
- --replace_result $pid_file pid_file
302
- --eval LOAD DATA LOCAL INFILE '$pid_file' INTO TABLE pid_table
303
- --let $temp_table_name= `SELECT CONCAT('#sql-', LCASE(HEX(pid_no)), '_', @conn_id) FROM pid_table`
304
- --let $temp_table_backup_name= `SELECT CONCAT('#sql2-', LCASE(HEX(pid_no)), '-', @conn_id) FROM pid_table`
305
-
306
- # Lock the temporary table name to be used while ALTER
307
- --connection con1
308
- use test_i_s;
309
- --disable_query_log
310
- eval CREATE TABLE `$temp_table_name`(a int);
311
- eval LOCK TABLE `$temp_table_name` WRITE;
312
- --enable_query_log
313
-
314
- # ALTER will timeout while trying to get MDL on temporary table name.
315
- --connection default
316
- SET @lock_wait_timeout_saved= @@lock_wait_timeout;
317
- SET lock_wait_timeout = 1;
318
- --error ER_LOCK_WAIT_TIMEOUT
319
- ALTER TABLE t1 add column (c4 int);
320
-
321
- # Lock the backup temporary table name to be used while ALTER
322
- --connection con1
323
- UNLOCK TABLES;
324
- --disable_query_log
325
- eval DROP TABLE `$temp_table_name`;
326
- eval CREATE TABLE `$temp_table_backup_name`(a int);
327
- eval LOCK TABLE `$temp_table_backup_name` WRITE;
328
- --enable_query_log
329
-
330
- # ALTER will timeout while trying to get MDL on backup temporary table name.
331
- --connection default
332
- SET lock_wait_timeout = 1;
333
- --error ER_LOCK_WAIT_TIMEOUT
334
- ALTER TABLE t1 add column (c4 int);
335
-
336
- --connection con1
337
- --disable_query_log
338
- eval DROP TABLE `$temp_table_backup_name`;
339
- --enable_query_log
340
- --disconnect con1
341
- --source include/wait_until_disconnected.inc
342
- --disconnect con2
343
- --source include/wait_until_disconnected.inc
344
- --disconnect con3
345
- --source include/wait_until_disconnected.inc
346
- --disconnect con4
347
- --source include/wait_until_disconnected.inc
348
- --disconnect con5
349
- --source include/wait_until_disconnected.inc
350
- --connection default
351
- --disable_connect_log
352
- DROP SCHEMA test_i_s;
353
- SET @@lock_wait_timeout= @lock_wait_timeout_saved;
354
-
355
181
--echo #
356
182
--echo # Additional coverage for WL#7743 "New data dictionary: changes
357
183
--echo # to DDL-related parts of SE API".
0 commit comments