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
|
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
reset master;
SHOW TABLES;
Tables_in_test
t1
INSERT INTO t1 VALUES ("row1","will go away",1);
SELECT * FROM t1 ORDER BY c3;
c1 c2 c3
row1 will go away 1
SELECT * FROM t1 ORDER BY c3;
c1 c2 c3
row1 will go away 1
SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
@the_epoch:=MAX(epoch)
<the_epoch>
SELECT * FROM t1 ORDER BY c3;
c1 c2 c3
row1 will go away 1
stop slave;
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM mysql.ndb_binlog_index WHERE epoch = <the_epoch> ;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
105 master-bin1.000001
CHANGE MASTER TO
master_port=<MASTER_PORT1>,
master_log_file = 'master-bin1.000001',
master_log_pos = 105 ;
start slave;
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
DELETE FROM t1 WHERE c3 = 1;
UPDATE t1 SET c2="should go away" WHERE c3 = 2;
UPDATE t1 SET c2="C" WHERE c3 = 3;
DELETE FROM t1 WHERE c3 = 2;
SELECT * FROM t1 ORDER BY c3;
c1 c2 c3
row3 C 3
row4 D 4
INSERT INTO t1 VALUES ("row5","E",5);
SELECT * FROM t1 ORDER BY c3;
c1 c2 c3
row3 C 3
row4 D 4
row5 E 5
SELECT * FROM t1 ORDER BY c3;
c1 c2 c3
row3 C 3
row4 D 4
row5 E 5
STOP SLAVE;
|