Fix addition RESP3 regressions (return empty set)

Former-commit-id: 740fc6c2b865f3846fc7c2b53e5b8303020964f2
This commit is contained in:
John Sully 2019-04-08 16:52:57 -04:00
parent 90f6b22128
commit 5b8893ef84
3 changed files with 7 additions and 4 deletions

View File

@ -402,7 +402,7 @@ void lrangeCommand(client *c) {
if ((getLongFromObjectOrReply(c, c->argv[2], &start, NULL) != C_OK) ||
(getLongFromObjectOrReply(c, c->argv[3], &end, NULL) != C_OK)) return;
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.null[c->resp])) == NULL
if ((o = lookupKeyReadOrReply(c,c->argv[1],(c->resp < 3) ? shared.emptyarray : shared.null[c->resp])) == NULL
|| checkType(c,o,OBJ_LIST)) return;
llen = listTypeLength(o);

View File

@ -813,7 +813,10 @@ void sinterGenericCommand(client *c, robj **setkeys,
}
addReply(c,shared.czero);
} else {
addReplyNull(c);
if (c->resp >= 3)
addReplyNull(c);
else
addReply(c, shared.emptyarray);
}
return;
}

View File

@ -2427,7 +2427,7 @@ void zrangeGenericCommand(client *c, int reverse) {
return;
}
if ((zobj = lookupKeyReadOrReply(c,key,shared.null[c->resp])) == NULL
if ((zobj = lookupKeyReadOrReply(c,key,(c->resp < 3) ? shared.emptyarray : shared.null[c->resp])) == NULL
|| checkType(c,zobj,OBJ_ZSET)) return;
/* Sanitize indexes. */
@ -2575,7 +2575,7 @@ void genericZrangebyscoreCommand(client *c, int reverse) {
}
/* Ok, lookup the key and get the range */
if ((zobj = lookupKeyReadOrReply(c,key,shared.null[c->resp])) == NULL ||
if ((zobj = lookupKeyReadOrReply(c,key,(c->resp < 3) ? shared.emptyarray : shared.null[c->resp])) == NULL ||
checkType(c,zobj,OBJ_ZSET)) return;
if (zobj->encoding == OBJ_ENCODING_ZIPLIST) {