|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60500 get with cas token fails to fetch all results
Submitted: 2011-12-12 16:17 UTC Modified: 2012-04-01 22:47 UTC
From: trevor at blubolt dot com Assigned: andrei (profile)
Status: Closed Package: memcached (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
1 + 47 = ?
Subscribe to this entry?

 [2011-12-12 16:17 UTC] trevor at blubolt dot com
When performing a get with a cas token requested a multi-get is performed 
internally.  After doing so 
only the first result is fetched, leaving the final RES_END result on the stack.  
As per the 
libmemcached documentation memcached_fetch_result should be called until it 
returns NULL following a 

In some circumstances this is not noticeable as libmemcached takes care of 
flushing the receive buffers 
accordingly, however certain subsequent operations will incorrectly return the 
left-over RES_END result.  
I have seen this behaviour exhibited when performing a get with cas token 
request followed by an add 
operation though there may be other examples.

I have tested this with memcached extension version 2.0.0b2 using libmemcached 
0.53 and 1.0.2, though I 
believe the issue also exists with earlier versions.

Please find attached a patch against 2.0.0b2 to address this issue which both 
resolves the primary issue 
and also simplifies the call in the case that a cas token is not required  by 

Please let me know if I've been unclear!


fix-get (last revision 2011-12-12 16:18 UTC by trevor at blubolt dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-01 22:47 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: andrei
 [2012-04-01 22:47 UTC]
Re-opened on Github as an issue, so closing here.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 16:01:29 2024 UTC