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

« back to all changes in this revision

Viewing changes to bin/pt-fk-error-logger

  • 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:
1724
1724
      $dsn = $dp->copy($prev_dsn, $dsn);
1725
1725
   }
1726
1726
 
 
1727
   my $dsn_name = $dp->as_string($dsn, [qw(h P S)])
 
1728
               || $dp->as_string($dsn, [qw(F)])
 
1729
               || '';
 
1730
 
1727
1731
   my $self = {
1728
1732
      dsn             => $dsn,
1729
1733
      dbh             => $args{dbh},
1730
 
      dsn_name        => $dp->as_string($dsn, [qw(h P S)]),
 
1734
      dsn_name        => $dsn_name,
1731
1735
      hostname        => '',
1732
1736
      set             => $args{set},
1733
1737
      NAME_lc         => defined($args{NAME_lc}) ? $args{NAME_lc} : 1,
1734
1738
      dbh_set         => 0,
1735
 
      OptionParser    => $o,
 
1739
      ask_pass        => $o->get('ask-pass'),
1736
1740
      DSNParser       => $dp,
1737
1741
      is_cluster_node => undef,
1738
1742
      parent          => $args{parent},
1745
1749
   my ( $self, %opts ) = @_;
1746
1750
   my $dsn = $self->{dsn};
1747
1751
   my $dp  = $self->{DSNParser};
1748
 
   my $o   = $self->{OptionParser};
1749
1752
 
1750
1753
   my $dbh = $self->{dbh};
1751
1754
   if ( !$dbh || !$dbh->ping() ) {
1752
 
      if ( $o->get('ask-pass') && !$self->{asked_for_pass} ) {
 
1755
      if ( $self->{ask_pass} && !$self->{asked_for_pass} ) {
1753
1756
         $dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
1754
1757
         $self->{asked_for_pass} = 1;
1755
1758
      }