Skip Menu |

This queue is for tickets about the Cache-Memcached-Fast CPAN distribution.

Report information
The Basics
Id: 56142
Status: resolved
Priority: 0/
Queue: Cache-Memcached-Fast

People
Owner: Nobody in particular
Requestors: Shigeki.morimoto [...] mixi.co.jp
Cc:
AdminCc:

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



Subject: Can't handle Readonly scalar as expire time.
Hello kroki. We found a issue related handling Readonly scalar as expire time. Here is test program. ---------------------------------------- use Readonly; use Cache::Memcached::Fast; my $memcached = Cache::Memcached::Fast->new({ servers => [qw<localhost:11211>], }); Readonly my $x => 3; $memcached->set(foo => 100, $x); print "[$x]\n"; # $memcached->set(bar => 100, $x); for(1..5){ print "foo[", $memcached->get('foo'), "]\n"; print "bar[", $memcached->get('bar'), "]\n"; sleep(1); } ---------------------------------------- Value "bar" will expired after 3secs. But value "foo" will never expired. I wrote a patch and attached it. I hope that you accept this patch. But I'm not sure this is a right way to fix problem. Best regard.
Subject: CMF.diff.txt
--- Fast.xs.org 2010-03-31 12:38:22.000000000 +0900 +++ Fast.xs 2010-03-31 12:38:50.000000000 +0900 @@ -689,7 +689,7 @@ { /* exptime doesn't have to be defined. */ sv = ST(arg); - if (SvOK(sv)) + if (SvOK(sv) || SvMAGICAL(sv)) exptime = SvIV(sv); } if (ix != CMD_CAS)
Thanks for the report. Fixed in 0.18, which has been released just now.