1include/rpl_init.inc [topology=1->2->3]
2include/rpl_connect.inc [creating cluster1]
3include/rpl_connect.inc [creating cluster2]
4include/rpl_connect.inc [creating cluster3]
5[connection cluster1]
6show variables like 'server_id';
7Variable_name	Value
8server_id	1
9select @cluster1_server_id:=(variable_value+0)
10from information_schema.global_variables
11where variable_name like 'server_id';
12@cluster1_server_id:=(variable_value+0)
131
14[connection cluster2]
15show variables like 'server_id';
16Variable_name	Value
17server_id	2
18[connection cluster3]
19show variables like 'server_id';
20Variable_name	Value
21server_id	3
22First show replication 1->2->3
23[connection cluster1]
24use test;
25create table t1(a int primary key, b varchar(50)) engine=ndb;
26insert into t1 values (1,'Summertime');
27Cluster2 has insert and apply_status from Cluster1
28show variables like 'server_id';
29Variable_name	Value
30server_id	2
31select * from mysql.ndb_apply_status order by server_id;
32server_id	epoch	log_name	start_pos	end_pos
331	#	#	#	#
34select * from test.t1;
35a	b
361	Summertime
37Cluster3 has insert and apply_status from Cluster1+2
38show variables like 'server_id';
39Variable_name	Value
40server_id	3
41select * from mysql.ndb_apply_status order by server_id;
42server_id	epoch	log_name	start_pos	end_pos
431	#	#	#	#
442	#	#	#	#
45select * from test.t1;
46a	b
471	Summertime
48Break Cluster3's link with Cluster2
49[connection cluster3]
50include/stop_slave.inc
51Make further changes on Cluster1
52[connection cluster1]
53insert into test.t1 values (2, "The cotton is high");
54insert into test.t1 values (3, "Daddys rich");
55Show changes exist on Cluster2
56select * from test.t1 order by a;
57a	b
581	Summertime
592	The cotton is high
603	Daddys rich
61Check data on Cluster3
62[connection cluster3]
63select * from test.t1 order by a;
64a	b
651	Summertime
66Now change Cluster3 to skip-over Cluster2 and get binlog direct from Cluster1
67select * from mysql.ndb_apply_status order by server_id;
68server_id	epoch	log_name	start_pos	end_pos
691	#	#	#	#
702	#	#	#	#
71include/rpl_change_topology.inc [new topology=1->2,1->3]
72include/start_slave.inc
73[connection cluster1]
74Now show that cluster 3 is successfully replicating from Cluster1
75[connection cluster3]
76select * from test.t1 order by a;
77a	b
781	Summertime
792	The cotton is high
803	Daddys rich
81Clean up
82[connection cluster1]
83drop table test.t1;
84include/rpl_end.inc
85