mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 08:00:49 +00:00
RESP3: restore the concept of null array for RESP2 compat.
This commit is contained in:
parent
2ad6e875ba
commit
3fd78f41e8
@ -187,7 +187,7 @@ void replyToBlockedClientTimedOut(client *c) {
|
||||
if (c->btype == BLOCKED_LIST ||
|
||||
c->btype == BLOCKED_ZSET ||
|
||||
c->btype == BLOCKED_STREAM) {
|
||||
addReplyNull(c);
|
||||
addReplyNullArray(c);
|
||||
} else if (c->btype == BLOCKED_WAIT) {
|
||||
addReplyLongLong(c,replicationCountAcksByOffset(c->bpop.reploffset));
|
||||
} else if (c->btype == BLOCKED_MODULE) {
|
||||
|
@ -763,12 +763,12 @@ void geoposCommand(client *c) {
|
||||
for (j = 2; j < c->argc; j++) {
|
||||
double score;
|
||||
if (!zobj || zsetScore(zobj, c->argv[j]->ptr, &score) == C_ERR) {
|
||||
addReplyNull(c);
|
||||
addReplyNullArray(c);
|
||||
} else {
|
||||
/* Decode... */
|
||||
double xy[2];
|
||||
if (!decodeGeohash(score,xy)) {
|
||||
addReplyNull(c);
|
||||
addReplyNullArray(c);
|
||||
continue;
|
||||
}
|
||||
addReplyArrayLen(c,2);
|
||||
|
@ -134,7 +134,7 @@ void execCommand(client *c) {
|
||||
* in the second an EXECABORT error is returned. */
|
||||
if (c->flags & (CLIENT_DIRTY_CAS|CLIENT_DIRTY_EXEC)) {
|
||||
addReply(c, c->flags & CLIENT_DIRTY_EXEC ? shared.execaborterr :
|
||||
shared.null[c->resp]);
|
||||
shared.nullarray[c->resp]);
|
||||
discardTransaction(c);
|
||||
goto handle_monitor;
|
||||
}
|
||||
|
@ -3078,7 +3078,7 @@ void sentinelCommand(client *c) {
|
||||
if (c->argc != 3) goto numargserr;
|
||||
ri = sentinelGetMasterByName(c->argv[2]->ptr);
|
||||
if (ri == NULL) {
|
||||
addReplyNull(c);
|
||||
addReplyNullArray(c);
|
||||
} else {
|
||||
sentinelAddr *addr = sentinelGetCurrentMasterAddress(ri);
|
||||
|
||||
|
@ -782,7 +782,7 @@ struct moduleLoadQueueEntry {
|
||||
|
||||
struct sharedObjectsStruct {
|
||||
robj *crlf, *ok, *err, *emptybulk, *czero, *cone, *pong, *space,
|
||||
*colon, *queued, *null[4], nullarray[4],
|
||||
*colon, *queued, *null[4], *nullarray[4],
|
||||
*emptyarray, *wrongtypeerr, *nokeyerr, *syntaxerr, *sameobjecterr,
|
||||
*outofrangeerr, *noscripterr, *loadingerr, *slowscripterr, *bgsaveerr,
|
||||
*masterdownerr, *roslaveerr, *execaborterr, *noautherr, *noreplicaserr,
|
||||
|
@ -731,7 +731,7 @@ void blockingPopGenericCommand(client *c, int where) {
|
||||
/* If we are inside a MULTI/EXEC and the list is empty the only thing
|
||||
* we can do is treating it as a timeout (even with timeout 0). */
|
||||
if (c->flags & CLIENT_MULTI) {
|
||||
addReplyNull(c);
|
||||
addReplyNullArray(c);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3277,7 +3277,7 @@ void blockingGenericZpopCommand(client *c, int where) {
|
||||
/* If we are inside a MULTI/EXEC and the zset is empty the only thing
|
||||
* we can do is treating it as a timeout (even with timeout 0). */
|
||||
if (c->flags & CLIENT_MULTI) {
|
||||
addReplyNull(c);
|
||||
addReplyNullArray(c);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user