used ReadKeyMini. Moved double password logic to Cxn. Removed {ask_pass} from Cxn

This commit is contained in:
Frank Cizmich
2015-01-12 19:20:15 -02:00
parent 2fb93db909
commit b025c97fd7
8 changed files with 178 additions and 20 deletions

View File

@@ -2295,7 +2295,7 @@ sub new {
set => $args{set},
NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1,
dbh_set => 0,
ask_pass => $o->get('ask-pass') || $args{ask_pass},
ask_pass => $o->get('ask-pass'),
DSNParser => $dp,
is_cluster_node => undef,
parent => $args{parent},
@@ -2311,7 +2311,7 @@ sub connect {
my $dbh = $self->{dbh};
if ( !$dbh || !$dbh->ping() ) {
if ( $self->{ask_pass} && !$self->{asked_for_pass} ) {
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
$self->{asked_for_pass} = 1;
}