On Fri, 3 Dec 2004 20:54:00 +0000, Tim Bunce <[EMAIL PROTECTED]> wrote:
> On Fri, Dec 03, 2004 at 12:15:06PM -0800, Jonathan Leffler wrote:
> > Testing null handling in DBD::Informix 2004.02 (pre-release), I'm
> > getting a warning from Perl:
> >
> > Use of uninitialized value in subroutine entry at t/t91udts.t line 97.
> >
> > OK - it's a valid comment: the code reads:
> >
> > $sth->execute(2, undef, undef, ..., undef) or stmt_fail;
> >
> > There are actually 12 undef's in the real code - to insert 12 SQL NULL
> > non-values into a table with 13 columns (the first column refuses
> > nulls, hence the 2 in the argument list).
> >
> > How am I supposed to pass SQL NULL values into $sth->execute?
> 
> That part is fine. It's something 'deeper' that triggering the
> warning.  Probably in the driver. Perl says "in subroutine entry"
> only because that's the last "op" that perl executed (before it
> entered the DBI C-code).
> 
> Here's a trick to nail it:
> 
>     $SIG{__WARN__} = sub { dump() }; # core dump on warning
> 
> then the core file will tell you _exactly_ where the problem is.

Hi Tim,

OK, the core dump winds through a number of functions (recognizably
Perl or C library functions), but ends up going through:

...more...
Perl_magic_set()
Perl_newHVhv()
dbd_ix_st_bind_ph() -- DBD::Informix code.
dbdxst_bind_params() -- DBI code?
XS_DBD__Informix__st_execute() -- Interface C code for $sth->execute()?
XS_DBI_dispatch() -- DBI code
Perl_magic_nextpack()
Perl_fbm_instr()
...more...

Has anything changed significantly in the binding of parameters since,
say, DBI 1.14?  Short guidance appreciated - I'll be investigating
anyway, but help on where to look might make things easier.

(I'll also be responding to another of the emails around this general
area in a moment.)

(I should also mention that this problem - unexpected null references
- is occurring on 5.8.6 as well as 5.6.1 -- it is no longer Perl
version specific.)

-- 
Jonathan Leffler <[EMAIL PROTECTED]>  #include <disclaimer.h>
Guardian of DBD::Informix - v2003.04 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."

Reply via email to