snehac-miner / redis

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

INCR,INCRBY,DECR,DECRBY removes value of key #75

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. SET key 2
90
2. EXPIRE key 300
3. INCR key

What is the expected output? What do you see instead?
It should add by 1:
:91
Instead it shows:
:1 and the value of key is now 1.

What version of the product are you using? On what operating system?
1.01 on CentOS 64

I'm also assuming that it should remove the expire time when doing INCR and 
DECR? If I wanted to keep the expire time, I would have to do TTL first 
then EXPIRE after INCR/DECR correct?

Thanks,
fastest963

Original issue reported on code.google.com by fastest...@gmail.com on 24 Oct 2009 at 3:18

GoogleCodeExporter commented 8 years ago
It's not a bug, check this: http://code.google.com/p/redis/wiki/ExpireCommand

basically it's not possible to perform write operations against volatile keys 
and there are 
good reasons to enforce such a restriction.

Original comment by anti...@gmail.com on 29 Oct 2009 at 10:41