summaryrefslogtreecommitdiff
path: root/mysql-test/suite/perfschema/r/dml_threads.result
blob: c8169a496073a48d6635431eb7cf73e530e83ccf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
select * from performance_schema.threads
where name like 'Thread/%' limit 1;
select * from performance_schema.threads
where name='FOO';
insert into performance_schema.threads
set name='FOO', thread_id=1, processlist_id=2;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'threads'
update performance_schema.threads
set thread_id=12;
ERROR HY000: Invalid performance_schema usage
update performance_schema.threads
set thread_id=12 where PROCESSLIST_ID=connection_id();
ERROR HY000: Invalid performance_schema usage
update performance_schema.threads
set instrumented= 'NO' where PROCESSLIST_ID=connection_id();
select instrumented from performance_schema.threads
where PROCESSLIST_ID=connection_id();
instrumented
NO
update performance_schema.threads
set instrumented= 'YES' where PROCESSLIST_ID=connection_id();
select instrumented from performance_schema.threads
where PROCESSLIST_ID=connection_id();
instrumented
YES
delete from performance_schema.threads
where id=1;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'threads'
delete from performance_schema.threads;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'threads'
LOCK TABLES performance_schema.threads READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.threads WRITE;
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment 
from information_schema.columns 
where table_schema='performance_schema' and table_name='threads';
column_name	column_comment
THREAD_ID	A unique thread identifier.
NAME	Name associated with the server's thread instrumentation code, for example thread/sql/main for the server's main() function, and thread/sql/one_connection for a user connection.
TYPE	FOREGROUND or BACKGROUND, depending on the thread type. User connection threads are FOREGROUND, internal server threads are BACKGROUND.
PROCESSLIST_ID	The PROCESSLIST.ID value for threads displayed in the INFORMATION_SCHEMA.PROCESSLIST table, or 0 for background threads. Also corresponds with the CONNECTION_ID() return value for the thread.
PROCESSLIST_USER	Foreground thread user, or NULL for a background thread.
PROCESSLIST_HOST	Foreground thread host, or NULL for a background thread.
PROCESSLIST_DB	Thread's default database, or NULL if none exists.
PROCESSLIST_COMMAND	Type of command executed by the thread. These correspond to the the COM_xxx client/server protocol commands, and the Com_xxx status variables. See Thread Command Values.
PROCESSLIST_TIME	Time in seconds the thread has been in its current state.
PROCESSLIST_STATE	Action, event or state indicating what the thread is doing.
PROCESSLIST_INFO	Statement being executed by the thread, or NULL if a statement is not being executed. If a statement results in calling other statements, such as for a stored procedure, the innermost statement from the stored procedure is shown here.
PARENT_THREAD_ID	THREAD_ID of the parent thread, if any. Subthreads can for example be spawned as a result of INSERT DELAYED statements.
ROLE	Unused.
INSTRUMENTED	YES or NO for Whether the thread is instrumented or not. For foreground threads, the initial value is determined by whether there's a user/host match in the setup_actors table. Subthreads are again matched, while for background threads, this will be set to YES by default. To monitor events that the thread executes, INSTRUMENTED must be YES and the thread_instrumentation consumer in the setup_consumers table must also be YES.
HISTORY	
CONNECTION_TYPE	
THREAD_OS_ID