diff --git a/libmariadb/mariadb_lib.c b/libmariadb/mariadb_lib.c index 4db33898..aaaf5576 100644 --- a/libmariadb/mariadb_lib.c +++ b/libmariadb/mariadb_lib.c @@ -403,6 +403,7 @@ mthd_my_send_cmd(MYSQL *mysql,enum enum_server_command command, const char *arg, (socket) is still available */ if (command != COM_QUIT && mysql->options.reconnect && ma_pvio_is_alive(mysql->net.pvio)) { + ma_pvio_close(mysql->net.pvio); mysql->net.pvio= NULL; mysql->net.error= 1; } @@ -2461,17 +2462,15 @@ void my_set_error(MYSQL *mysql, void mysql_close_slow_part(MYSQL *mysql) { - if (mysql->net.pvio) - { - free_old_query(mysql); - mysql->status=MYSQL_STATUS_READY; /* Force command */ - mysql->options.reconnect=0; - if (mysql->net.pvio && mysql->net.buff) - ma_simple_command(mysql, COM_QUIT,NullS,0,1,0); - end_server(mysql); - } + free_old_query(mysql); + mysql->status=MYSQL_STATUS_READY; /* Force command */ + mysql->options.reconnect=0; + if (mysql->net.pvio && mysql->net.buff) + ma_simple_command(mysql, COM_QUIT,NullS,0,1,0); + end_server(mysql); + /* there is an ongoing async operation */ - else if (mysql->options.extension && mysql->options.extension->async_context) + if (mysql->options.extension && mysql->options.extension->async_context) { if (mysql->options.extension->async_context->pending_gai_res) { diff --git a/unittest/libmariadb/connection.c b/unittest/libmariadb/connection.c index b72563d0..b3dc08b4 100644 --- a/unittest/libmariadb/connection.c +++ b/unittest/libmariadb/connection.c @@ -2410,7 +2410,8 @@ int test_tls_timeout(MYSQL *unused __attribute__((unused))) } -#if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL) +#if defined(HAVE_GNUTLS) && GNUTLS_VERSION_NUMBER >= 0x030700 || defined(HAVE_OPENSSL) +#define HAVE_test_conc748 static int test_conc748(MYSQL *my __attribute__((unused))) { MYSQL *mysql; @@ -2496,7 +2497,7 @@ struct my_tests_st my_tests[] = { {"test_conc589", test_conc589, TEST_CONNECTION_DEFAULT, 0, NULL, NULL}, {"test_tls_timeout", test_tls_timeout, TEST_CONNECTION_NONE, 0, NULL, NULL}, {"test_parsec", test_parsec, TEST_CONNECTION_DEFAULT, 0, NULL, NULL}, -#if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL) +#ifdef HAVE_test_conc748 {"test_conc748", test_conc748, TEST_CONNECTION_NONE, 0, NULL, NULL}, #endif {"test_conc505", test_conc505, TEST_CONNECTION_NONE, 0, NULL, NULL},