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:
parent
3ea4c43add
commit
7d43159a7d
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user