You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
Fix for CONC-27:
Prevent crash if mysql_thread_end was called without prior initialization via mysql_thread_init
This commit is contained in:
@@ -36,8 +36,25 @@ static int basic_connect(MYSQL *mysql)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc_27(MYSQL *mysql)
|
||||
{
|
||||
int rc;
|
||||
|
||||
mysql_thread_init();
|
||||
|
||||
rc= mysql_query(mysql, "SET @a:=1");
|
||||
check_mysql_rc(rc,mysql);
|
||||
|
||||
mysql_thread_end();
|
||||
rc= mysql_query(mysql, "SET @a:=2");
|
||||
check_mysql_rc(rc,mysql);
|
||||
mysql_thread_end();
|
||||
return OK;
|
||||
}
|
||||
|
||||
struct my_tests_st my_tests[] = {
|
||||
{"basic_connect", basic_connect, TEST_CONNECTION_NONE, 0, NULL, NULL},
|
||||
{"test_conc_27", test_conc_27, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||
{NULL, NULL, 0, 0, NULL, NULL}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user