summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/galera_sr/t/GCF-571.test
blob: aca0b9f7907608ea253b382111676d25ff7c039b (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#
# GCF-571 ROLLBACK TO SAVEPOINT causes all SR records to be deleted
#

--source include/galera_cluster.inc

SET AUTOCOMMIT=OFF;
CREATE TABLE t1 (f1 VARCHAR(10)) ENGINE=InnoDB;

SET SESSION wsrep_trx_fragment_size = 1;
START TRANSACTION;
INSERT INTO t1 VALUES ('%abcdef%');
INSERT INTO t1 VALUES ('%abcdef%');
INSERT INTO t1 VALUES ('%abcdef%');
INSERT INTO t1 VALUES ('%abcdef%');
SAVEPOINT A;
INSERT INTO t1 VALUES ('xyzxyz');
INSERT INTO t1 VALUES ('xyzxyz');
INSERT INTO t1 VALUES ('xyzxyz');
INSERT INTO t1 VALUES ('xyzxyz');
INSERT INTO t1 VALUES ('xyzxyz');

--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1a
SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%abcdef%';
SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%xyz%';
SELECT COUNT(*) = 1 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%SAVEPOINT `A`%';

--connection node_1
ROLLBACK TO SAVEPOINT A;

--connection node_1a
SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%abcdef%';
SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%xyz%';
SELECT COUNT(*) = 1 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%SAVEPOINT `A`%';
SELECT COUNT(*) = 1 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%ROLLBACK TO `A`%';

--connection node_2
SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%abcdef%';
SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%xyz%';
SELECT COUNT(*) = 1 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%SAVEPOINT `A`%';
SELECT COUNT(*) = 1 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%ROLLBACK TO `A`%';

--connection node_1
ROLLBACK;

--connection node_1a
SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log;

--connection node_2
SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log;

--connection node_1
DROP TABLE t1;