redis-cli: reset dbnum and tx prompt state after RESET (#9096)

This commit is contained in:
uriyage 2021-07-05 10:55:55 +03:00 committed by GitHub
parent a418a2d3fc
commit 67732bacb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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