From 4715afc7c0e427b8f5931819d5d46f67a8879fd7 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Tue, 23 Aug 2011 08:31:04 -0600 Subject: [PATCH] Update MasterSlave.pm in all tools. --- bin/pt-archiver | 6 ++++-- bin/pt-heartbeat | 6 ++++-- bin/pt-kill | 6 ++++-- bin/pt-query-digest | 6 ++++-- bin/pt-slave-find | 6 ++++-- bin/pt-slave-restart | 6 ++++-- bin/pt-table-checksum | 2 +- bin/pt-table-sync | 6 ++++-- 8 files changed, 29 insertions(+), 15 deletions(-) diff --git a/bin/pt-archiver b/bin/pt-archiver index 3c05f5c3..d3963c37 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -2981,7 +2981,9 @@ sub get_master_status { MKDEBUG && _d($dbh, 'SHOW MASTER STATUS'); $sth->execute(); my ($ms) = @{$sth->fetchall_arrayref({})}; - MKDEBUG && _d(@$ms); + MKDEBUG && _d( + $ms ? map { "$_=" . (defined $ms->{$_} ? $ms->{$_} : '') } keys %$ms + : ''); if ( !$ms || scalar keys %$ms < 2 ) { MKDEBUG && _d('Server on dbh', $dbh, 'does not seem to be a master'); @@ -3183,7 +3185,7 @@ sub is_replication_thread { my ( $self, $query, %args ) = @_; return unless $query; - my $type = lc $args{type} || 'all'; + my $type = lc($args{type} || 'all'); die "Invalid type: $type" unless $type =~ m/^binlog_dump|slave_io|slave_sql|all$/i; diff --git a/bin/pt-heartbeat b/bin/pt-heartbeat index 1d4754ad..32f3cef2 100755 --- a/bin/pt-heartbeat +++ b/bin/pt-heartbeat @@ -289,7 +289,9 @@ sub get_master_status { MKDEBUG && _d($dbh, 'SHOW MASTER STATUS'); $sth->execute(); my ($ms) = @{$sth->fetchall_arrayref({})}; - MKDEBUG && _d(@$ms); + MKDEBUG && _d( + $ms ? map { "$_=" . (defined $ms->{$_} ? $ms->{$_} : '') } keys %$ms + : ''); if ( !$ms || scalar keys %$ms < 2 ) { MKDEBUG && _d('Server on dbh', $dbh, 'does not seem to be a master'); @@ -491,7 +493,7 @@ sub is_replication_thread { my ( $self, $query, %args ) = @_; return unless $query; - my $type = lc $args{type} || 'all'; + my $type = lc($args{type} || 'all'); die "Invalid type: $type" unless $type =~ m/^binlog_dump|slave_io|slave_sql|all$/i; diff --git a/bin/pt-kill b/bin/pt-kill index ea773bb9..5d124717 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -2693,7 +2693,9 @@ sub get_master_status { MKDEBUG && _d($dbh, 'SHOW MASTER STATUS'); $sth->execute(); my ($ms) = @{$sth->fetchall_arrayref({})}; - MKDEBUG && _d(@$ms); + MKDEBUG && _d( + $ms ? map { "$_=" . (defined $ms->{$_} ? $ms->{$_} : '') } keys %$ms + : ''); if ( !$ms || scalar keys %$ms < 2 ) { MKDEBUG && _d('Server on dbh', $dbh, 'does not seem to be a master'); @@ -2895,7 +2897,7 @@ sub is_replication_thread { my ( $self, $query, %args ) = @_; return unless $query; - my $type = lc $args{type} || 'all'; + my $type = lc($args{type} || 'all'); die "Invalid type: $type" unless $type =~ m/^binlog_dump|slave_io|slave_sql|all$/i; diff --git a/bin/pt-query-digest b/bin/pt-query-digest index cdc1aa83..e7c5f8ab 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -10681,7 +10681,9 @@ sub get_master_status { MKDEBUG && _d($dbh, 'SHOW MASTER STATUS'); $sth->execute(); my ($ms) = @{$sth->fetchall_arrayref({})}; - MKDEBUG && _d(@$ms); + MKDEBUG && _d( + $ms ? map { "$_=" . (defined $ms->{$_} ? $ms->{$_} : '') } keys %$ms + : ''); if ( !$ms || scalar keys %$ms < 2 ) { MKDEBUG && _d('Server on dbh', $dbh, 'does not seem to be a master'); @@ -10883,7 +10885,7 @@ sub is_replication_thread { my ( $self, $query, %args ) = @_; return unless $query; - my $type = lc $args{type} || 'all'; + my $type = lc($args{type} || 'all'); die "Invalid type: $type" unless $type =~ m/^binlog_dump|slave_io|slave_sql|all$/i; diff --git a/bin/pt-slave-find b/bin/pt-slave-find index 1ba4d658..d3792835 100755 --- a/bin/pt-slave-find +++ b/bin/pt-slave-find @@ -1670,7 +1670,9 @@ sub get_master_status { MKDEBUG && _d($dbh, 'SHOW MASTER STATUS'); $sth->execute(); my ($ms) = @{$sth->fetchall_arrayref({})}; - MKDEBUG && _d(@$ms); + MKDEBUG && _d( + $ms ? map { "$_=" . (defined $ms->{$_} ? $ms->{$_} : '') } keys %$ms + : ''); if ( !$ms || scalar keys %$ms < 2 ) { MKDEBUG && _d('Server on dbh', $dbh, 'does not seem to be a master'); @@ -1872,7 +1874,7 @@ sub is_replication_thread { my ( $self, $query, %args ) = @_; return unless $query; - my $type = lc $args{type} || 'all'; + my $type = lc($args{type} || 'all'); die "Invalid type: $type" unless $type =~ m/^binlog_dump|slave_io|slave_sql|all$/i; diff --git a/bin/pt-slave-restart b/bin/pt-slave-restart index 389c6588..5e9d65d7 100755 --- a/bin/pt-slave-restart +++ b/bin/pt-slave-restart @@ -1830,7 +1830,9 @@ sub get_master_status { MKDEBUG && _d($dbh, 'SHOW MASTER STATUS'); $sth->execute(); my ($ms) = @{$sth->fetchall_arrayref({})}; - MKDEBUG && _d(@$ms); + MKDEBUG && _d( + $ms ? map { "$_=" . (defined $ms->{$_} ? $ms->{$_} : '') } keys %$ms + : ''); if ( !$ms || scalar keys %$ms < 2 ) { MKDEBUG && _d('Server on dbh', $dbh, 'does not seem to be a master'); @@ -2032,7 +2034,7 @@ sub is_replication_thread { my ( $self, $query, %args ) = @_; return unless $query; - my $type = lc $args{type} || 'all'; + my $type = lc($args{type} || 'all'); die "Invalid type: $type" unless $type =~ m/^binlog_dump|slave_io|slave_sql|all$/i; diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index e13b1cb5..1a8474f1 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -4056,7 +4056,7 @@ sub is_replication_thread { my ( $self, $query, %args ) = @_; return unless $query; - my $type = lc $args{type} || 'all'; + my $type = lc($args{type} || 'all'); die "Invalid type: $type" unless $type =~ m/^binlog_dump|slave_io|slave_sql|all$/i; diff --git a/bin/pt-table-sync b/bin/pt-table-sync index ec0fcb3c..785ad048 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -6072,7 +6072,9 @@ sub get_master_status { MKDEBUG && _d($dbh, 'SHOW MASTER STATUS'); $sth->execute(); my ($ms) = @{$sth->fetchall_arrayref({})}; - MKDEBUG && _d(@$ms); + MKDEBUG && _d( + $ms ? map { "$_=" . (defined $ms->{$_} ? $ms->{$_} : '') } keys %$ms + : ''); if ( !$ms || scalar keys %$ms < 2 ) { MKDEBUG && _d('Server on dbh', $dbh, 'does not seem to be a master'); @@ -6274,7 +6276,7 @@ sub is_replication_thread { my ( $self, $query, %args ) = @_; return unless $query; - my $type = lc $args{type} || 'all'; + my $type = lc($args{type} || 'all'); die "Invalid type: $type" unless $type =~ m/^binlog_dump|slave_io|slave_sql|all$/i;