Issues

ZF-9376: Memcache::delete reports notice with memcached 1.4.4

Issue Type: Bug Created: 2010-03-09T03:07:43.000+0000 Last Updated: 2010-03-09T11:28:04.000+0000 Status: Closed Fix version(s): - 1.10.3 (01/Apr/10)

Reporter: Marc Bennewitz (GIATA mbH) (mben) Assignee: Marc Bennewitz (private) (mabe) Tags: - Zend_Cache

Related issues: Attachments:

Description

<pre class="highlight">
$mc = new Memcache();
$mc->addServer('127.0.0.1', 11211, false, 1, 1, 15, true, null);

$mc->set('test', 'testdata');
var_dump($mc->get('test'));
$mc->delete('test');
var_dump($mc->get('test'));



<pre class="highlight">
string(8) "testdata"
PHP Notice:  MemcachePool::delete(): Server 127.0.0.1 (tcp 11211, udp 0) failed with: CLIENT_ERROR bad command line format.  Usage: delete  [noreply]
 (0) in /tmp/test.php on line 8
bool(false)

Changing this to $mc->delete('test', 0); will fix this issue:

<pre class="highlight">
$mc = new Memcache();
$mc->addServer('127.0.0.1', 11211, false, 1, 1, 15, true, null);

$mc->set('test', 'testdata');
var_dump($mc->get('test'));
$mc->delete('test', 0);
var_dump($mc->get('test'));



<pre class="highlight">
string(8) "testdata"
bool(false)

http://code.google.com/p/memcached/… : Fixes Add partial backwards compatibility for delete with timeout 0

Before version 1.4.0, there was an optional argument to delete that would allow a client to specify that a deleted object should exist in the cache after the deletion occurred such that add operations would fail even though objects did not appear in the cache.

This feature was removed completely in 1.4.0, but a parser bug caused it to slip through. The bug was fixed in 1.4.3. If anyone was attempting to use it legitimately in the 1.4 series, it would simply not work as expected.

The 1.4.4 backwards compatibility change allows specifically the value of 0 (i.e. non-lingering delete), while continuing to reject others. This will satisfy clients that always wish to send a value even when they do not wish the item to linger.

Comments

Posted by Marc Bennewitz (private) (mabe) on 2010-03-09T11:28:03.000+0000

fixed in r21420 (trunk) & r21421 (1.10 branch)

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts