Skip to content

Commit

Permalink
remove debugging output and bogus &die
Browse files Browse the repository at this point in the history
all postgres tests pass!
(which really just means we need more tests :-)
  • Loading branch information
moritz committed Apr 21, 2012
1 parent f1da178 commit a7cfbbe
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions lib/MiniDBD/Pg.pm6
Expand Up @@ -109,18 +109,14 @@ class MiniDBD::Pg::StatementHandle does MiniDBD::StatementHandle {
$statement .= subst("?","'$param'"); # quote non numerics
}
}
note "Statement: $statement";
note "pg_conn: $!pg_conn.perl()";
$!result = PQexec($!pg_conn, $statement); # 0 means OK
die 'PQexec returned a Null pointer';
my $status = PQresultStatus($!result);
if $status != PGRES_EMPTY_QUERY | PGRES_COMMAND_OK | PGRES_TUPLES_OK | PGRES_COPY_OUT | PGRES_COPY_IN {
self!set_errstr(PQresultErrorMessage($!result));
if $!RaiseError { die self!errstr; }
}
self!set_errstr(Any);
$!row_count = PQntuples($!result);
note "DEBUG in execute: row_count $!row_count";

my $rows = self.rows;
return ($rows == 0) ?? "0E0" !! $rows;
Expand Down Expand Up @@ -184,7 +180,6 @@ class MiniDBD::Pg::StatementHandle does MiniDBD::StatementHandle {
unless defined $!field_count {
$!field_count = PQnfields($!result);
}
die "field_count: $!field_count";
if defined $!result {
self!set_errstr(Any);

Expand All @@ -207,15 +202,11 @@ class MiniDBD::Pg::StatementHandle does MiniDBD::StatementHandle {
method fetch() { self.fetchrow_arrayref(); } # alias according to perldoc DBI
method fetchall_arrayref() {
my $all_arrayref;
note 'DEBUG fetchall_arrayref';

note "current_row: $!current_row; row_count: $!row_count";
return if $!current_row >= $!row_count;

unless defined $!field_count {
$!field_count = PQnfields($!result);
}
say "DEBUG field_count: $!field_count";
if defined $!result {
self!set_errstr(Any);
my @all_array;
Expand Down

0 comments on commit a7cfbbe

Please sign in to comment.