fix postgres databasesize mode, missing empty selection (#1047)
This commit is contained in:
parent
3803de2aa7
commit
97672a5339
|
@ -79,6 +79,8 @@ sub manage_selection {
|
|||
|
||||
my $result = $self->{sql}->fetchall_arrayref();
|
||||
|
||||
$self->{databases} = {};
|
||||
|
||||
foreach my $row (@$result) {
|
||||
next if (defined($self->{option_results}->{filter_database}) && $self->{option_results}->{filter_database} ne ''
|
||||
&& $$row[0] !~ /$self->{option_results}->{filter_database}/);
|
||||
|
@ -86,6 +88,11 @@ sub manage_selection {
|
|||
$self->{databases}->{$$row[0]}->{display} = $$row[0];
|
||||
$self->{databases}->{$$row[0]}->{size} = $$row[1];
|
||||
}
|
||||
|
||||
if (scalar(keys %{$self->{databases}}) <= 0) {
|
||||
$self->{output}->add_option_msg(short_msg => 'No databases found');
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Loading…
Reference in New Issue