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

« back to all changes in this revision

Viewing changes to bin/pt-online-schema-change

  • 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:
3683
3683
      $dsn = $dp->copy($prev_dsn, $dsn);
3684
3684
   }
3685
3685
 
 
3686
   my $dsn_name = $dp->as_string($dsn, [qw(h P S)])
 
3687
               || $dp->as_string($dsn, [qw(F)])
 
3688
               || '';
 
3689
 
3686
3690
   my $self = {
3687
3691
      dsn             => $dsn,
3688
3692
      dbh             => $args{dbh},
3689
 
      dsn_name        => $dp->as_string($dsn, [qw(h P S)]),
 
3693
      dsn_name        => $dsn_name,
3690
3694
      hostname        => '',
3691
3695
      set             => $args{set},
3692
3696
      NAME_lc         => defined($args{NAME_lc}) ? $args{NAME_lc} : 1,
3693
3697
      dbh_set         => 0,
3694
 
      OptionParser    => $o,
 
3698
      ask_pass        => $o->get('ask-pass'),
3695
3699
      DSNParser       => $dp,
3696
3700
      is_cluster_node => undef,
3697
3701
      parent          => $args{parent},
3704
3708
   my ( $self, %opts ) = @_;
3705
3709
   my $dsn = $self->{dsn};
3706
3710
   my $dp  = $self->{DSNParser};
3707
 
   my $o   = $self->{OptionParser};
3708
3711
 
3709
3712
   my $dbh = $self->{dbh};
3710
3713
   if ( !$dbh || !$dbh->ping() ) {
3711
 
      if ( $o->get('ask-pass') && !$self->{asked_for_pass} ) {
 
3714
      if ( $self->{ask_pass} && !$self->{asked_for_pass} ) {
3712
3715
         $dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
3713
3716
         $self->{asked_for_pass} = 1;
3714
3717
      }