~hingo/percona-toolkit/pqd-mongodb-24

« back to all changes in this revision

Viewing changes to bin/pt-table-checksum

  • Committer: Daniel Nichter
  • Date: 2013-03-13 18:38:45 UTC
  • Revision ID: daniel@percona.com-20130313183845-qka3b8qx14yrqgw4
Fix lib/Cxn.pm that didn't merge correctly.  Fix t/lib/OptionParser.t test failure.  Update Cxn, OptionParser, and DSNParser in all tools.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3461
3461
      $dsn = $dp->copy($prev_dsn, $dsn);
3462
3462
   }
3463
3463
 
 
3464
   my $dsn_name = $dp->as_string($dsn, [qw(h P S)])
 
3465
               || $dp->as_string($dsn, [qw(F)])
 
3466
               || '';
 
3467
 
3464
3468
   my $self = {
3465
3469
      dsn             => $dsn,
3466
3470
      dbh             => $args{dbh},
3467
 
      dsn_name        => $dp->as_string($dsn, [qw(h P S)]),
 
3471
      dsn_name        => $dsn_name,
3468
3472
      hostname        => '',
3469
3473
      set             => $args{set},
3470
3474
      NAME_lc         => defined($args{NAME_lc}) ? $args{NAME_lc} : 1,
3471
3475
      dbh_set         => 0,
3472
 
      OptionParser    => $o,
 
3476
      ask_pass        => $o->get('ask-pass'),
3473
3477
      DSNParser       => $dp,
3474
3478
      is_cluster_node => undef,
3475
3479
      parent          => $args{parent},
3482
3486
   my ( $self, %opts ) = @_;
3483
3487
   my $dsn = $self->{dsn};
3484
3488
   my $dp  = $self->{DSNParser};
3485
 
   my $o   = $self->{OptionParser};
3486
3489
 
3487
3490
   my $dbh = $self->{dbh};
3488
3491
   if ( !$dbh || !$dbh->ping() ) {
3489
 
      if ( $o->get('ask-pass') && !$self->{asked_for_pass} ) {
 
3492
      if ( $self->{ask_pass} && !$self->{asked_for_pass} ) {
3490
3493
         $dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
3491
3494
         $self->{asked_for_pass} = 1;
3492
3495
      }