Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Return an empty Parcel if we have no results in Pg
Otherwise, fetchrow-hash ends up being a non-falsy value
  • Loading branch information
hoelzro committed Jun 29, 2015
1 parent b8260de commit fbe5826
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/DBDish/Pg.pm6
Expand Up @@ -269,7 +269,7 @@ class DBDish::Pg::StatementHandle does DBDish::StatementHandle {

method fetchrow() {
my @row_array;
return if $!current_row >= $!row_count;
return () if $!current_row >= $!row_count;

unless defined $!field_count {
$!field_count = PQnfields($!result);
Expand Down Expand Up @@ -317,7 +317,7 @@ class DBDish::Pg::StatementHandle does DBDish::StatementHandle {
method fetchall_hashref(Str $key) {
my %results;

return if $!current_row >= $!row_count;
return () if $!current_row >= $!row_count;

while my $row = self.fetchrow_hashref {
%results{$row{$key}} = $row;
Expand Down

0 comments on commit fbe5826

Please sign in to comment.