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
54a5a7df
Commit
54a5a7df
authored
Nov 05, 2013
by
antirez
Browse files
HSCAN/ZSCAN: skip value when matching.
This fixes issue #1360 and #1362.
parent
bebbc7f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
54a5a7df
...
@@ -495,11 +495,16 @@ void scanGenericCommand(redisClient *c, robj *o) {
...
@@ -495,11 +495,16 @@ void scanGenericCommand(redisClient *c, robj *o) {
if
(
filter
)
{
if
(
filter
)
{
decrRefCount
(
kobj
);
decrRefCount
(
kobj
);
listDelNode
(
keys
,
node
);
listDelNode
(
keys
,
node
);
/* Also remove the value for hashes and sorted sets. */
}
if
(
o
&&
(
o
->
type
==
REDIS_ZSET
||
o
->
type
==
REDIS_HASH
))
{
node
=
nextnode
;
/* If this is an hash or a sorted set, we have a flat list of
* key-value elements, so if this element was filtered, remove the
* value, or skip it if it was not filtered: we only match keys. */
if
(
o
&&
(
o
->
type
==
REDIS_ZSET
||
o
->
type
==
REDIS_HASH
))
{
node
=
nextnode
;
nextnode
=
listNextNode
(
node
);
if
(
filter
)
{
kobj
=
listNodeValue
(
node
);
kobj
=
listNodeValue
(
node
);
nextnode
=
listNextNode
(
node
);
decrRefCount
(
kobj
);
decrRefCount
(
kobj
);
listDelNode
(
keys
,
node
);
listDelNode
(
keys
,
node
);
}
}
...
...
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