diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-05-11 20:02:50 +0400 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-05-11 20:02:50 +0400 |
commit | e118ec409f15dcc3e8fd74b4b20dd2279fb1321d (patch) | |
tree | 89c163aad88a201330e15a7e904ca11d6c1001e5 /mysql-test/suite | |
parent | d9a5541a34f273c390f088504dc41daf6cdfaa0a (diff) | |
parent | 6fa04cad8fcc1b04933bc1ce8dee9b49f1d909f9 (diff) | |
download | mariadb-git-e118ec409f15dcc3e8fd74b4b20dd2279fb1321d.tar.gz |
Manual merge from mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:
Text conflict in sql/sql_base.cc
Text conflict in sql/sql_partition.cc
Text conflict in sql/sql_priv.h
Text conflict in sql/sql_show.cc
Diffstat (limited to 'mysql-test/suite')
3 files changed, 106 insertions, 0 deletions
diff --git a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result new file mode 100644 index 00000000000..9e72259a150 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result @@ -0,0 +1,61 @@ +# +# Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with +# 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; +a +1 +11 +21 +33 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +t1#P#p0.ibd +t1.frm +t1.par +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'; +SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; +SET DEBUG_SYNC = 'now WAIT_FOR parked'; +# When waiting for the name lock in get_all_tables in sql_show.cc +# this will not be concurrent any more, thus the TIMEOUT +SET DEBUG_SYNC = 'before_rename_partitions SIGNAL open WAIT_FOR alter TIMEOUT 1'; +# Needs to be executed twice, since first is this 'SET DEBUG_SYNC ...' +SET DEBUG_SYNC = 'before_close_thread_tables SIGNAL finish EXECUTE 2'; +ALTER TABLE t1 REORGANIZE PARTITION p0 INTO +(PARTITION p0 VALUES LESS THAN (10), +PARTITION p10 VALUES LESS THAN MAXVALUE); +Warnings: +Warning 1639 debug sync point wait timed out +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME +def test t1 p0 NULL 1 NULL RANGE NULL a NULL 10 1 16384 16384 NULL 0 0 NULL NULL NULL NULL default NULL +def test t1 p10 NULL 2 NULL RANGE NULL a NULL MAXVALUE 3 5461 16384 NULL 0 0 NULL NULL NULL NULL default NULL +t1#P#p0.ibd +t1#P#p10.ibd +t1.frm +t1.par +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB, + PARTITION p10 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +SELECT * FROM t1; +a +1 +11 +21 +33 +drop table t1; +SET DEBUG_SYNC = 'RESET'; diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt b/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt new file mode 100644 index 00000000000..9854fda301d --- /dev/null +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt @@ -0,0 +1 @@ +--innodb_file_per_table=1 diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test new file mode 100644 index 00000000000..79ef3d537bf --- /dev/null +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test @@ -0,0 +1,44 @@ +--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; +--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 +--list_files $MYSQLD_DATADIR/test +SHOW CREATE TABLE t1; +SELECT * FROM t1; +drop table t1; +--list_files $MYSQLD_DATADIR/test +SET DEBUG_SYNC = 'RESET'; |