mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-05 20:07:54 +00:00
Merge branch '3.0' into PT-204
This commit is contained in:
@@ -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";
|
||||
|
Reference in New Issue
Block a user