partition_debug_sync_innodb.test 1.55 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
--source include/have_innodb.inc
--source include/have_partition.inc
--source include/have_debug_sync.inc

let $MYSQLD_DATADIR=`SELECT @@datadir`;

--echo #
--echo # Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
--echo #            concurrent I_S query
create table t1 (a int)
engine = innodb
partition by range (a)
(partition p0 values less than MAXVALUE);
insert into t1 values (1), (11), (21), (33);
SELECT * FROM t1;
SHOW CREATE TABLE t1;
17
--replace_result #p# #P#
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
--list_files $MYSQLD_DATADIR/test

SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open';
SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish';
send
SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';

connect (con1, localhost, root,,);
SET DEBUG_SYNC = 'now WAIT_FOR parked';
--echo # When waiting for the name lock in get_all_tables in sql_show.cc
--echo # this will not be concurrent any more, thus the TIMEOUT
SET DEBUG_SYNC = 'before_rename_partitions SIGNAL open WAIT_FOR alter TIMEOUT 1';
--echo # Needs to be executed twice, since first is this 'SET DEBUG_SYNC ...'
SET DEBUG_SYNC = 'before_close_thread_tables SIGNAL finish EXECUTE 2';
--error 0,ER_TABLE_EXISTS_ERROR
ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
(PARTITION p0 VALUES LESS THAN (10),
 PARTITION p10 VALUES LESS THAN MAXVALUE);

disconnect con1;
connection default;
--reap
40
--replace_result #p# #P#
41 42 43 44 45 46
--list_files $MYSQLD_DATADIR/test
SHOW CREATE TABLE t1;
SELECT * FROM t1;
drop table t1;
--list_files $MYSQLD_DATADIR/test
SET DEBUG_SYNC = 'RESET';