Skip to content

Memcached::get() always return NOT_FOUND on error #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 17, 2013

Conversation

blat
Copy link
Contributor

@blat blat commented May 1, 2013

From #9

<?php

$memcached = new Memcached();
$memcached->addServer('localhost', 5555); // Server should not exist

$result = $memcached->get('foo');
echo $memcached->getResultMessage() . "\n";

Result: NOT FOUND
Expected: SERVER IS MARKED DEAD

Note: $memcached->get('foo', null, $cas) works.

blat and others added 2 commits May 1, 2013 19:29
Previously only the first result was fetched after the
memcached_mget_by_key call resulting in a RES_END result being left on
the stack. As per the libmemcached documentation memcached_fetch_result
should be called until it returns NULL following a multi-get.

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.
@mkoppanen mkoppanen merged commit 81273a4 into php-memcached-dev:master Oct 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants