add a new SET option KEEPTTL that doesn't remove expire time

This commit is contained in:
zhaozhao.zz
2019-12-18 14:49:38 +08:00
parent b7c78b7651
commit 24044f3356
8 changed files with 38 additions and 18 deletions

View File

@ -219,4 +219,17 @@ start_server {tags {"expire"}} {
set ttl [r ttl foo]
assert {$ttl <= 98 && $ttl > 90}
}
test {SET command will remove expire} {
r set foo bar EX 100
r set foo bar
r ttl foo
} {-1}
test {SET - use KEEPTTL option, TTL should not be removed} {
r set foo bar EX 100
r set foo bar KEEPTTL
set ttl [r ttl foo]
assert {$ttl <= 100 && $ttl > 90}
}
}