|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-06-14 13:12 UTC] hradtke@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
Description: ------------ I've read the code at version 3.0.4. I found that the expiration time is incorrectly assigned by value. Though with the recent stable memcached (1.4.4), deleting with expiration time seems not longer supported. Memcached 1.4.4 will reject any delete command with expiration. With memcached 1.4.4, I think this patch is still need to be applyed. Without this patch, value will never be deleted even when I didn't assign positive expiration. Cause the original version will always assign 1 as the expiration. Thank you ^^ Reproduce code: --------------- TEST CODE (with Memcached 1.4.4): $memd = new Memcache; $memd->connect("127.0.0.1", 11211); $memd->set("test", "123"); $memd->delete("test"); $memd->connect("127.0.0.1", 11211); echo $memd->get("test"); // I connect the cache server twice, // forcing the client to get the data from server again. PATCH: --- memcache.c.old 2010-06-12 11:31:55.000000000 +0800 +++ memcache.c 2010-06-12 11:28:06.000000000 +0800 @@ -642,7 +642,7 @@ } if (deleted) { - pool->protocol->delete(request, request->key, request->key_len, value); + pool->protocol->delete(request, request->key, request->key_len, exptime); } else { pool->protocol->mutate(request, *key, request->key, request->key_len, invert ? -value : value, defval, defval_used, exptime); @@ -676,7 +676,7 @@ } if (deleted) { - pool->protocol->delete(request, request->key, request->key_len, value); + pool->protocol->delete(request, request->key, request->key_len, exptime); } else { pool->protocol->mutate(request, keys, request->key, request->key_len, invert ? -value : value, defval, defval_used, exptime); Expected result: ---------------- (empty) Actual result: -------------- 123