You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I am in RaiseError mode and want to use one of the database handle method which can take a statement in lieu of a string, it doesn't raise an error if it points to a disconnected database. Could the disconnected handle keep track that it was in RaiseError=>1 mode even after being discontinued?
perl -wle 'use strict; use Data::Dumper; use DBI; my $dbh=DBI->connect("dbi:Pg:",undef,undef,{RaiseError=>1}); my $sth=$dbh->prepare("select * from pgbench_accounts limit 5"); $dbh->disconnect(); $dbh=DBI->connect("dbi:Pg:",undef,undef,{RaiseError=>1}); my $x=$dbh->selectrow_array($sth); print Dumper $x; print $DBD::Pg::VERSION; print $sth->errstr'
$VAR1 = undef;
3.6.2
Cannot call execute on a disconnected database handle
The text was updated successfully, but these errors were encountered:
Hi @jeffjanes I think this is handled inside of DBI itself; the RaiseError attribute isn't handled in the code at all. I would expect you to see a similar issue/error with any other DBD module.
Since this is an inherited attribute and the DBH is undefined at the point this error is raised, I'm not seeing how/where we can accomplish this without stashing the individual attributes when creating STHs, which might be worth doing.
I'm adding this to the future ideas list to consider, but not considering this a bug at this point.
If I am in RaiseError mode and want to use one of the database handle method which can take a statement in lieu of a string, it doesn't raise an error if it points to a disconnected database. Could the disconnected handle keep track that it was in RaiseError=>1 mode even after being discontinued?
perl -wle 'use strict; use Data::Dumper; use DBI; my $dbh=DBI->connect("dbi:Pg:",undef,undef,{RaiseError=>1}); my $sth=$dbh->prepare("select * from pgbench_accounts limit 5"); $dbh->disconnect(); $dbh=DBI->connect("dbi:Pg:",undef,undef,{RaiseError=>1}); my $x=$dbh->selectrow_array($sth); print Dumper $x; print $DBD::Pg::VERSION; print $sth->errstr'
$VAR1 = undef;
3.6.2
Cannot call execute on a disconnected database handle
The text was updated successfully, but these errors were encountered: