Increment operation causes connection error! (bug in server)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmemcached |
Fix Released
|
High
|
Brian Aker |
Bug Description
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:
=======
["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 simply encapsulated, not original api ):
=======
//test negative number
$value = -1;
$result = $mc->set(
$result = $mc->get(
$result = $mc->increment(
//test non-numeric
$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......
Related branches
- Tangent Trunk: Pending requested
-
Diff: 287 lines (+48/-50)10 files modifiedexample/include.am (+1/-1)
libmemcached/common.h (+8/-1)
libmemcached/connect.cc (+3/-10)
libmemcached/connect.hpp (+0/-2)
libmemcached/get.cc (+2/-2)
libmemcached/instance.cc (+0/-5)
libmemcached/stats.cc (+2/-2)
libmemcached/string.cc (+13/-8)
libmemcached/version.cc (+15/-15)
libtest/comparison.hpp (+4/-4)
description: | updated |
summary: |
- increment operation cause connection error! + Increment operation causes connection error! |
Changed in libmemcached: | |
assignee: | nobody → Brian Aker (brianaker) |
summary: |
- Increment operation causes connection error! + Increment operation causes connection error! (bug in server) |
Changed in libmemcached: | |
milestone: | none → 1.0.14 |
importance: | Undecided → High |
status: | New → Fix Committed |
Changed in libmemcached: | |
status: | Fix Committed → Fix Released |
Thank you for the report, let me take a look and see if i can reproduce.
Sent from my Ti85
On Oct 16, 2012, at 1:10, "yunhua.lee" <email address hidden> wrote:
> ** Description changed: ======= ======= ======= ======= ======= ======= ======= = ======= ======= ======= ======= ======= ======= ======= = ======= ======= ====set operation= ======= ======= ===== ======= ======= ====get operation= ======= ======= ===== ======= ======= ======= ======= ======= ======= ======= $keyPrefix, $key, $value); assertTrue( Result: :check( $result) ); $keyPrefix, $key); assertEquals( $value, Result: :getData( $result) ); $keyPrefix, $key, 1); $result) ; >assertTrue( Result: :check( $result) ); >assertEquals( $value + 1, Result: :getData( $result) ); $keyPrefix, $key, $value); assertTrue( Result: :check( $result) ); $keyPrefix, $key); assertEquals( $value, Result: :getData( $result) ); $keyPrefix, $key, 1); $result) ; >assertTrue( Result: :check( $result) ); >assertEquals( $value + 1, Result: :getData( $result) ); $keyPrefix, $key, $value); >assertTrue( Result: :check( $result) ); $keyPrefix, $key); $keyPrefix, $key, $value); $keyPrefix, $...
>
> 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:
> + 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)
> + ["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:
> =======
> - ["errorMsg"]=>
> - string(51) "SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY"
> - ["errorNo"]=>
> - int(47)
> + ["errorMsg"]=>
> + string(51) "SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY"
> + ["errorNo"]=>
> + int(47)
> =======
> - ["errorMsg"]=>
> - string(9) "NOT FOUND"
> - ["errorNo"]=>
> - int(16)
> + ["errorMsg"]=>
> + string(9) "NOT FOUND"
> + ["errorNo"]=>
> + int(16)
>
> - phpunit test code as following( some code is simple encapsulated, not original api ):
> + phpunit test code as following( some code is simply encapsulated, not original api ):
> =======
> - //test negative number
> - $value = -1;
> - $result = $mc->set(
> - $this->
> - $result = $mc->get(
> - $this->
> - $result = $mc->increment(
> - //var_dump(
> - //$this-
> - //$this-
> + //test negative number
> + $value = -1;
> + $result = $mc->set(
> + $this->
> + $result = $mc->get(
> + $this->
> + $result = $mc->increment(
> + //var_dump(
> + //$this-
> + //$this-
>
> - //test non-numeric
> - $value = 'str';
> - $result = $mc->set(
> - var_dump($result);
> - //$this-
> - $result = $mc->get(
> - var_dump($result);
> - $result = $mc->set(
> - var_dump($result);
> - $result = $mc->get(