mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
55 lines
1.4 KiB
Text
55 lines
1.4 KiB
Text
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 cluster.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 cluster.binlog_index WHERE epoch = <the_epoch> ;
|
|
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
|
|
102 master-bin1.000001
|
|
CHANGE MASTER TO
|
|
master_port=<MASTER_PORT1>,
|
|
master_log_file = 'master-bin1.000001',
|
|
master_log_pos = 102 ;
|
|
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;
|