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.

> (Tim, I had a faintly related question about a change in behaviour
> with DBI and Perl 5.61 -- did you get to see that?  I sent it to
> [EMAIL PROTECTED] from work, but I'm not sure if it went to the list. 
> The copy I sent myself directly to gmail got there, but I'm not sure I
> saw the list version.)

Yeap. I'll look at it in a moment.

Tim.

Reply via email to