mirror of
https://github.com/fluencelabs/redis
synced 2025-06-22 13:31:32 +00:00
RESP3: fix cases of NULL reported instead of empty aggregate.
This commit is contained in:
10
src/t_set.c
10
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user