Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix slave-user and slave-password with pt-table-checksum #381

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bin/pt-table-sync
Original file line number Diff line number Diff line change
Expand Up @@ -6776,7 +6776,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;
Expand Down Expand Up @@ -6823,7 +6823,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 );
}
}
}
Expand Down Expand Up @@ -10418,6 +10418,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 ) = @_;
Expand Down