diff --git a/lib/MHA/ServerManager.pm b/lib/MHA/ServerManager.pm index 9fd3278..0f500a2 100644 --- a/lib/MHA/ServerManager.pm +++ b/lib/MHA/ServerManager.pm @@ -407,19 +407,19 @@ sub validate_repl_filter($$) { my $replicate_wild_do_table; my $replicate_wild_ignore_table; foreach (@slaves) { - $replicate_do_db = $_->{Replicate_Do_DB} unless ($replicate_do_db); + $replicate_do_db = $_->{Replicate_Do_DB} unless (defined($replicate_do_db)); $replicate_ignore_db = $_->{Replicate_Ignore_DB} - unless ($replicate_ignore_db); - $replicate_do_table = $_->{Replicate_Do_Table} unless ($replicate_do_table); + unless (defined($replicate_ignore_db)); + $replicate_do_table = $_->{Replicate_Do_Table} unless (defined($replicate_do_table)); $replicate_ignore_table = $_->{Replicate_Ignore_Table} - unless ($replicate_ignore_table); + unless (defined($replicate_ignore_table)); $replicate_wild_do_table = $_->{Replicate_Wild_Do_Table} - unless ($replicate_wild_do_table); + unless (defined($replicate_wild_do_table)); $replicate_wild_ignore_table = $_->{Replicate_Wild_Ignore_Table} - unless ($replicate_wild_ignore_table); + unless (defined($replicate_wild_ignore_table)); if ( $_->{log_bin} ) { - $binlog_do_db = $_->{Binlog_Do_DB} unless ($binlog_do_db); - $binlog_ignore_db = $_->{Binlog_Ignore_DB} unless ($binlog_ignore_db); + $binlog_do_db = $_->{Binlog_Do_DB} unless (defined($binlog_do_db)); + $binlog_ignore_db = $_->{Binlog_Ignore_DB} unless (defined($binlog_ignore_db)); } if ( $replicate_do_db ne $_->{Replicate_Do_DB} || $replicate_ignore_db ne $_->{Replicate_Ignore_DB} diff --git a/tests/t/t_filter_incorrect.sh b/tests/t/t_filter_incorrect.sh index 135c57c..7b627fe 100755 --- a/tests/t/t_filter_incorrect.sh +++ b/tests/t/t_filter_incorrect.sh @@ -24,6 +24,24 @@ fail_if_zero $0 $? ./run.sh fail_if_zero $0 $? +./stop_s1.sh +./start_s1.sh + +./stop_s4.sh +./start_s4.sh --binlog-do-db=aaa +masterha_check_repl --conf=$CONF > /dev/null 2>&1 +fail_if_zero $0 $? + +./run.sh +fail_if_zero $0 $? + +./stop_s4.sh +./start_s4.sh --replicate-ignore-db=aaa +masterha_check_repl --conf=$CONF > /dev/null 2>&1 +fail_if_zero $0 $? + +./run.sh +fail_if_zero $0 $? echo "$0 [Pass]"