Re: T95int8 test - Perl DBD, AIX 5.3, 9.40FC3,CSDK2.90FC3
Posted in 2005
And, I've established what the trouble is, and I've got a couple of
alternative fixes for it.
The problem is actually in the code for inserting data, not the
retrieval (oops - well, it had to be a problem coming or going; I
guessed coming and it was going). The problem is that a Perl IV on a
64-bit machine has 8-byte integers, and I was trying to stuff those 8
bytes into a 4-byte SQLINT, and it doesn't work! The fix is to
recognize when this can happen (sizeof(long) != sizeof(int4)) and the
absolute value of the integer is too big for SQLINT. The alternatives
are to stuff the value into an INT8 or to format it as a string.
I'm faintly hoping to release a new version of DBD::Informix this week
- that is beginning to look somewhat optimistic.
On 7/26/05, Jonathan Leffler <jleffler.iiug@gmail.com> wrote:
> Dear Sam,
>
> Yes, I've seen exactly that behaviour. I haven't managed to debug it yet.
>
> The values are:
> # Big number 2 = 100884000276480
> ok 1
> # Row 2: Got unexpected row of data!
> # id: = -486539264
>
> When you look at those numbers in hex, you get:
> 0x5BC0E3000000
> 0x00001D000000
>
> I'm sure it isn't a coincidence that 0x1D+0xE3 = 0x100; but I can't
> fathom what is going wrong, and I've not yet produced a stripped down
> reproduction. I also don't think that is it wholly a coincidence that
> the first number (the one that's OK) is smaller than 4 GB.
>
> At this stage, I don't know whether the problem is in DBD::Informix or
> in ESQL/C - but the bogus value comes back straight from the EXEC SQL
> GET DESCRIPTOR into a string that collects the value.
>
> You're using the FC3 release of CSDK; I got the same result with the
> FN075 (nightly build), but now I don't need to check whether the
> problem is in the build. Thanks.
>
>
> On 7/26/05, Gentsch, Sam <sgentsch@intercall.com> wrote:
> > Have any of you had problems with DBD::Informix and int8's?
> >
> > I am getting 99.15/99.87% OK, and the failing test is t85int8.t
> >
> > Running table creation and insert of big numbers in dbaccess appears to
> > be peachy.
> > We did have a fubar with the SA's who initially built Perl 32 bit, but
> > that was corrected and I rebuilt DBI and then installed DBD.
> >
> > I failed miserably trying to make uninstall or run u DBI in CPAN shell,
> > so I HOPE that the build and install overwrote the 32 bit DBI (maybe not
> > ... if that is the problem how the heck do I remove a package, just
> > manually rm the thing?)
> >
> >
> > Manual run of failed test follows:
> > # perl t95int8.t
> > # Driver Information
> > # Name: Informix
> > # Version: 2005.01
> > # Product: IBM Informix CSDK Version 2.90, IBM
> > Informix-ESQL Version 2.90.FC3
> > # Product Version: 290
> > # Connect to: stores
> > # IUS data types can be tested!
> > 1..2
> > # Big number 1 = 4278190080
> > # Big number 2 = 100884000276480
> > ok 1
> > # Row 2: Got unexpected row of data!
> > # id: = -486539264
> > # Did not get a row corresponding to expected key 100884000276480 #
> > Passed 1 row(s) out of 2 expected; failed 2 not ok 2 # *** Testing of
> > DBD::Informix complete *** # *** There appear to be some problems! ***
> >
> > # perl -V
> > Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
> > Platform:
> > osname=aix, osvers=5.3.0.0, archname=aix-64all
> > uname='aix testaix01 3 5 00c026ff4c00 '
> > config_args='-Dcc=gcc -Dprefix=/usr'
> > 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=define use64bitall=define uselongdouble=undef
> > usemymalloc=n, bincompat5005=undef
> > Compiler:
> > cc='gcc', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
> > -DUSE_NATIVE_DLOPEN -fno-strict-aliasing -pipe -maix64
> > -DUSE_64_BIT_ALL',
> > optimize='-O',
> > cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
> > -DUSE_NATIVE_DLOPEN -fno-strict-aliasing -pipe'
> > ccversion='', gccversion='3.3.2', gccosandvers='aix5.2.0.0'
> > intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321
> > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
> > ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
> > Off_t='off_t', lseeksize=8
> > alignbytes=8, prototype=define
> > Linker and Libraries:
> > ld='gcc -maix64', ldflags =' -Wl,-brtl -Wl,-bdynamic
> > -Wl,-bmaxdata:0x80000000 -maix64 -Wl,-b64'
> > libpth=/lib /usr/lib /usr/ccs/lib
> > libs=-lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lc -lbsd
> > perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc -lbsd
> > libc=, so=a, useshrplib=false, libperl=libperl.a
> > gnulibc_version=''
> > Dynamic Linking:
> > dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Xlinker
> > -bE:/usr/lib/perl5/5.8.7/aix-64all/CORE/perl.exp'
> > cccdlflags=' ', lddlflags=' -Wl,-b64 -Wl,-bhalt:4 -Wl,-bexpall
> > -Wl,-G -Wl,-bnoentry -lc'
> >
> >
> > Characteristics of this binary (from libperl):
> > Compile-time options: USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES
> > Built under aix
> > Compiled at Jul 25 2005 15:59:16
> > @INC:
> > /usr/lib/perl5/5.8.7/aix-64all
> > /usr/lib/perl5/5.8.7
> > /usr/lib/perl5/site_perl/5.8.7/aix-64all
> > /usr/lib/perl5/site_perl/5.8.7
> > /usr/lib/perl5/site_perl
>
>
>
> --
> Jonathan Leffler #include <disclaimer.h>
> Email: jleffler@earthlink.net, jleffler@us.ibm.com
> Guardian of DBD::Informix v2005.01 -- http://dbi.perl.org/
>
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.01 -- http://dbi.perl.org/
sending to informix-list