Unverified Commit 7d43159a authored by Wen Hui's avatar Wen Hui Committed by GitHub
Browse files

redis-cli prompt: fix db number and transaction state inconsistencies after reconnect (#8551)

After reconnect, the prompt was showing the db ID and multi state of the previous connection. 
parent 3ea4c43a
...@@ -819,6 +819,9 @@ static int cliConnect(int flags) { ...@@ -819,6 +819,9 @@ static int cliConnect(int flags) {
if (context == NULL || flags & CC_FORCE) { if (context == NULL || flags & CC_FORCE) {
if (context != NULL) { if (context != NULL) {
redisFree(context); redisFree(context);
config.dbnum = 0;
config.in_multi = 0;
cliRefreshPrompt();
} }
if (config.hostsocket == NULL) { if (config.hostsocket == NULL) {
......
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