memcached support => enabled Version => 2.1.0
libmemcached version => 1.0.10
I set a negative or non-numeric value to a key, and then increment it.
The increment operation failed, error code and msg as following:
=========================================================
["errorMsg"]=>
string(12) "CLIENT ERROR"
["errorNo"]=>
int(9)
=========================================================
and more ***seriously***, the following set or get operation also failed, error code and msg as following:
=========================set operation====================
["errorMsg"]=>
string(51) "SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY"
["errorNo"]=>
int(47)
=========================get operation====================
["errorMsg"]=>
string(9) "NOT FOUND"
["errorNo"]=>
int(16)
phpunit test code as following( some code is simple encapsulated, not original api ):
========================================================
//test negative number
$value = -1;
$result = $mc->set($keyPrefix, $key, $value); $this->assertTrue(Result::check($result));
$result = $mc->get($keyPrefix, $key); $this->assertEquals($value, Result::getData($result));
$result = $mc->increment($keyPrefix, $key, 1); //var_dump($result); //$this->assertTrue(Result::check($result)); //$this->assertEquals($value + 1, Result::getData($result));
memcached support => enabled Version => 2.1.0
libmemcached version => 1.0.10
I set a negative or non-numeric value to a key, and then increment it. ======= ======= ======= ======= ======= ======= ======= = ======= ======= ======= ======= ======= ======= ======= =
The increment operation failed, error code and msg as following:
=======
["errorMsg"]=>
string(12) "CLIENT ERROR"
["errorNo"]=>
int(9)
=======
and more ***seriously***, the following set or get operation also failed, error code and msg as following: ======= ======= ====set operation= ======= ======= ===== ======= ======= ====get operation= ======= ======= =====
=======
["errorMsg"]=>
string(51) "SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY"
["errorNo"]=>
int(47)
=======
["errorMsg"]=>
string(9) "NOT FOUND"
["errorNo"]=>
int(16)
phpunit test code as following( some code is simple encapsulated, not original api ): ======= ======= ======= ======= ======= ======= ======= $keyPrefix, $key, $value);
$this- >assertTrue( Result: :check( $result) ); $keyPrefix, $key);
$this- >assertEquals( $value, Result: :getData( $result) ); $keyPrefix, $key, 1);
//var_ dump($result) ;
//$this- >assertTrue( Result: :check( $result) );
//$this- >assertEquals( $value + 1, Result: :getData( $result) );
=======
//test negative number
$value = -1;
$result = $mc->set(
$result = $mc->get(
$result = $mc->increment(
//test non-numeric $keyPrefix, $key, $value);
var_dump( $result) ;
//$this- >assertTrue( Result: :check( $result) ); $keyPrefix, $key);
var_dump( $result) ; $keyPrefix, $key, $value);
var_dump( $result) ; $keyPrefix, $key);
var_dump( $result) ;
$value = 'str';
$result = $mc->set(
$result = $mc->get(
$result = $mc->set(
$result = $mc->get(
I don't test decrement operation, but I guess it will have the same problem......