| 1 |
# This file ensures that a slave's id filtering variables (i.e. DO_DOMAIN_IDS, |
| 2 |
# IGNORE_DOMAIN_IDS, and IGNORE_SERVER_IDS) are cleared after issuing |
| 3 |
# `RESET SLAVE ALL`. |
| 4 |
# |
| 5 |
# param $_do_domain_ids Integer list of values to use for DO_DOMAIN_IDS |
| 6 |
# param $_ignore_domain_ids Integer list of values to use for IGNORE_DOMAIN_IDS |
| 7 |
# param $_ignore_server_ids Integer list of values to use for IGNORE_SERVER_IDS |
| 8 |
# |
| 9 |
|
| 10 |
--echo # Id filtering variable values should be empty initially |
| 11 |
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1); |
| 12 |
let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1); |
| 13 |
let $ignore_server_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1); |
| 14 |
|
| 15 |
if (`SELECT "$do_domain_ids_before" != "" OR |
| 16 |
"$ignore_domain_ids_before" != "" OR |
| 17 |
"$ignore_server_ids_before" != ""`) |
| 18 |
{ |
| 19 |
die("CHANGE MASTER TO id filter variables are not empty initially"); |
| 20 |
} |
| 21 |
|
| 22 |
|
| 23 |
--echo # Set id filtering variables |
| 24 |
eval CHANGE MASTER TO DO_DOMAIN_IDS=$_do_domain_ids, IGNORE_DOMAIN_IDS=$_ignore_domain_ids, IGNORE_SERVER_IDS=$_ignore_server_ids, MASTER_USE_GTID=SLAVE_POS; |
| 25 |
let $do_domain_ids_set= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1); |
| 26 |
let $ignore_domain_ids_set= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1); |
| 27 |
let $ignore_server_ids_set= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1); |
| 28 |
--echo # do domain id list: $do_domain_ids_set |
| 29 |
--echo # ignore domain id list: $ignore_domain_ids_set |
| 30 |
--echo # ignore server id list: $ignore_server_ids_set |
| 31 |
|
| 32 |
|
| 33 |
--echo # RESET SLAVE ALL should clear values for all id filtering variables |
| 34 |
RESET SLAVE ALL; |
| 35 |
--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 36 |
eval change master to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root'; |
| 37 |
--source include/start_slave.inc |
| 38 |
--source include/stop_slave.inc |
| 39 |
|
| 40 |
let $do_domain_ids_cleared= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1); |
| 41 |
let $ignore_domain_ids_cleared= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1); |
| 42 |
let $ignore_server_ids_cleared= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1); |
| 43 |
if (`SELECT "$do_domain_ids_cleared" != "" OR |
| 44 |
"$ignore_domain_ids_cleared" != "" OR |
| 45 |
"$ignore_server_ids_cleared" != ""`) |
| 46 |
{ |
| 47 |
die("RESET SLAVE ALL did not clear id filtering variables"); |
| 48 |
} |