mariadb/mysql-test/suite/galera_sr/t/galera_sr_concurrent.test
Brave Galera Crew 36a2a185fe Galera4
2019-01-23 15:30:00 +04:00

45 lines
1,010 B
Text

--source include/galera_cluster.inc
--source include/have_innodb.inc
#
# Test two concurrent SR-replicated transactions
#
--connection node_1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
--let $wsrep_trx_fragment_size_orig = `SELECT @@wsrep_trx_fragment_size`
SET SESSION wsrep_trx_fragment_size = 1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
SET SESSION wsrep_trx_fragment_size = 1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t2 VALUES (1);
INSERT INTO t2 VALUES (2);
INSERT INTO t2 VALUES (3);
INSERT INTO t2 VALUES (4);
INSERT INTO t2 VALUES (5);
--connection node_1
COMMIT;
--connection node_1a
COMMIT;
--connection node_2
SELECT COUNT(*) = 5 FROM t1;
SELECT COUNT(*) = 5 FROM t2;
--connection node_1
DROP TABLE t1;
DROP TABLE t2;