diff options
author | antirez <antirez@gmail.com> | 2019-09-02 12:50:47 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2019-09-02 12:50:47 +0200 |
commit | 06d490342f51cff316588a7a45124cc410b7d050 (patch) | |
tree | a205fa6c64b14215dad61877b3999dd29bbe393a /src/t_set.c | |
parent | b12ccc840e6959027715d8bbc6f6d372ea2fd18f (diff) | |
download | redis-06d490342f51cff316588a7a45124cc410b7d050.tar.gz |
RESP3: fix cases of NULL reported instead of empty aggregate.
Diffstat (limited to 'src/t_set.c')
-rw-r--r-- | src/t_set.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/t_set.c b/src/t_set.c index 05d9ee243..abbf82fde 100644 --- a/src/t_set.c +++ b/src/t_set.c @@ -418,10 +418,10 @@ void spopWithCountCommand(client *c) { if ((set = lookupKeyWriteOrReply(c,c->argv[1],shared.null[c->resp])) == NULL || checkType(c,set,OBJ_SET)) return; - /* If count is zero, serve an empty multibulk ASAP to avoid special + /* If count is zero, serve an empty set ASAP to avoid special * cases later. */ if (count == 0) { - addReplyNull(c); + addReply(c,shared.emptyset[c->resp]); return; } @@ -632,13 +632,13 @@ void srandmemberWithCountCommand(client *c) { uniq = 0; } - if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.null[c->resp])) + if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.emptyset[c->resp])) == NULL || checkType(c,set,OBJ_SET)) return; size = setTypeSize(set); /* If count is zero, serve it ASAP to avoid special cases later. */ if (count == 0) { - addReplyNull(c); + addReply(c,shared.emptyset[c->resp]); return; } @@ -813,7 +813,7 @@ void sinterGenericCommand(client *c, robj **setkeys, } addReply(c,shared.czero); } else { - addReplyNull(c); + addReply(c,shared.emptyset[c->resp]); } return; } |