1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00
When resetting the connection with mysql reset_connection(), the
server_status must be checked and any other resultsets that mayi
exist must be removed.
This commit is contained in:
Georg Richter
2023-02-08 11:46:39 +01:00
parent c5179762c2
commit 75439c0f39
2 changed files with 48 additions and 3 deletions

View File

@@ -1922,7 +1922,43 @@ static int test_conc490(MYSQL *my __attribute__((unused)))
return OK;
}
static int test_conc632(MYSQL *my __attribute__((unused)))
{
MYSQL *mysql= mysql_init(NULL);
int rc;
if (!my_test_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_REMEMBER_OPTIONS))
{
diag("Connection failed. Error: %s", mysql_error(mysql));
mysql_close(mysql);
return FAIL;
}
rc= mysql_query(mysql, "CREATE OR REPLACE PROCEDURE conc632() "
"BEGIN "
" SELECT 1;"
" SELECT 2;"
"END");
check_mysql_rc(rc, mysql);
rc= mysql_query(mysql, "CALL conc632()");
check_mysql_rc(rc, mysql);
rc= mysql_reset_connection(mysql);
check_mysql_rc(rc, mysql);
rc= mysql_ping(mysql);
check_mysql_rc(rc, mysql);
rc= mysql_query(mysql, "DROP PROCEDURE conc632");
check_mysql_rc(rc, mysql);
mysql_close(mysql);
return OK;
}
struct my_tests_st my_tests[] = {
{"test_conc632", test_conc632, TEST_CONNECTION_NONE, 0, NULL, NULL},
{"test_conc490", test_conc490, TEST_CONNECTION_NONE, 0, NULL, NULL},
{"test_gtid", test_gtid, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_conc496", test_conc496, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},