Lachim / redis

Automatically exported from code.google.com/p/redis
2 stars 0 forks source link

INCR does not behave as documented #502

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What version of Redis you are using, in what kind of Operating System?
HEAD of the 2.2 branch

What is the problem you are experiencing?
The documentation says that calling INCR on a non-string object (or a string 
object that doesn't hold an integer) should set the value to '0' before 
applying.  Instead, it returns an error.

What steps will reproduce the problem?
set test test
+OK
incr test
-ERR ....

Original issue reported on code.google.com by grija...@gmail.com on 29 Mar 2011 at 11:32

GoogleCodeExporter commented 8 years ago
I've updated the documentation to describe the *real* behavior. The value 0 is 
used before applying the operating only if the key does not yet exist. If it 
does, it needs to be a string value  that is interpretable as integer. Thanks 
for spotting this!

Original comment by pcnoordh...@gmail.com on 30 Mar 2011 at 7:39