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.
This commit is contained in:
Wen Hui 2021-02-25 13:08:24 -05:00 committed by GitHub
parent 3ea4c43add
commit 7d43159a7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -819,6 +819,9 @@ static int cliConnect(int flags) {
if (context == NULL || flags & CC_FORCE) {
if (context != NULL) {
redisFree(context);
config.dbnum = 0;
config.in_multi = 0;
cliRefreshPrompt();
}
if (config.hostsocket == NULL) {