1
0
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:
Georg Richter
2013-06-17 06:58:20 +02:00
parent f6a87779b8
commit 71e3fc726f
4 changed files with 58 additions and 48 deletions

View File

@@ -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}
};