diff options
Diffstat (limited to 'mysql-test/suite/galera/t/galera_bf_abort_lock_table.test')
-rw-r--r-- | mysql-test/suite/galera/t/galera_bf_abort_lock_table.test | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test new file mode 100644 index 00000000000..788427103a5 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test @@ -0,0 +1,33 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# +# Test that a local LOCK TABLE will be broken by an incoming remote transaction against that table +# + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; + +--connection node_2 +SET AUTOCOMMIT=OFF; +--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` +LOCK TABLE t1 WRITE; + +# Issue a concurrent INSERT against the lock table that will block +--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 +--send INSERT INTO t1 VALUES (1); + +--connection node_1 +INSERT INTO t1 VALUES (2); + +# The concurent insert is allowed to complete because the LOCK TABLE is now broken +--connection node_2a +--error 0 +--reap + +--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` + +--disable_query_log +--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment; +--enable_query_log + +DROP TABLE t1; |