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
CONC-632
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:
@@ -4240,13 +4240,22 @@ int STDCALL mysql_reset_connection(MYSQL *mysql)
|
||||
|
||||
/* skip result sets */
|
||||
if (mysql->status == MYSQL_STATUS_USE_RESULT ||
|
||||
mysql->status == MYSQL_STATUS_GET_RESULT ||
|
||||
mysql->status & SERVER_MORE_RESULTS_EXIST)
|
||||
mysql->status == MYSQL_STATUS_GET_RESULT)
|
||||
{
|
||||
mthd_my_skip_result(mysql);
|
||||
mysql->status= MYSQL_STATUS_READY;
|
||||
}
|
||||
|
||||
if (mysql->server_status & SERVER_MORE_RESULTS_EXIST)
|
||||
{
|
||||
while (mysql_next_result(mysql))
|
||||
{
|
||||
MYSQL_RES *res= mysql_use_result(mysql);
|
||||
mysql_free_result(res);
|
||||
}
|
||||
}
|
||||
|
||||
mysql->status= MYSQL_STATUS_READY;
|
||||
|
||||
rc= ma_simple_command(mysql, COM_RESET_CONNECTION, 0, 0, 0, 0);
|
||||
if (rc && mysql->options.reconnect)
|
||||
{
|
||||
|
Reference in New Issue
Block a user