From 3fd78f41e868c4ecf5b1a3b238dfb2ebe81ff579 Mon Sep 17 00:00:00 2001
From: antirez <antirez@gmail.com>
Date: Fri, 30 Nov 2018 16:36:55 +0100
Subject: [PATCH] RESP3: restore the concept of null array for RESP2 compat.

---
 src/blocked.c  | 2 +-
 src/geo.c      | 4 ++--
 src/multi.c    | 2 +-
 src/sentinel.c | 2 +-
 src/server.h   | 2 +-
 src/t_list.c   | 2 +-
 src/t_zset.c   | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/blocked.c b/src/blocked.c
index 1f22a20a..b8cf02c8 100644
--- a/src/blocked.c
+++ b/src/blocked.c
@@ -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) {
diff --git a/src/geo.c b/src/geo.c
index d14f537b..91a0421f 100644
--- a/src/geo.c
+++ b/src/geo.c
@@ -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);
diff --git a/src/multi.c b/src/multi.c
index b84b75f7..71090d8e 100644
--- a/src/multi.c
+++ b/src/multi.c
@@ -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;
     }
diff --git a/src/sentinel.c b/src/sentinel.c
index a94159f6..536edcdd 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -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);
 
diff --git a/src/server.h b/src/server.h
index c12dca59..0cc14f08 100644
--- a/src/server.h
+++ b/src/server.h
@@ -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,
diff --git a/src/t_list.c b/src/t_list.c
index d6daad69..451ffb4b 100644
--- a/src/t_list.c
+++ b/src/t_list.c
@@ -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;
     }
 
diff --git a/src/t_zset.c b/src/t_zset.c
index 1c943cae..2efdcd26 100644
--- a/src/t_zset.c
+++ b/src/t_zset.c
@@ -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;
     }