|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-03 15:50 UTC] andrei@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
Description: ------------ Line 395 in php_memcached.c: if (php_memc_handle_error(status TSRMLS_CC) < 0) { memcached_result_free(&result); RETURN_FALSE; } Suppose orig_cas_flag was 0 and then set true. If we are using a old version of protocol which doesn't support 'gets', a protocol error will be returned (result code 8) when we specified the $cas_token in Memcached::get(). The next time we use Memcached::get() without $cas_token supplied, polluted flag 'support_cas' was not restored to 0 and then another protocol error will be returned. I've written a blog here(in Chinese): http://blog.sskaje.name/2010/02/phpmemcached-memcacheq.html Google translator might work fine with it. Solution is at the end of that blog. Reproduce code: --------------- Blog url: http://blog.sskaje.name/2010/02/phpmemcached-memcacheq.html Expected result: ---------------- [root@localhost 3.53]: /data1/www/htdocs/i.sina.com.cn/source/apps/daemon/cron 0> php testMemcachedGet.php int(140) int(0) int(141) int(0) mcdgettest: bool(false) int(8) bool(false) int(8) mcdgettest1: bool(142) int(0) mcdgettest2: bool(false) int(8) mcdgettest3: bool(143) int(0) END int(144) int(0) int(145) int(0) mcdgettest3: int(146) int(0) mcdgettest2: bool(false) int(8) mcdgettest1: bool(147) int(0) mcdgettest: bool(false) int(8) bool(false) int(8) END int(148) int(0) int(149) int(0) mcdgettest3: int(150) int(0) mcdgettest1: int(151) int(0) mcdgettest2: bool(false) int(8) mcdgettest: bool(false) int(8) bool(false) int(8) END Actual result: -------------- [root@localhost 3.53]: /data1/www/htdocs/i.sina.com.cn/source/apps/daemon/cron 0> php testMemcachedGet.php int(140) int(0) int(141) int(0) mcdgettest: bool(false) int(8) bool(false) int(8) mcdgettest1: bool(false) int(8) mcdgettest2: bool(false) int(8) mcdgettest3: bool(false) int(8) END int(142) int(0) int(143) int(0) mcdgettest3: int(144) int(0) mcdgettest2: bool(false) int(8) mcdgettest1: bool(false) int(8) mcdgettest: bool(false) int(8) bool(false) int(8) END int(145) int(0) int(146) int(0) mcdgettest3: int(147) int(0) mcdgettest1: int(148) int(0) mcdgettest2: bool(false) int(8) mcdgettest: bool(false) int(8) bool(false) int(8) END