summaryrefslogtreecommitdiff
path: root/mysql-test/t/partition_debug_sync.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-07-21 16:39:19 +0200
committerSergei Golubchik <sergii@pisem.net>2013-07-21 16:39:19 +0200
commitb7b5f6f1ab49948b0e15b762266d4640b3d6b7fb (patch)
tree7c302c2025184dbd053aa6135f0ff28c8ce6f359 /mysql-test/t/partition_debug_sync.test
parent5f6380adde2dac3f32b40339b9b702c0135eb7d6 (diff)
parentc1d6a2d7e194225ccc19a68ea5d0f368632620d0 (diff)
downloadmariadb-git-b7b5f6f1ab49948b0e15b762266d4640b3d6b7fb.tar.gz
10.0-monty merge
includes: * remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING" * introduce LOCK_share, now LOCK_ha_data is strictly for engines * rea_create_table() always creates .par file (even in "frm-only" mode) * fix a 5.6 bug, temp file leak on dummy ALTER TABLE
Diffstat (limited to 'mysql-test/t/partition_debug_sync.test')
-rw-r--r--mysql-test/t/partition_debug_sync.test57
1 files changed, 54 insertions, 3 deletions
diff --git a/mysql-test/t/partition_debug_sync.test b/mysql-test/t/partition_debug_sync.test
index bcec5503e6f..3ca21c2185a 100644
--- a/mysql-test/t/partition_debug_sync.test
+++ b/mysql-test/t/partition_debug_sync.test
@@ -5,6 +5,8 @@
#
--source include/have_partition.inc
--source include/have_debug_sync.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
@@ -16,7 +18,9 @@ SET DEBUG_SYNC= 'RESET';
--echo # Test when remove partitioning is done while drop table is waiting
--echo # for the table.
--echo # After MDL was introduced, there is no longer any race, so test is done
---echo # by adding a small sleep to verify that the delete waits.
+--echo # by adding a small sleep to verify that the delete waits. This happens
+--echo # only until ALTER tries to upgrade its MDL lock, which ends up in MDL
+--echo # deadlock which is correctly reported.
connect(con1, localhost, root,,);
--echo # Con 1
SET DEBUG_SYNC= 'RESET';
@@ -31,16 +35,17 @@ ENGINE = MYISAM
PARTITION p2 VALUES LESS THAN (100),
PARTITION p3 VALUES LESS THAN MAXVALUE ) */;
SET DEBUG_SYNC= 'alter_table_before_create_table_no_lock SIGNAL removing_partitioning WAIT_FOR waiting_for_alter';
-SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL partitioning_removed';
+SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_upgrade';
--send ALTER TABLE t1 REMOVE PARTITIONING
connection default;
--echo # Con default
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter';
-SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR partitioning_removed';
+SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR waiting_for_upgrade';
DROP TABLE IF EXISTS t1;
--echo # Con 1
connection con1;
+--error ER_LOCK_DEADLOCK
--reap
connection default;
SET DEBUG_SYNC= 'RESET';
@@ -77,8 +82,54 @@ connection con1;
--reap
SET DEBUG_SYNC= 'RESET';
disconnect con1;
+--source include/wait_until_disconnected.inc
connection default;
--echo # Con default
SET DEBUG_SYNC= 'RESET';
--echo End of 5.1 tests
+
+--echo #
+--echo # Coverage test for non pruned ha_partition::store_lock()
+--echo #
+CREATE TABLE t1 (a int) ENGINE = InnoDB;
+CREATE TABLE t2 (a int PRIMARY KEY)
+ENGINE = InnoDB PARTITION BY HASH (a) PARTITIONS 3;
+
+HANDLER t1 OPEN;
+
+--echo # Con1
+connect (con1, localhost, root,,);
+
+LOCK TABLES t1 WRITE, t2 READ;
+
+--echo # Default
+connection default;
+
+SET DEBUG_SYNC="wait_for_lock SIGNAL locking";
+send INSERT INTO t2 VALUES (1), (2), (3);
+
+--echo # Con1
+connection con1;
+SET DEBUG_SYNC="now WAIT_FOR locking";
+
+send ALTER TABLE t1 ADD COLUMN b int;
+
+--echo # Default
+connection default;
+--error ER_LOCK_ABORTED
+--reap
+
+SELECT 1;
+
+--echo # Con1
+connection con1;
+--reap
+
+UNLOCK TABLES;
+--disconnect con1
+
+--echo # Default
+connection default;
+
+DROP TABLE t1, t2;