From 67732bacb1bcf5e47d8796feecc0c88c12da8e5e Mon Sep 17 00:00:00 2001 From: uriyage <78144248+uriyage@users.noreply.github.com> Date: Mon, 5 Jul 2021 10:55:55 +0300 Subject: [PATCH] redis-cli: reset dbnum and tx prompt state after RESET (#9096) --- src/redis-cli.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/redis-cli.c b/src/redis-cli.c index 3c33adcfa..171a2ed79 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -1488,7 +1488,14 @@ static int cliSendCommand(int argc, char **argv, long repeat) { config.in_multi = 0; config.input_dbnum = config.dbnum = config.pre_multi_dbnum; cliRefreshPrompt(); - } + } else if (!strcasecmp(command,"reset") && argc == 1 && + config.last_cmd_type != REDIS_REPLY_ERROR) { + config.in_multi = 0; + config.dbnum = 0; + config.input_dbnum = 0; + config.resp3 = 0; + cliRefreshPrompt(); + } } if (config.cluster_reissue_command){ /* If we need to reissue the command, break to prevent a