2 # Test CHANGE MASTER MASTER_BIND=xxx
5 # $master_bind - the address to use for MASTER_BIND
6 # $master_bind_error_expected - expect an error when using the specified
13 source include/stop_slave.inc;
15 # Create table and insert one record with the bind address on master
17 create
table t1(
n int, b varchar(256));
18 --replace_result $master_bind <master_bind>
19 eval insert into t1 values(1, $master_bind);
21 # Configure slave to connect to master with the give bind address
22 # for master_bind and master_host unless it's an invalid address
25 if (!$master_bind_error_expected)
27 if ($master_bind !=
"''")
29 let $_master_host=master_host=$master_bind,;
33 --replace_result $master_bind <master_bind>
34 eval change master
to $_master_host master_bind=$master_bind;
37 # Check that SHOW SLAVE STATUS has Master_bind column set to $master_bind
38 let $master_bind_value= query_get_value(SHOW SLAVE
STATUS, Master_Bind, 1);
39 if (`select
'$master_bind_value' != $master_bind`)
41 source include/show_rpl_debug_info.inc;
42 echo
'master_bind_value: $master_bind_value' !=
'master_bind: $master_bind';
43 die Master_bind in SHOW SLAVE STAUS not showing configured value;
46 if ($master_bind_error_expected)
48 # The given master bind address is not valid
49 # and replication should fail
50 let $slave_io_errno= $master_bind_error_expected;
51 let $slave_io_error_is_nonfatal= 1;
52 source include/wait_for_slave_io_error.inc;
53 echo got expected error $master_bind_error_expected;
54 source include/stop_slave.inc;
56 # Reset the master_bind so that cleanup can run
57 eval change master
to master_bind=
'';
62 source include/wait_for_slave_to_start.inc;
65 sync_slave_with_master;
68 let $master_bind_repl= query_get_value(select b from t1, b, 1);
69 if (`select
'$master_bind_repl' != $master_bind`)
72 source include/show_rpl_debug_info.inc;
73 echo
'master_bind_repl: $master_bind_repl' !=
'master_bind: $master_bind';
74 die The replicated value
to show replication working was not correct;
80 sync_slave_with_master;