PT-139 Detect only 1 slave using rep channels

If there is only one slave but it is using replication channels but
--channel was not specified as a parameter, get_slave_status will
return null.
This commit is contained in:
Carlos Salguero
2017-05-22 15:48:32 -03:00
parent fc4b3a73ee
commit 8ca82d085e
2 changed files with 20 additions and 1 deletions

View File

@@ -814,6 +814,20 @@ SKIP: {
'Wait for master returned error',
);
# After stopping one of the replication channels, show slave status returns only one slave
# but it has a channel name and we didn't specified a channels name in the command line.
# It should return undef
$slave1_dbh->do("STOP SLAVE for channel 'masterchan2'");
$css = $ms->get_slave_status($slave1_dbh);
is (
$css,
undef,
'Cannot determine slave in a multi source config without --channel param (only one server)'
);
$slave1_dbh->do("START SLAVE for channel 'masterchan2'");
# Now try specifying a channel name
$ms->{channel} = 'masterchan1';
$css = $ms->get_slave_status($slave1_dbh);