summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_test_framework.test
blob: e0f961caff177c0a2f55256bd198974319469425 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# ==== Purpose ====
#
# Test that the sync chain generated by
# include/rpl_change_topology.inc (sourced from include/rpl_init.inc)
# is correct.
#
# We test a number of different topologies.  Each topology is tested
# in extra/rpl_tests/rpl_test_framework.inc.  See
# extra/rpl_tests/rpl_test_framework.inc for details on how the sync
# chain is tested.
#
# ==== Related bugs ====
#
# BUG#49978: Replication tests don't clean up replication state at the end


# We only need to execute this test once. Also, we rely on 'DELETE
# FROM t1' to remove rows in slave tables that don't exist in master
# tables (see include/rpl_test_framework.inc for details).
--source include/have_binlog_format_statement.inc


--echo ==== Create t1 on all servers. ====
if ($mtr_supports_more_than_10_servers)
{
  --let $rpl_server_count= 15
  --let $rpl_topology= 1->2->3->4->5->6->7->8->9->10->11->12->13->14->15
}
if (!$mtr_supports_more_than_10_servers)
{
  --let $rpl_server_count= 9
  --let $rpl_topology= 1->2->3->4->5->6->7->8->9
}
--source include/rpl_init.inc
CREATE TABLE t1 (a INT);
--source include/rpl_end.inc

# Initialize $next_number before first call to
# extra/rpl_tests/rpl_test_framework.text
--let $next_number= 0


--echo ==== Test 3-server topologies ====

--let $rpl_server_count= 3

--let $rpl_topology= 1 -> 2
--let $masters= 1,3
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= 2 -> 3
--let $masters= 1,2
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= none
--let $masters= 1,2,3
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= 1->2, 2->1
--let $masters= 1,3
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= 1->2->1
--let $masters= 2,3
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= 2->1->2
--let $masters= 1,3
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= 1->2->3
--let $masters= 1
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= 2->3->2->1
--let $masters= 3
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= 1->2,2->3,3->1
--let $masters= 3
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= 1->3->2->1
--let $masters= 3
--source extra/rpl_tests/rpl_test_framework.inc


--echo ==== Test 6-server topologies ====

--let $rpl_server_count= 6

--let $rpl_topology= 1->2->3->4->1->5->6
--let $masters= 1
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= 3->4->5->6->3->1->2
--let $masters= 4
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= 6->5->4->3->2->1
--let $masters= 6
--source extra/rpl_tests/rpl_test_framework.inc

--let $rpl_topology= 1->2->3->1,4->5->6
--let $masters= 3,4
--source extra/rpl_tests/rpl_test_framework.inc


--echo ==== Test 9-server topology ====

--let $rpl_server_count= 9

--let $rpl_topology= 1->2, 2->3, 3->4, 4->5, 5->1, 1->6, 6->7, 6->8, 8->9
--let $masters= 2
--source extra/rpl_tests/rpl_test_framework.inc

if ($mtr_supports_more_than_10_servers) {
--echo ==== Test 15-server topologies ====

--let $rpl_server_count= 15

--let $rpl_topology= 1->2->3->4->5->6->7->8->9->10->11->12->13->14->15->1
--let $masters= 2
--source extra/rpl_tests/rpl_test_framework.inc

# This is a binary tree
--let $rpl_topology= 1->2->4->8,1->3->6->12,2->5->10,3->7->14,4->9,5->11,6->13,7->15
--let $masters= 1
--source extra/rpl_tests/rpl_test_framework.inc
}

--echo ==== Clean up ====

if ($mtr_supports_more_than_10_servers) {
  --let $rpl_topology= 1->2->3->4->5->6->7->8->9->10->11->12->13->14->15
}
if (!$mtr_supports_more_than_10_servers) {
  --let $rpl_topology= 1->2->3->4->5->6->7->8->9
}
--source include/rpl_init.inc
--connection server_1
DROP TABLE t1;
--source include/rpl_end.inc