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

« back to all changes in this revision

Viewing changes to bin/pt-deadlock-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:
2567
2567
      $dsn = $dp->copy($prev_dsn, $dsn);
2568
2568
   }
2569
2569
 
 
2570
   my $dsn_name = $dp->as_string($dsn, [qw(h P S)])
 
2571
               || $dp->as_string($dsn, [qw(F)])
 
2572
               || '';
 
2573
 
2570
2574
   my $self = {
2571
2575
      dsn             => $dsn,
2572
2576
      dbh             => $args{dbh},
2573
 
      dsn_name        => $dp->as_string($dsn, [qw(h P S)]),
 
2577
      dsn_name        => $dsn_name,
2574
2578
      hostname        => '',
2575
2579
      set             => $args{set},
2576
2580
      NAME_lc         => defined($args{NAME_lc}) ? $args{NAME_lc} : 1,
2577
2581
      dbh_set         => 0,
2578
 
      OptionParser    => $o,
 
2582
      ask_pass        => $o->get('ask-pass'),
2579
2583
      DSNParser       => $dp,
2580
2584
      is_cluster_node => undef,
2581
2585
      parent          => $args{parent},
2588
2592
   my ( $self, %opts ) = @_;
2589
2593
   my $dsn = $self->{dsn};
2590
2594
   my $dp  = $self->{DSNParser};
2591
 
   my $o   = $self->{OptionParser};
2592
2595
 
2593
2596
   my $dbh = $self->{dbh};
2594
2597
   if ( !$dbh || !$dbh->ping() ) {
2595
 
      if ( $o->get('ask-pass') && !$self->{asked_for_pass} ) {
 
2598
      if ( $self->{ask_pass} && !$self->{asked_for_pass} ) {
2596
2599
         $dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
2597
2600
         $self->{asked_for_pass} = 1;
2598
2601
      }