Commit 9dfd9d14 authored by sskorgal's avatar sskorgal Committed by GitHub
Browse files

Fix for redis_cli printing default DB when select command fails.

parent 24bd9b19
......@@ -916,7 +916,7 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
return REDIS_ERR;
} else {
/* Store database number when SELECT was successfully executed. */
if (!strcasecmp(command,"select") && argc == 2) {
if (!strcasecmp(command,"select") && argc == 2 && config.last_cmd_type != REDIS_REPLY_ERROR) {
config.dbnum = atoi(argv[1]);
cliRefreshPrompt();
} else if (!strcasecmp(command,"auth") && argc == 2) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment