From f70916f8b0fc36c581d3fa30db7fdac0a82dd8f5 Mon Sep 17 00:00:00 2001 From: Maxim Galushka Date: Mon, 21 Jun 2021 09:01:31 +0100 Subject: [PATCH] redis-cli: support for REDIS_REPLY_SET in CSV and RAW output. (#7338) Fixes #6792. Added support of REDIS_REPLY_SET in raw and csv output of `./redis-cli` Test: run commands to test: ./redis-cli -3 --csv COMMAND ./redis-cli -3 --raw COMMAND Now they are returning resuts, were failing with: "Unknown reply type: 10" before the change. (cherry picked from commit 96bb078577ce2b0d093c873faae5d3ecca26a1de) --- src/redis-cli.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/redis-cli.c b/src/redis-cli.c index 81be58b17..8e049f186 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -1129,6 +1129,7 @@ static sds cliFormatReplyRaw(redisReply *r) { case REDIS_REPLY_DOUBLE: out = sdscatprintf(out,"%s",r->str); break; + case REDIS_REPLY_SET: case REDIS_REPLY_ARRAY: case REDIS_REPLY_PUSH: for (i = 0; i < r->elements; i++) { @@ -1187,6 +1188,7 @@ static sds cliFormatReplyCSV(redisReply *r) { out = sdscat(out,r->integer ? "true" : "false"); break; case REDIS_REPLY_ARRAY: + case REDIS_REPLY_SET: case REDIS_REPLY_PUSH: case REDIS_REPLY_MAP: /* CSV has no map type, just output flat list. */ for (i = 0; i < r->elements; i++) {