php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58537 Memcached setMulti error
Submitted: 2009-02-05 23:50 UTC Modified: 2009-02-06 14:19 UTC
From: eugenevt at gmail dot com Assigned:
Status: Closed Package: memcached (PECL)
PHP Version: 5_2 CVS-2009-02-05 (dev) OS: Linux 2.6.27-gentoo-r7
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: eugenevt at gmail dot com
New email:
PHP Version: OS:

 

 [2009-02-05 23:50 UTC] eugenevt at gmail dot com
Description:
------------
Error setMulti

Reproduce code:
---------------
<?PHP
$mc = new Memcached();
$mc->addServer( '192.168.0.108', 11211); // This is 'localhost'
$mc->addServer( '192.168.0.109', 11211);
$mc->addServer( '192.168.0.110', 11211);
$mc->flush();
$a = array('k1'=>'v1', 'k2'=>'v2', 'k3'=>'v3', 'k4'=>'v4', 'k5'=>'v5', 'k6'=>'v6', 'k7'=>'v7', 'k8'=>'v8', 'k9'=>'v9', 'k10'=>'v10', 'k11'=>'v11', 'k12'=>'v12');
$b = array( 0=>'k1', 1=>'k2', 2=>'k3', 3=>'k4', 4=> 'k5', 5=>'k6', 6=>'k7', 7=>'k8', 8=>'k9', 9=>'k10', 10=>'k11', 11=>'k12');
var_dump($mc->setMulti($a)); //  result bool(true)
var_dump($mc->getMulti($b)); // !!!   Restore only keys 'k2' and 'k3'
$mc->flush();
foreach($a as $k=>$val) { var_dump($mc->set($k, $val, 0)); }
var_dump($mc->getMulti($b)); // All Ok!
?>

Expected result:
----------------
array(12) {
  ["k10"]=>
  string(3) "v10"
  ["k11"]=>
  string(3) "v11"
  ["k12"]=>
  string(3) "v12"
  ["k1"]=>
  string(2) "v1"
  ["k2"]=>
  string(2) "v2"
  ["k3"]=>
  string(2) "v3"
  ["k4"]=>
  string(2) "v4"
  ["k5"]=>
  string(2) "v5"
  ["k6"]=>
  string(2) "v6"
  ["k7"]=>
  string(2) "v7"
  ["k8"]=>
  string(2) "v8"
  ["k9"]=>
  string(2) "v9"
}


Actual result:
--------------
array(2) {
  ["k2"]=>
  string(2) "v2"
  ["k3"]=>
  string(2) "v3"
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-06 14:19 UTC] andrei@php.net
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/memcached

Fixed in 0.1.2 release.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 04 18:01:29 2024 UTC