From 908a7843aa57bdc013eb329e48de987031ed5f62 Mon Sep 17 00:00:00 2001 From: wangbin579 Date: Fri, 20 Jul 2018 15:54:16 +0800 Subject: [PATCH] Close server conn when dist_tran is true and serivice is unavailable --- src/network-mysqld.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/network-mysqld.c b/src/network-mysqld.c index e73e7bc..6ab9d19 100644 --- a/src/network-mysqld.c +++ b/src/network-mysqld.c @@ -2325,9 +2325,11 @@ process_service_unavailable(network_mysqld_con *con) G_STRLOC, con); } con->dist_tran = 0; + con->server_to_be_closed = 1; } } +#ifndef SIMPLE_PARSER if (con->servers != NULL) { g_debug("%s: server num :%d for con:%p", G_STRLOC, (int)con->servers->len, con); size_t i; @@ -2345,11 +2347,8 @@ process_service_unavailable(network_mysqld_con *con) i--; } } - - if (con->servers->len == 0) { - con->server_to_be_closed = 1; - } } +#endif network_mysqld_con_send_error_full(con->client, C("service unavailable"), ER_TOO_MANY_USER_CONNECTIONS, "42000"); con->is_wait_server = 0;