Date: | Fri, 13 Feb 2004 20:30:52 +0100 |
From: | Rolf Grossmann <rg [...] progtech.net> |
To: | Jesse Vincent <jesse [...] bestpractical.com> |
Subject: | Bug in DBIx::SearchBuilder |
Hi Jesse,
Jesse Vincent wrote:
Show quoted text
> RT 3.0.9 requires DBIx::SearchBuilder 0.97 which was just released to
> CPAN. This version is identical to the 0.97_02 development release.
There's a bug in DBIx::SearchBuilder that I've been meaning to tell you
(but forgot, sorry). Remembered from this mail and it's still present.
Goes as this:
The _gen_alternate_cache_key function does not handle values that
include a operator (and are therefore perl HASHes). As a result, the
generated key contains the hashes memory address instead of the value,
which for me resulted in some funny non-deterministic behaviour when
adresses for different objects were hit. Possible patch is attached (and
I hope that will make things clearer than my description).
I haven't checked if that is the only time the value is used like that,
it did fix my problem.
Rolf
--- /usr/ports/databases/p5-DBIx-SearchBuilder/work/DBIx-SearchBuilder-0.96/SearchBuilder/Record/Cachable.pm Fri Jan 2 22:55:29 2004
+++ /usr/dist/local/lib/perl5/site_perl/5.8.2/DBIx/SearchBuilder/Record/Cachable.pm Wed Jan 28 20:39:01 2004
@@ -257,6 +257,7 @@
my ($this, %attr) = @_;
my $cache_key=$this->Table() . ':';
while (my ($key, $value) = each %attr) {
+ if (ref($value) eq "HASH") { $value = $value->{value}; }
$cache_key .= ($key ||'__undef'). '=' . ($value||'__undef') . ',';
}
chop ($cache_key);