mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-6619 SHOW PROCESSLIST returns empty result set after KILL QUERY
don't send an OK packet if the SHOW PROCESSLIST was killed
This commit is contained in:
14
mysql-test/r/kill_processlist-6619.result
Normal file
14
mysql-test/r/kill_processlist-6619.result
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
connect con1,localhost,root,,;
|
||||||
|
SHOW PROCESSLIST;
|
||||||
|
Id User Host db Command Time State Info Progress
|
||||||
|
# root # test Sleep # # NULL 0.000
|
||||||
|
# root # test Query # # SHOW PROCESSLIST 0.000
|
||||||
|
connection default;
|
||||||
|
KILL QUERY con_id;
|
||||||
|
connection con1;
|
||||||
|
SHOW PROCESSLIST;
|
||||||
|
ERROR 70100: Query execution was interrupted
|
||||||
|
SHOW PROCESSLIST;
|
||||||
|
Id User Host db Command Time State Info Progress
|
||||||
|
# root # test Sleep # # NULL 0.000
|
||||||
|
# root # test Query # # SHOW PROCESSLIST 0.000
|
17
mysql-test/t/kill_processlist-6619.test
Normal file
17
mysql-test/t/kill_processlist-6619.test
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#
|
||||||
|
# MDEV-6619 SHOW PROCESSLIST returns empty result set after KILL QUERY
|
||||||
|
#
|
||||||
|
--source include/not_embedded.inc
|
||||||
|
--enable_connect_log
|
||||||
|
--connect (con1,localhost,root,,)
|
||||||
|
--let $con_id = `SELECT CONNECTION_ID()`
|
||||||
|
--replace_column 1 # 3 # 6 # 7 #
|
||||||
|
SHOW PROCESSLIST;
|
||||||
|
--connection default
|
||||||
|
--replace_result $con_id con_id
|
||||||
|
eval KILL QUERY $con_id;
|
||||||
|
--connection con1
|
||||||
|
--error ER_QUERY_INTERRUPTED
|
||||||
|
SHOW PROCESSLIST;
|
||||||
|
--replace_column 1 # 3 # 6 # 7 #
|
||||||
|
SHOW PROCESSLIST;
|
@ -2178,9 +2178,10 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
|
|||||||
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
|
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
|
|
||||||
|
if (thd->killed)
|
||||||
|
DBUG_VOID_RETURN;
|
||||||
|
|
||||||
mysql_mutex_lock(&LOCK_thread_count); // For unlink from list
|
mysql_mutex_lock(&LOCK_thread_count); // For unlink from list
|
||||||
if (!thd->killed)
|
|
||||||
{
|
|
||||||
I_List_iterator<THD> it(threads);
|
I_List_iterator<THD> it(threads);
|
||||||
THD *tmp;
|
THD *tmp;
|
||||||
while ((tmp=it++))
|
while ((tmp=it++))
|
||||||
@ -2250,7 +2251,6 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
|
|||||||
thread_infos.append(thd_info);
|
thread_infos.append(thd_info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
mysql_mutex_unlock(&LOCK_thread_count);
|
mysql_mutex_unlock(&LOCK_thread_count);
|
||||||
|
|
||||||
thread_info *thd_info;
|
thread_info *thd_info;
|
||||||
|
Reference in New Issue
Block a user