You've already forked mariadb-connector-c
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:
@@ -805,7 +805,7 @@ mysql_close_start(MYSQL *sock)
|
||||
int res;
|
||||
|
||||
/* 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);
|
||||
/* If we need to block, return now and do the rest in mysql_close_cont(). */
|
||||
|
@@ -200,10 +200,17 @@ static int test_conc131(MYSQL *my)
|
||||
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[] = {
|
||||
{"async1", async1, TEST_CONNECTION_DEFAULT, 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}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user