go to bug id or search bugs for
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!
Add a Patch
Add a Pull Request
Re-opened on Github as an issue, so closing here.