From 96de2329d7fa3ca1585797638d78dc5801adff62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Thu, 1 Sep 2022 11:23:43 +0200 Subject: [PATCH] Fix behavior for 'ldap-max_db_connections' failing to decrease current used connections --- lib/MySQL_Session.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index b10caeb03..c5be72dba 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -641,7 +641,11 @@ MySQL_Session::~MySQL_Session() { break; #endif /* PROXYSQLCLICKHOUSE */ default: - GloMyAuth->decrease_frontend_user_connections(client_myds->myconn->userinfo->username); + if (use_ldap_auth == false) { + GloMyAuth->decrease_frontend_user_connections(client_myds->myconn->userinfo->username); + } else { + GloMyLdapAuth->decrease_frontend_user_connections(client_myds->myconn->userinfo->fe_username); + } break; } }