Skip Menu |
 

This queue is for tickets about the DBIx-Simple CPAN distribution.

Report information
The Basics
Id: 26924
Status: resolved
Priority: 0/
Queue: DBIx-Simple

People
Owner: Nobody in particular
Requestors: stanis.trendelenburg [...] pluto.uni-freiburg.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug in statement cache management
Date: Fri, 04 May 2007 01:38:54 +0200
To: bug-DBIx-Simple [...] rt.cpan.org
From: Stanis Trendelenburg <stanis.trendelenburg [...] pluto.uni-freiburg.de>
Download (untitled) / with headers
text/plain 271b
Hi, there is a small bug in the handling of the statement cache in query(), which causes identical statements to be inserted into the cache multiple times if the existing entry is at position 0. Checking for definedness fixes this (see diff). Thanks for a great module!
--- DBIx/Simple.pm.orig 2007-05-04 01:23:25.000000000 +0200 +++ DBIx/Simple.pm 2007-05-04 01:23:03.000000000 +0200 @@ -134,7 +134,7 @@ my $old = $old_statements{$self}; - if (my $i = (grep $old->[$_][0] eq $query, 0..$#$old)[0]) { + if (defined( my $i = (grep $old->[$_][0] eq $query, 0..$#$old)[0] )) { $st = splice(@$old, $i, 1)->[1]; $sth = $st->{sth}; } else {
RT-Send-CC: juerd [...] juerd.nl
Download (untitled) / with headers
text/plain 104b
Juerd, It looks like this bug fix never made it into a release. It seems worth fixing to me. Mark
Download (untitled) / with headers
text/plain 531b
On Fri Dec 03 16:02:04 2010, MARKSTOS wrote: Show quoted text
> It looks like this bug fix never made it into a release. It seems worth > fixing to me.
Oops. I had already integrated the patch but then began to add support for "$result->object" and apparently then forgot to finish that and release it. Thanks for the wakeup-call; I've implemented the missing functionality for ->object (fortunately I write documentation before implementing things), written tests and am now ready to release 1.33. It'll be on CPAN within a few hours. -- Juerd


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.