📄 ndb_binlog_multi.test
字号:
-- source include/have_ndb.inc-- source include/have_multi_ndb.inc-- source include/have_binlog_format_row.inc--disable_warningsconnection server2;drop table if exists t1,t2;connection server1;drop table if exists t1,t2;--enable_warnings## basic test to see if one server sees the table from the other# and sets up the replication correctly## no tables and nothing in cluster_replication.binlog_index;connection server1;SHOW TABLES;# create table on the other serverconnection server2;CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB;# make sure the first mysql server knows about this tableconnection server1;show tables;# insert something on server2connection server2;INSERT INTO t2 VALUES (1,1),(2,2);select * from t2 order by a;save_master_pos;--replace_column 1 <the_epoch>SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM cluster_replication.binlog_index ORDER BY epoch DESC LIMIT 1;let $the_epoch= `SELECT @the_epoch`;# see if we got something on server1connection server1;SELECT * FROM t2 ORDER BY a;--replace_result $the_epoch <the_epoch>eval SELECT inserts,updates,deletes,schemaops FROM cluster_replication.binlog_index WHERE epoch=$the_epoch;# drop the table on server1DROP TABLE t2;CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB;INSERT INTO t1 VALUES (1),(2);save_master_pos;--replace_column 1 <the_epoch2>SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM cluster_replication.binlog_index ORDER BY epoch DESC LIMIT 1;let $the_epoch2= `SELECT @the_epoch2`;--replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2>eval SELECT inserts,updates,deletes,schemaops FROM cluster_replication.binlog_index WHERE epoch > $the_epoch AND epoch < $the_epoch2;drop table t1;# flush on server2connection server2;SHOW TABLES;--replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2>eval SELECT inserts,updates,deletes,schemaops FROM cluster_replication.binlog_index WHERE epoch > $the_epoch AND epoch < $the_epoch2;# resetconnection server1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -