Operations on statement handles when database handle is disconnected

Jonathan Leffler <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
Tested using Perl 5.13.4 and DBI 1.616 now - but I originally spotted the
problem in 2003 when the versions were a lot older...

Consider:

# Test that statement handles from disconnected connections fail!

use strict;
use warnings;
use DBI;

my $table = "dbd_tester";
my $dbh = DBI->connect('dbi:NullP:immaterial', '', '', {RaiseError=>1});
#connect_to_test_database({RaiseError => 1});
my $sth = $dbh->prepare(qq{INSERT INTO $table VALUES(?)});
$dbh->disconnect;
$sth->execute(1);
print "** Failed to FAIL!\n";


The print statement is executed, despite the fact that errors are supposed
to be raised.
I get the same result using DBD::Informix instead of NullP.

Is this a defect in DBI or in DBD::Informix (and NullP)?  Or is it WAD -
Working As Designed?

-- 
Jonathan Leffler <[email protected]>  #include <disclaimer.h>
Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.