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
8bca8773
Commit
8bca8773
authored
Apr 01, 2010
by
Pieter Noordhuis
Browse files
use the right object when cleaning up after zunion/zinter (fixes issue 216)
parent
14ae26d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
8bca8773
...
@@ -5685,7 +5685,7 @@ static void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
...
@@ -5685,7 +5685,7 @@ static void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
addReplyLong
(
c
,
dstzset
->
zsl
->
length
);
addReplyLong
(
c
,
dstzset
->
zsl
->
length
);
server
.
dirty
++
;
server
.
dirty
++
;
}
else
{
}
else
{
decrRefCount
(
dst
zset
);
decrRefCount
(
dst
obj
);
addReply
(
c
,
shared
.
czero
);
addReply
(
c
,
shared
.
czero
);
}
}
zfree
(
src
);
zfree
(
src
);
...
...
test-redis.tcl
View file @
8bca8773
...
@@ -1489,6 +1489,11 @@ proc main {server port} {
...
@@ -1489,6 +1489,11 @@ proc main {server port} {
list
[
$r
zremrangebyrank zset 1 3
]
[
$r
zrange zset 0 -1
]
list
[
$r
zremrangebyrank zset 1 3
]
[
$r
zrange zset 0 -1
]
}
{
3
{
a e
}}
}
{
3
{
a e
}}
test
{
ZUNION against non-existing key doesn't set destination
}
{
$r del zseta
list
[
$r
zunion dst_key 1 zseta
]
[
$r
exists dst_key
]
}
{
0 0
}
test
{
ZUNION basics
}
{
test
{
ZUNION basics
}
{
$r del zseta zsetb zsetc
$r del zseta zsetb zsetc
$r zadd zseta 1 a
$r zadd zseta 1 a
...
...
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