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

@@ -457,7 +457,12 @@ sub get_slave_status {
}
}
} else {
$ss = $sss_rows->[0];
if ($sss_rows->[0]->{channel_name} && $sss_rows->[0]->{channel_name} ne $self->{channel}) {
warn 'This server is using replication channels but "channel" was not specified on the command line';
return undef;
} else {
$ss = $sss_rows->[0];
}
}
if ( $ss && %$ss ) {