1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Fix for CONC-129 (asynchronous api): Check if connection is still alive in

mysql_close_start
This commit is contained in:
Georg Richter
2015-09-08 07:33:30 +02:00
parent 752636192f
commit abf0080bfa
2 changed files with 8 additions and 1 deletions

View File

@@ -805,7 +805,7 @@ mysql_close_start(MYSQL *sock)
int res; int res;
/* It is legitimate to have NULL sock argument, which will do nothing. */ /* It is legitimate to have NULL sock argument, which will do nothing. */
if (sock) if (sock && sock->net.vio)
{ {
res= mysql_close_slow_part_start(sock); res= mysql_close_slow_part_start(sock);
/* If we need to block, return now and do the rest in mysql_close_cont(). */ /* If we need to block, return now and do the rest in mysql_close_cont(). */

View File

@@ -200,10 +200,17 @@ static int test_conc131(MYSQL *my)
return OK; return OK;
} }
static int test_conc129(MYSQL *my)
{
MYSQL *mysql= mysql_init(NULL);
FAIL_IF(mysql_close_start(mysql), "No error expected");
}
struct my_tests_st my_tests[] = { struct my_tests_st my_tests[] = {
{"async1", async1, TEST_CONNECTION_DEFAULT, 0, NULL, NULL}, {"async1", async1, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_conc131", test_conc131, TEST_CONNECTION_NONE, 0, NULL, NULL}, {"test_conc131", test_conc131, TEST_CONNECTION_NONE, 0, NULL, NULL},
{"test_conc129", test_conc129, TEST_CONNECTION_NONE, 0, NULL, NULL},
{NULL, NULL, 0, 0, NULL, NULL} {NULL, NULL, 0, 0, NULL, NULL}
}; };