Merge branch '3.0' into PT-204

This commit is contained in:
Carlos Salguero
2017-12-06 15:01:47 -03:00
49 changed files with 758 additions and 39 deletions

View File

@@ -172,6 +172,26 @@ sub load_file {
$self->wait_for_slaves() unless $args{no_wait};
}
sub has_engine {
my ( $self, $host, $want_engine ) = @_;
# Get the current checksums on the host.
my $dbh = $self->get_dbh_for($host);
my $sql = "SHOW ENGINES";
my @engines = @{$dbh->selectall_arrayref($sql, {Slice => {} })};
# Diff the two sets of checksums: host to master (ref).
my $has_engine=0;
foreach my $engine ( @engines ) {
if ( $engine->{engine} =~ m/$want_engine/i ) {
$has_engine=1;
last;
}
}
return $has_engine;
}
sub _use_for {
my ( $self, $server ) = @_;
return "$self->{basedir}/$port_for{$server}/use";