Re[2]: Strange behavior of DBI/DBD::Informix

Ask a Question related to Informix, Design and Development.

  1. #1

    Default Re[2]: Strange behavior of DBI/DBD::Informix


    Thank you for the reply.

    Sorry, I wrote late in the evening and forgot to post my
    configuration:
    Perl 5.6.1
    AIX 4.2.1 (I know it's old but this should not be relevant to the
    problem)
    DBI 1.32
    DBD-Informix-1.04.PC1
    IDS 7.30.UC8
    ESQL/C 9.30.UC1
    SDK 2.40.UC1

    All software is located on the same server.

    I could not test this with the newer version or on the other platform
    right now...

    Recently I sent just a scenario.
    Here is the working example (change appropriately environment,
    database name and column name):

    ~~~~~~~ cut here ~~~~~~~~~~~
    #!/usr/local/bin/perl -w

    $ENV{INFORMIXDIR}='/home/informix';
    $ENV{INFORMIXSERVER}='informixservername';
    $ENV{ONCONFIG}='onconfig';

    $database="test";

    use locale;
    use DBI qw(:sql_types);
    use DBD::Informix qw(:ix_types);

    $dbh = DBI->connect("dbi:Informix:$database", '', '',
    { PrintError => 1, RaiseError => 1});

    $sql = qq{ INSERT INTO testcol VALUES ( ? ) };
    $sth = $dbh->prepare( $sql ) or die "Failed to prepare '$sql'\n";

    $dbh->disconnect;

    $sth->bind_param( 1, 'q' );
    $ret = $sth->execute;

    if( $@ ) {
    warn "Database error: $DBI::errstr\n";
    }

    if ( $ret!=1 )
    { print "ret=$ret\n";
    if ( defined $DBI::errstr ) { print "DBI err: $DBI::errstr\n"; }
    else { print "IFX err: $sth->{ix_sqlcode}:$sth->{ix_sqlerrm}\n"; }
    exit;
    }
    ~~~~~~~~~~~~~~~~~~~~~~~ cut here ~~~~~~~~~~~~~~~~~~~~~~~
    >> 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).
    JL> I could live with 5 not causing problems - not happy, but I could live
    JL> 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")?
    JL> At first glance, it is a bug - in DBD::Informix.
    >> Your comments are very welcome.
    >>
    >>
    >> Alexandre Krasnov.
    >> (TERN Group - Russia)
    >> sending to informix-list
    JL> Please - always - send the version information of:
    JL> Platform (o/s in particular, sometimes h/w)
    JL> Perl
    JL> DBI
    JL> DBD::Informix
    JL> ESQL/C or CSDK
    JL> Database server
    JL> Or use the bug reporting mechanisms provided with DBD::Informix.

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

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

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





    Best regards,
    Alexandre Krasnov.

    sending to informix-list
    iiug-list@tern.ru Guest

  2. Similar Questions and Discussions

    1. Strange behavior
      The problem seems to be in c code calling ruby calling c code. ======== start test.rb puts "about to require curses" require "curses" puts...
    2. Strange behavior of $.
      Apparently $. is not always set correct (see second ruby 1liner). Is this a bug? 12:12:42 : cat -n n 1 2 3 BAR="hello" 4 12:12:47 : ruby...
    3. Strange behavior of DBI/DBD::Informix
      I tried sending this problem to the address specified in DBD::Informix::TechSupport (perldoc) - dbd-informix@us.ibm.com but...
    4. Strange behavior of DBD/DBI Informix
      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...
    5. Why strange IF...ELSE behavior
      Hi all, I'm getting a strange result with the following IF statement: $bar = ($foo == 'last') ? true : false; In my script $foo normaly has...
  3. #2

    Default Re[2]: Strange behavior of DBI/DBD::Informix


    Hi.

    I built a new test environment finally. The behavior is the same. No
    error appears if I disconnect before binding parameters and executing
    SQL.

    Here is the new tested versions information:

    DBI-1.37
    DBD-Informix-2003.04
    # esql -V
    INFORMIX-ESQL Version 9.51.UC3
    IDS 9.30.UC1 and IDS 9.30.FC1 (both are checked)

    # perl -V
    Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
    Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris
    uname='sunos name 5.8 generic_108528-19 sun4u sparc sunw,sun-blade-1000 '
    config_args='-ds -e'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    Compiler:
    cc='/opt/SUNWspro/bin/cc', ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE
    -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-I/usr/local/include'
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
    Linker and Libraries:
    ld='/opt/SUNWspro/bin/cc', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
    Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib'


    Characteristics of this binary (from libperl):
    Compile-time options: USE_LARGE_FILES
    Built under solaris
    Compiled at Jul 14 2003 10:15:15
    @INC:
    /usr/local/lib/perl5/5.8.0/sun4-solaris
    /usr/local/lib/perl5/5.8.0
    /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.8.0
    /usr/local/lib/perl5/site_perl
    iiug-list@tern.ru Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139