1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Fix yet another regression after MDEV-3885.

If connection kills itself (or own query), it will get an error consistently,
with both COM_PROCESSKILL and with "KILL [QUERY] id"
This commit is contained in:
Vladislav Vaintroub
2012-11-27 15:47:08 +01:00
parent 0497ecc2c8
commit 5fddd4a7f0
2 changed files with 4 additions and 2 deletions

View File

@ -6717,8 +6717,10 @@ void sql_kill(THD *thd, ulong id, killed_state state)
uint error; uint error;
if (!(error= kill_one_thread(thd, id, state))) if (!(error= kill_one_thread(thd, id, state)))
{ {
if ((!thd->killed) || (thd->thread_id == id && thd->killed >= KILL_CONNECTION)) if ((!thd->killed))
my_ok(thd); my_ok(thd);
else
my_error(killed_errno(thd->killed), MYF(0), id);
} }
else else
my_error(error, MYF(0), id); my_error(error, MYF(0), id);

View File

@ -18566,7 +18566,7 @@ static void test_mdev3885()
myheader("test_mdev3885"); myheader("test_mdev3885");
conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0); conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
rc= mysql_kill(conn, mysql_thread_id(conn)); rc= mysql_kill(conn, mysql_thread_id(conn));
DIE_UNLESS(rc == 0); DIE_UNLESS(rc);
mysql_close(conn); mysql_close(conn);
} }