On Wed, Jul 02, 2003 at 12:09:04PM +0100, Tim Bunce wrote:
> On Tue, Jul 01, 2003 at 09:59:10PM -0400, David Coulthart wrote:
> > > A DBI trace may help. And send me the code around Ingres.pm line 116.
> >
> > The code from Ingres.pm (for both 0.32 and 0.36) around line 116 is the
> > do routine:
> >
> > { package DBD::Ingres::db; # ====== DATABASE ======
> > use strict;
> >
> > sub do {
> > my($dbh, $statement, $attribs, @params) = @_;
> > Carp::carp "DBD::Ingres::\$dbh->do() attribs unused\n" if
> > $attribs;
> > Carp::carp "DBD::Ingres::\$dbh->do() params unused\n" if
> > @params;
> > $dbh->{Statement} = $statement;
>
> That's just plain wrong. The DBI manages the Statement attribute on
> behalf of the drivers. Drivers almost never have to touch it.
>
> Delete that line.
>
> > my $numrows = DBD::Ingres::db::_do($dbh, $statement);
> > undef $dbh->{Statement};
And that one.
Tim.
> > return $numrows;
> > }
> >
> >
> > Line 116 in particular is:
> > $dbh->{Statement} = $statement;
> >
> > A simple test case & DBI trace are as follows:
> >
> > #!/usr/bin/perl -w
> >
> > use strict;
> > use DBI;
> >
> > my $dbname = "dbi:Ingres:test";
> >
> > my $dbh = DBI->connect($dbname, "", "",
> > { AutoCommit => 0,
> > RaiseError => 1,
> > });
> > DBI->trace(9, "ingres-trace.log");
> >
> > $dbh->do("CREATE TABLE test1(id INTEGER4 not null, name CHAR(64))");
> >
> > DBI->trace(0);
> >
> > $dbh->disconnect();
> >
> >
> > Executing this script generated the following error messages on stderr
> > bseides the trace log below:
> >
> > Modification of non-creatable hash value attempted, subscript
> > "Statement" at
> > /opt/perl5.6.1/lib/site_perl/5.6.1/sun4-solaris/DBD/Ingres.pm line 116.
> > Issuing rollback() for database handle being DESTROY'd without explicit
> > disconnect().
> >
> >
> > The trace from executing this test case is:
> >
> > DBI 1.37-nothread dispatch trace level set to 9
> > >> do DISPATCH (DBI::db=HASH(0x10ea14) rc1/1 @2 g0 ima201
> > pid#13895) at ./testing.pl line 14
> > -> do for DBD::Ingres::db (DBI::db=HASH(0x10ea14)~0x1f05ac 'CREATE
> > TABLE test1(id INTEGER4 not null, name CHAR(64))')
> > >> DESTROY DISPATCH (DBI::db=HASH(0x10ea14) rc1/1 @1 g0 ima4
> > pid#13895)
> > <> DESTROY ignored for outer handle DBI::db=HASH(0x10ea14) (inner
> > DBI::db=HASH(0x1f05ac))
> > >> DESTROY DISPATCH (DBI::db=HASH(0x1f05ac) rc1/1 @1 g0 ima4
> > pid#13895)
> > -> DESTROY for DBD::Ingres::db (DBI::db=HASH(0x1f05ac)~INNER)
> > DBD::Ingres::dbd_db_rollback
> > DBD::Ingres::dbd_db_disconnect
> > DBD::Ingres::dbd_db_destroy
> > <- DESTROY= undef
> > DESTROY (dbih_clearcom) (dbh 0x10ea14 0x186ce0, com 0xfbad8, imp
> > DBD::Ingres::db):
> > FLAGS 0x191: COMSET Warn RaiseError PrintError
> > PARENT DBI::dr=HASH(0x10ea38)
> > KIDS 0 (0 Active)
> > IMP_DATA undef
> > dbih_clearcom 0x10ea14 (com 0xfbad8, type 2) done.
> >
> > -- DBI::END
> > >> disconnect_all DISPATCH (DBI::dr=HASH(0x1aea08) rc1/3 @1 g0
> > ima801 pid#13895) at
> > /opt/perl5.6.1/lib/site_perl/5.6.1/sun4-solaris/DBI.pm line 649 via
> > ./testing.pl line 0
> > -> disconnect_all for DBD::Ingres::dr
> > (DBI::dr=HASH(0x1aea08)~0x10ea38)
> > <- disconnect_all= '' at
> > /opt/perl5.6.1/lib/site_perl/5.6.1/sun4-solaris/DBI.pm line 649 via
> > ./testing.pl line 0
> > ! >> DESTROY DISPATCH (DBI::dr=HASH(0x10ea38) rc1/1 @1 g0 ima4
> > pid#13895) during global destruction
> > ! -> DESTROY for DBD::Ingres::dr (DBI::dr=HASH(0x10ea38)~INNER)
> > ! <- DESTROY= (not implemented) during global destruction
> > DESTROY (dbih_clearcom) (drh 0x1aea08 0x181d40, com 0xfe878, imp
> > DBD::Ingres::dr):
> > FLAGS 0x215: COMSET Active Warn AutoCommit
> > PARENT undef
> > KIDS 0 (0 Active)
> > IMP_DATA undef
> > dbih_clearcom 0x1aea08 (com 0xfe878, type 1) done.
> >
> > ! >> DESTROY DISPATCH (DBI::dr=HASH(0x1aea08) rc1/1 @1 g0 ima4
> > pid#13895) during global destruction
> > ! <> DESTROY for DBI::dr=HASH(0x1aea08) ignored (inner handle gone)
> >
> >
> > I hope this is enough info to help try to resolve this problem. If not,
> > please let me know what else I can provide.
> >
> > Thx,
> > David Coulthart
> >