Re: DBIx::ContextualFetch trouble
[prev]
[thread]
[next]
[Date index for 2004/12/27]
On Mon, Dec 27, 2004 at 12:37:43PM +0200, Gabor Szabo wrote:
> during the test phase of DBIx::ContextualFetch on 5.8.5
> (and now on 5.8.6 too) I get
> Use of uninitialized value in subroutine entry at
> DBIx-ContextualFetch-1.01/blib/lib/DBIx/ContextualFetch.pm line 51.
I still can't replicate this. What version of DBI are you running?
> The first thing I got stuck with is that I don't understand this sub
> in the test code:
> sub make_sth {
> my $sql = shift;
> (my $sth = $dbh->prepare($sql))->execute;
> return $sth;
> }
> It does not pass anything to execute();
> but during the test cases some of the SQL strings passed to the
> sub contain placeholders (?). As it seems I get the above warning
> exactly in those cases when the query was prepared with a placeholder
> but no actual value was supplied to execute.
It seems that this is a classic case of premature abstraction. My guess
is that this was written before any of the test cases gave anything with
placeholders. Perhaps DBI has changed its behaviour at some stage if you
call execute() twice on the same $sth?
I've removed the ->execute from this function, and done that in-place in
the tests that need it.
1.02 is on its way to CPAN now.
If that doesn't help, I'll have to find some way to replicate the
problem.
Tony
|
(message missing)
|