summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test
blob: 788427103a553ab814d10cea96b15e90f360e7be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;