Strange behavior of DBD/DBI Informix

Strange behavior of DBD/DBI Informix

Post by iiug-l.. » Wed, 02 Jul 2003 00:29:29



I  am  not sure if this list is the best one to post to regarding this
problem. If not please point me to the better one.

Consider the following scenario:
1)$dbh = DBI->connect("dbi:Informix:$database", '', '',
                        { PrintError => 1, RaiseError => 1});
2)$sql = qq{ INSERT INTO sometable VALUES ( somevalues ) };
3)$sth = $dbh->prepare( $sql )  or die "Failed to prepare '$sql'\n";
4)$dbh->disconnect;
5)N statements of the form
$sth->bind_param( K, somevalue );
(K=1..N)
6)$ret = $sth->execute;

After doing 4) I still can execute 5) and 6) without any obvious error
message. Of course no insert occurs but it is not clear why (supposing
we do not know about 4).
Even more, while testing the return code $ret We still can not
understand what is the problem. $ret is equal to '0E0' that can mean
1) "statement does not affect any rows"
2) "cursor is opened successfully"


$DBI::errstr
sqlcode
sqlerrm
show nothing in this situation.

Should I check something else?
Is it bug ("feature")?

Your comments are very welcome.

Alexandre Krasnov.
(TERN Group - Russia)
sending to informix-list

 
 
 

Strange behavior of DBD/DBI Informix

Post by Jonathan Leffle » Wed, 02 Jul 2003 13:28:38



> I  am  not sure if this list is the best one to post to regarding this
> problem. If not please point me to the better one.


Quote:> Consider the following scenario:
> 1)$dbh = DBI->connect("dbi:Informix:$database", '', '',
>                         { PrintError => 1, RaiseError => 1});
> 2)$sql = qq{ INSERT INTO sometable VALUES ( somevalues ) };
> 3)$sth = $dbh->prepare( $sql )  or die "Failed to prepare '$sql'\n";
> 4)$dbh->disconnect;
> 5)N statements of the form
> $sth->bind_param( K, somevalue );
> (K=1..N)
> 6)$ret = $sth->execute;

> After doing 4) I still can execute 5) and 6) without any obvious error
> message. Of course no insert occurs but it is not clear why (supposing
> we do not know about 4).

I could live with 5 not causing problems - not happy, but I could live
with it.  Step 6 should unequivocally fail.

> Even more, while testing the return code $ret We still can not
> understand what is the problem. $ret is equal to '0E0' that can mean
> 1) "statement does not affect any rows"
> 2) "cursor is opened successfully"

> All of

> $DBI::errstr
> sqlcode
> sqlerrm
> show nothing in this situation.

> Should I check something else?
> Is it bug ("feature")?

At first glance, it is a bug - in DBD::Informix.

Quote:> Your comments are very welcome.

> Alexandre Krasnov.
> (TERN Group - Russia)
> sending to informix-list

Please - always - send the version information of:
        Platform (o/s in particular, sometimes h/w)
        Perl
        DBI
        DBD::Informix
        ESQL/C or CSDK
        Database server
Or use the bug reporting mechanisms provided with DBD::Informix.

And please send a simple, self-contained reproduction of the problem.

using DBD::Informix::TestHarness;
my $dbh = DBI->connect({RaiseError => 1, Printerror => 1});
$dbh->do(q{CREATE TEMP TABLE SomeTable(col01 integer not null)});
my $sql = "INSERT INTO SomeTable VALUES(?)";
my $sth = $dbh->prepare($sql);
$dbh->disconnect;
$sth->bind_param(1, 1);
$sth->execute;

This should produce an error, definitely on the execute, and very
arguably on the bind_param.  I thought there was a test to validate
this stuff - but either that test is broken or it is AWOL.

--
Jonathan Leffler                   #include <disclaimer.h>

Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/

 
 
 

Strange behavior of DBD/DBI Informix

Post by iiug-l.. » Wed, 09 Jul 2003 17:29:05


I  tried  sending   this   problem   to   the  address  specified  in

received the error reply:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your message

  Subject: Strange behavior of DBD/DBI Informix

was not delivered to:


because:


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Is  there any other option (except dbi-users mailing list) to send bug
report to?

Alexandre Krasnov.

sending to informix-list

 
 
 

Strange behavior of DBD/DBI Informix

Post by Jonathan Leffle » Wed, 09 Jul 2003 23:09:10



> I  tried  sending   this   problem   to   the  address  specified  in

> received the error reply:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Your message

>   Subject: Strange behavior of DBD/DBI Informix

> was not delivered to:


> because:


> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Is  there any other option (except dbi-users mailing list) to send bug
> report to?

> Alexandre Krasnov.

> sending to informix-list

Yes, send it to me.  Preferably via one of the public forums (c.d.i or
dbi-users) since there's always a chance someone else can help.  You
must be using an older version of DBD::Informix since the notes in
2003.04 says this.  It would end up with me even if one of the
alternative addresses worked.

--
Jonathan Leffler                   #include <disclaimer.h>

Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/