[Dbix-class] Patch for DBIx-Class-Cursor-Cached

Bill Moseley moseley at hank.org
Sat Nov 27 18:14:53 GMT 2010


diff --git a/lib/DBIx/Class/Cursor/Cached.pm
b/lib/DBIx/Class/Cursor/Cached.pm
index 5eaf6b0..da13170 100644
--- a/lib/DBIx/Class/Cursor/Cached.pm
+++ b/lib/DBIx/Class/Cursor/Cached.pm
@@ -48,6 +48,7 @@ sub reset {

 sub _build_cache_key {
   my ($class, $storage, $args, $attrs) =3D @_;
+  local $Storable::canonical =3D 1;
   return Digest::SHA1::sha1_hex(Storable::nfreeze([ $args, $attrs ]));
 }

I spent some time trying to get a failing test, but I think the test setup
(just a single CD class) is not complex enough to make it fail.  Is there
any doubt that $Storable::canonical =3D 1 is required?

When testing in my app Storable is returning over 15K of data to use for the
key digest, where in the test in ::Cursor::Cached is only returning some 300
bytes.  So, a lot more room for sorting differences.

I guess this module is not getting much use, considering it was uploaded to
cpan in 2007.



-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20101127/6b3=
a20fe/attachment.htm


More information about the DBIx-Class mailing list