rpl_redirect.test
来自「这是linux下运行的mysql软件包,可用于linux 下安装 php + m」· TEST 代码 · 共 46 行
TEST
46 行
## Test of automatic redirection of queries to master/slave.# source include/master-slave.inc;# We disable this for now as PS doesn't handle redirection--disable_ps_protocol#first, make sure the slave has had enough time to registersave_master_pos;connection slave;sync_with_master;#discover slavesconnection master;--replace_result $MASTER_MYPORT MASTER_PORT--replace_column 1 # 8 # 9 # 23 # 33 #SHOW SLAVE STATUS;--replace_result $SLAVE_MYPORT SLAVE_PORTSHOW SLAVE HOSTS;rpl_probe;#turn on master/slave query direction auto-magicenable_rpl_parse;create table t1 ( n int);insert into t1 values (1),(2),(3),(4);disable_rpl_parse;save_master_pos;connection slave;sync_with_master;insert into t1 values(5);connection master;enable_rpl_parse;# The first of the queries will be sent to the slave, the second to the master.select * from t1;select * from t1;disable_rpl_parse;select * from t1;connection slave;select * from t1;drop table t1;connection master;drop table t1;# End of 4.1 tests
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?