From fbecaf23fd5ea4839ef608ff371c59102b3c27f6 Mon Sep 17 00:00:00 2001 From: Paul Tobias Date: Thu, 13 Dec 2018 14:27:23 +0700 Subject: [PATCH 1/3] Fix `$slave_password => $slave_password` --- bin/pt-table-sync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pt-table-sync b/bin/pt-table-sync index c25dbe6f0..0ad0188ed 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -6809,7 +6809,7 @@ sub recurse_to_slaves { PTDEBUG && _d('Recursing from', $dp->as_string($dsn), 'to', $dp->as_string($slave)); $self->recurse_to_slaves( - { %$args, dsn => $slave, dbh => undef, parent => $dsn, slave_user => $slave_user, $slave_password => $slave_password }, $level + 1 ); + { %$args, dsn => $slave, dbh => undef, parent => $dsn, slave_user => $slave_user, slave_password => $slave_password }, $level + 1 ); } } } From 88bc4ab229a5f6ae0610ad915055fa995b071ba5 Mon Sep 17 00:00:00 2001 From: Paul Tobias Date: Thu, 13 Dec 2018 14:28:48 +0700 Subject: [PATCH 2/3] Fix not passing the slave-user and slave-password parameters when calling recurse_to_slaves() --- bin/pt-table-sync | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 0ad0188ed..130c63a3d 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -10385,6 +10385,8 @@ sub sync_via_replication { $ms->recurse_to_slaves( { dbh => $src->{dbh}, dsn => $src->{dsn}, + slave_user => $o->got('slave-user') ? $o->get('slave-user') : '', + slave_password => $o->got('slave-password') ? $o->get('slave-password') : '', recurse => 1, callback => sub { my ( $dsn, $dbh, $level, $parent ) = @_; From da3593faef421e6d279d45e8256d6f81c5cbe1cd Mon Sep 17 00:00:00 2001 From: Paul Tobias Date: Thu, 13 Dec 2018 14:29:49 +0700 Subject: [PATCH 3/3] Fix "Use of uninitialized value in concatenation (.) or string at /usr/bin/pt-table-sync line 6765." When using PTDEBUG=1 and the --slave-user parameter --- bin/pt-table-sync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 130c63a3d..55b379bbe 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -6762,7 +6762,7 @@ sub recurse_to_slaves { my $slave_dsn = $dsn; if ($slave_user) { $slave_dsn->{u} = $slave_user; - PTDEBUG && _d("Using slave user $slave_user on ".$slave_dsn->{h}.":".$slave_dsn->{P}); + PTDEBUG && _d("Using slave user $slave_user on ".$dp->as_string($slave_dsn)); } if ($slave_password) { $slave_dsn->{p} = $slave_password;