1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-5138 Numerous test failures in "mtr --ps --embedded".

Thread can be disconnected internally for example after COMMIT statements.
     So we should check this for the statement execution.
This commit is contained in:
Alexey Botchkov
2014-04-15 18:16:47 +05:00
parent 8a6a95a111
commit 9d32b8b2aa

View File

@ -40,6 +40,7 @@ C_MODE_START
extern unsigned int mysql_server_last_errno;
extern char mysql_server_last_error[MYSQL_ERRMSG_SIZE];
static my_bool emb_read_query_result(MYSQL *mysql);
static void emb_free_embedded_thd(MYSQL *mysql);
extern "C" void unireg_clear(int exit_code)
@ -107,6 +108,17 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
NET *net= &mysql->net;
my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE;
if (thd->killed != NOT_KILLED)
{
if (thd->killed < KILL_CONNECTION)
thd->killed= NOT_KILLED;
else
{
emb_free_embedded_thd(mysql);
thd= 0;
}
}
if (!thd)
{
/* Do "reconnect" if possible */