Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
5acdc75d
"doc/SlaveofCommand.html" did not exist on "73287b2b576fa6a1ff1b61467286cbd5458881d2"
Commit
5acdc75d
authored
Dec 06, 2009
by
antirez
Browse files
Regression tests for SETNX and MSETNX bugs added
parent
906573e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
5acdc75d
...
...
@@ -2978,7 +2978,7 @@ static void echoCommand(redisClient *c) {
static void setGenericCommand(redisClient *c, int nx) {
int retval;
lookupKeyWrit
e(c->db,c->argv[1]);
deleteIfVolatil
e(c->db,c->argv[1]);
retval = dictAdd(c->db->dict,c->argv[1],c->argv[2]);
if (retval == DICT_ERR) {
if (!nx) {
...
...
test-redis.tcl
View file @
5acdc75d
...
...
@@ -165,6 +165,13 @@ proc main {server port} {
$r get novar2
}
{
foobared
}
test
{
SETNX will overwrite EXPIREing key
}
{
$r set x 10
$r expire x 10000
$r setnx x 20
$r get x
}
{
20
}
test
{
EXISTS
}
{
set res
{}
$r set newkey test
...
...
@@ -901,6 +908,13 @@ proc main {server port} {
list
[
$r
msetnx x1 xxx y2 yyy
]
[
$r
get x1
]
[
$r
get y2
]
}
{
1 xxx yyy
}
test
{
MSETNX should remove all the volatile keys even on failure
}
{
$r mset x 1 y 2 z 3
$r expire y 10000
$r expire z 10000
list
[
$r
msetnx x A y B z C
]
[
$r
mget x y z
]
}
{
0
{
1
{}
{}}}
test
{
ZSET basic ZADD and score update
}
{
$r zadd ztmp 10 x
$r zadd ztmp 20 y
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment