antirez/redis — Issue #128: TTL not preserved when key is renamed
Author: quzart
Created: 2011-10-09 16:04:03+00:00
State: open

**Description**
When a key is renamed, the TTL is not preserved.

**Steps to reproduce**

redis> SET foo "asdf"
OK
redis> EXPIRE foo 300
(integer) 1
redis> TTL foo
(integer) 298
redis> RENAME foo bar
OK
redis> TTL bar
(integer) -1

**What was expected**

redis> TTL bar
(integer) 296

**Versions affected**
Tested with the same result on these version:

- Latest git clone

redis_version:2.9.0
redis_git_sha1:ff15dba0

- Latest arch linux package:

redis_version:2.2.14
redis_git_sha1:00000000

- Interface from the redis website:

redis_version:2.3.9
redis_git_sha1:214cf637

**Links**
Google groups thread: http://groups.google.com/group/redis-db/browse_frm/thread/d6288ac22427cad6