Author: timbo
Date: Tue Jun 3 15:18:04 2008
New Revision: 11377
Modified:
dbi/trunk/lib/DBD/Gofer.pm
Log:
Handle lack of rv in response to dbh method when there's a transport error.
Remove redundant $response->rv calls for sth method calls.
Modified: dbi/trunk/lib/DBD/Gofer.pm
==============================================================================
--- dbi/trunk/lib/DBD/Gofer.pm (original)
+++ dbi/trunk/lib/DBD/Gofer.pm Tue Jun 3 15:18:04 2008
@@ -326,6 +326,10 @@
# and return that new sth as if it came from original request
$rv = [ $sth ];
}
+ elsif (!$rv) { # should only occur for major transport-level error
+ #carp("no rv in response { @{[ %$response ]} }");
+ $rv = [ ];
+ }
DBD::Gofer::set_err_from_response($dbh, $response);
@@ -630,19 +634,19 @@
$dbh->{go_dbh_attributes_fetched} = $dbh_attributes;
}
- my $rv = $response->rv;
+ my $rv = $response->rv; # may be undef on error
if ($response->sth_resultsets) {
# setup first resultset - including sth attributes
$sth->more_results;
}
else {
$sth->STORE(Active => 0);
- $sth->{go_rows} = $response->rv;
+ $sth->{go_rows} = $rv;
}
# set error/warn/info (after more_results as that'll clear err)
DBD::Gofer::set_err_from_response($sth, $response);
- return $response->rv;
+ return $rv;
}