Build percona-toolkit-2.2.2

This commit is contained in:
Brian Fraser
2013-04-19 20:26:48 -03:00
parent 2e8ad61453
commit 871e217f3b
39 changed files with 606 additions and 81 deletions

View File

@@ -42,7 +42,7 @@ BEGIN {
# ###########################################################################
{
package Percona::Toolkit;
our $VERSION = '2.2.1';
our $VERSION = '2.2.2';
1;
}
@@ -60,6 +60,7 @@ our $VERSION = '2.2.1';
# ###########################################################################
{
package Lmo::Utils;
use strict;
use warnings qw( FATAL all );
require Exporter;
@@ -67,7 +68,12 @@ our (@ISA, @EXPORT, @EXPORT_OK);
BEGIN {
@ISA = qw(Exporter);
@EXPORT = @EXPORT_OK = qw(_install_coderef _unimport_coderefs _glob_for _stash_for);
@EXPORT = @EXPORT_OK = qw(
_install_coderef
_unimport_coderefs
_glob_for
_stash_for
);
}
{
@@ -251,7 +257,6 @@ sub meta {
return Lmo::Meta->new(class => $class);
}
1;
}
# ###########################################################################
@@ -2326,6 +2331,32 @@ sub name {
return $self->{hostname} || $self->{dsn_name} || 'unknown host';
}
sub remove_duplicate_cxns {
my ($self, %args) = @_;
my @cxns = @{$args{cxns}};
my $seen_ids = $args{seen_ids} || {};
PTDEBUG && _d("Removing duplicates from ", join(" ", map { $_->name } @cxns));
my @trimmed_cxns;
for my $cxn ( @cxns ) {
my $dbh = $cxn->dbh();
my $sql = q{SELECT @@server_id};
PTDEBUG && _d($sql);
my ($id) = $dbh->selectrow_array($sql);
PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id);
if ( ! $seen_ids->{$id}++ ) {
push @trimmed_cxns, $cxn
}
else {
PTDEBUG && _d("Removing ", $cxn->name,
", ID ", $id, ", because we've already seen it");
}
}
return \@trimmed_cxns;
}
sub DESTROY {
my ($self) = @_;
@@ -5664,6 +5695,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-config-diff 2.2.1
pt-config-diff 2.2.2
=cut