Subject: | Crashing bug in Hashes() subroutine |
Date: | Mon, 12 Apr 2010 16:30:49 -0500 |
To: | bug-DBIx-DWIW [...] rt.cpan.org |
From: | Tim Klein <tim.klein [...] belltowertech.com> |
Jeremy Zawodny,
Hello! My colleagues and I are long-time users and fans of DBIx::DWIW.
We think we've discovered a crashing bug. The crash happens with version
0.49 of DWIW, but if we downgrade to 0.44, all is well. (We don't know
about the versions in between.)
Our program dies with this error message:
Can't call method "finish" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/DBIx/DWIW.pm line 1569.
Line 1569 is the next-to-last line in Hashes(), which was introduced in
some version later than 0.44:
$self->{RecentExecutedSth}->finish;
We notice that at least one other DWIW subroutine uses a conditional to
check for the existence of the object before calling its 'finish'
method. If we modify line 1569 to take the same approach, it seems to
solve the problem:
$self->{RecentExecutedSth}->finish if defined $self->{RecentExecutedSth};
We're not entirely clear on what sequence of events in our application
leads to the non-existence of $self->{RecentExecutedSth} when Hashes()
is called, but we do know that it happens shortly after a rollback of a
transaction upon failure of a query due to insufficient mySQL user
permission.
--
Tim Klein
BellTower Technologies LLC
www.belltowertech.com