Commit d4f83cc4 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-4911 - add KILL query id, and add query id information to processlist

- issue proper error message if query id is not found
- do not allow kill query id 0
- fixed ps-protocol and embedded tests
parent 1a2a9d74
......@@ -306,5 +306,7 @@ SELECT SLEEP(1000);
KILL QUERY ID @id;
SLEEP(1000)
1
KILL QUERY ID 0;
ERROR HY000: Unknown query id: 0
SET DEBUG_SYNC = 'RESET';
DROP FUNCTION MY_KILL;
......@@ -242,6 +242,7 @@ def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 429496729
def information_schema PROCESSLIST MAX_STAGE 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2)
def information_schema PROCESSLIST MEMORY_USED 13 0 NO int NULL NULL 10 0 NULL NULL NULL int(7)
def information_schema PROCESSLIST PROGRESS 12 0.000 NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3)
def information_schema PROCESSLIST QUERY_ID 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4)
def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2)
def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(7)
......@@ -734,6 +735,7 @@ NULL information_schema PROCESSLIST MAX_STAGE tinyint NULL NULL NULL NULL tinyin
NULL information_schema PROCESSLIST PROGRESS decimal NULL NULL NULL NULL decimal(7,3)
NULL information_schema PROCESSLIST MEMORY_USED int NULL NULL NULL NULL int(7)
NULL information_schema PROCESSLIST EXAMINED_ROWS int NULL NULL NULL NULL int(7)
NULL information_schema PROCESSLIST QUERY_ID bigint NULL NULL NULL NULL bigint(4)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
......
......@@ -644,5 +644,8 @@ KILL QUERY ID @id;
connection default;
reap;
--error ER_NO_SUCH_QUERY
KILL QUERY ID 0;
SET DEBUG_SYNC = 'RESET';
DROP FUNCTION MY_KILL;
......@@ -6559,3 +6559,7 @@ ER_GTID_POSITION_NOT_FOUND_IN_BINLOG2
eng "Connecting slave requested to start from GTID %u-%u-%llu, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra errorneous transactions"
ER_BINLOG_MUST_BE_EMPTY
eng "This operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the log"
ER_NO_SUCH_QUERY
eng "Unknown query id: %lld"
ger "Unbekannte Abfrage-ID: %lld"
rus "Неизвестный номер запроса: %lld"
......@@ -6854,11 +6854,11 @@ uint
kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type type)
{
THD *tmp;
uint error=ER_NO_SUCH_THREAD;
uint error= (type == KILL_TYPE_QUERY ? ER_NO_SUCH_QUERY : ER_NO_SUCH_THREAD);
DBUG_ENTER("kill_one_thread");
DBUG_PRINT("enter", ("id: %lld signal: %u", id, (uint) kill_signal));
if ((tmp= find_thread_by_id(id, type == KILL_TYPE_QUERY)))
if (id && (tmp= find_thread_by_id(id, type == KILL_TYPE_QUERY)))
{
/*
If we're SUPER, we can KILL anything, including system-threads.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment