Skip to content

Commit dc66a87

Browse files
committed
WL#4674 PERFORMANCE_SCHEMA Setup For Actors
Port, continued
1 parent 48676d0 commit dc66a87

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+892
-415
lines changed

mysql-test/suite/perfschema/include/setup_helper.inc

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ update performance_schema.SETUP_CONSUMERS set enabled='YES';
2525

2626
connect (con1, localhost, root, , );
2727

28-
let $con1_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
29-
where ID in (select connection_id())`;
28+
let $con1_THREAD_ID=`select thread_id from performance_schema.THREADS
29+
where PROCESSLIST_ID = connection_id()`;
3030

3131
connect (con2, localhost, root, , );
3232

33-
let $con2_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
34-
where ID in (select connection_id())`;
33+
let $con2_THREAD_ID=`select thread_id from performance_schema.THREADS
34+
where PROCESSLIST_ID = connection_id()`;
3535

3636
connect (con3, localhost, root, , );
3737

38-
let $con3_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
39-
where ID in (select connection_id())`;
38+
let $con3_THREAD_ID=`select thread_id from performance_schema.THREADS
39+
where PROCESSLIST_ID = connection_id()`;
4040

4141
connection default;
4242

@@ -49,6 +49,6 @@ prepare stmt_dump_events from
4949
where thread_id=? order by event_id;";
5050

5151
prepare stmt_dump_thread from
52-
"select name from performance_schema.PROCESSLIST where thread_id=? ;";
52+
"select name from performance_schema.THREADS where thread_id=? ;";
5353
--enable_query_log
5454

mysql-test/suite/perfschema/include/start_server_common.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
3737
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
3838
select * from performance_schema.MUTEX_INSTANCES;
3939
select * from performance_schema.PERFORMANCE_TIMERS;
40-
select * from performance_schema.PROCESSLIST;
4140
select * from performance_schema.RWLOCK_INSTANCES;
4241
select * from performance_schema.SETUP_CONSUMERS;
4342
select * from performance_schema.SETUP_INSTRUMENTS;
4443
select * from performance_schema.SETUP_OBJECTS;
4544
select * from performance_schema.SETUP_TIMERS;
45+
select * from performance_schema.THREADS;
4646
--enable_result_log
4747

4848
# This has a stable output, printing the result:
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
alter table performance_schema.PROCESSLIST add column foo integer;
1+
alter table performance_schema.THREADS add column foo integer;
22
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
3-
truncate table performance_schema.PROCESSLIST;
3+
truncate table performance_schema.THREADS;
44
ERROR HY000: Invalid performance_schema usage.
5-
ALTER TABLE performance_schema.PROCESSLIST ADD INDEX test_index(ID);
5+
ALTER TABLE performance_schema.THREADS ADD INDEX test_index(PROCESSLIST_ID);
66
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
7-
CREATE UNIQUE INDEX test_index ON performance_schema.PROCESSLIST(ID);
7+
CREATE UNIQUE INDEX test_index ON performance_schema.THREADS(PROCESSLIST_ID);
88
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

mysql-test/suite/perfschema/r/dml_processlist.result

-27
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
select * from performance_schema.THREADS
2+
where name like 'Thread/%' limit 1;
3+
THREAD_ID NAME TYPE PROCESSLIST_ID PROCESSLIST_USER PROCESSLIST_HOST PROCESSLIST_DB PROCESSLIST_COMMAND PROCESSLIST_TIME PROCESSLIST_STATE PROCESSLIST_INFO PARENT_THREAD_ID ROLE INSTRUMENTED
4+
# # # # # # # # # # # # # #
5+
select * from performance_schema.THREADS
6+
where name='FOO';
7+
THREAD_ID NAME TYPE PROCESSLIST_ID PROCESSLIST_USER PROCESSLIST_HOST PROCESSLIST_DB PROCESSLIST_COMMAND PROCESSLIST_TIME PROCESSLIST_STATE PROCESSLIST_INFO PARENT_THREAD_ID ROLE INSTRUMENTED
8+
insert into performance_schema.THREADS
9+
set name='FOO', thread_id=1, processlist_id=2;
10+
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'THREADS'
11+
update performance_schema.THREADS
12+
set thread_id=12;
13+
ERROR HY000: Invalid performance_schema usage.
14+
update performance_schema.THREADS
15+
set thread_id=12 where PROCESSLIST_ID=connection_id();
16+
ERROR HY000: Invalid performance_schema usage.
17+
update performance_schema.THREADS
18+
set instrumented= 'NO' where PROCESSLIST_ID=connection_id();
19+
select instrumented from performance_schema.THREADS
20+
where PROCESSLIST_ID=connection_id();
21+
instrumented
22+
NO
23+
update performance_schema.THREADS
24+
set instrumented= 'YES' where PROCESSLIST_ID=connection_id();
25+
select instrumented from performance_schema.THREADS
26+
where PROCESSLIST_ID=connection_id();
27+
instrumented
28+
YES
29+
delete from performance_schema.THREADS
30+
where id=1;
31+
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'THREADS'
32+
delete from performance_schema.THREADS;
33+
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'THREADS'
34+
LOCK TABLES performance_schema.THREADS READ;
35+
UNLOCK TABLES;
36+
LOCK TABLES performance_schema.THREADS WRITE;
37+
UNLOCK TABLES;

mysql-test/suite/perfschema/r/func_file_io.result

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
22
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
33
WHERE name LIKE 'wait/io/file/%';
4+
update performance_schema.THREADS SET instrumented = 'YES'
5+
WHERE PROCESSLIST_ID=connection_id();
46
DROP TABLE IF EXISTS t1;
57
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
68
ENGINE=MyISAM;
@@ -94,24 +96,23 @@ FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
9496
WHERE COUNT_STAR > 0
9597
ORDER BY SUM_TIMER_WAIT DESC
9698
LIMIT 10;
97-
SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT
99+
SELECT p.processlist_user, SUM(TIMER_WAIT) SUM_WAIT
98100
# ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
99101
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
100-
INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
101-
LEFT JOIN information_schema.PROCESSLIST i USING (ID)
102-
GROUP BY i.user
102+
INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
103+
GROUP BY p.processlist_user
103104
ORDER BY SUM_WAIT DESC
104105
LIMIT 20;
105106
SELECT h.EVENT_NAME, SUM(h.TIMER_WAIT) TOTAL_WAIT
106107
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
107-
INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
108-
WHERE p.ID = 1
108+
INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
109+
WHERE p.PROCESSLIST_ID = 1
109110
GROUP BY h.EVENT_NAME
110111
HAVING TOTAL_WAIT > 0;
111-
SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes
112+
SELECT p.processlist_user, h.operation, SUM(NUMBER_OF_BYTES) bytes
112113
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
113-
INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
114-
LEFT JOIN information_schema.PROCESSLIST i USING (ID)
115-
GROUP BY i.user, h.operation
114+
INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
115+
GROUP BY p.processlist_user, h.operation
116116
HAVING BYTES > 0
117-
ORDER BY i.user, h.operation;
117+
ORDER BY p.processlist_user, h.operation;
118+
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';

mysql-test/suite/perfschema/r/information_schema.result

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ performance_schema FILE_SUMMARY_BY_EVENT_NAME def
1414
performance_schema FILE_SUMMARY_BY_INSTANCE def
1515
performance_schema MUTEX_INSTANCES def
1616
performance_schema PERFORMANCE_TIMERS def
17-
performance_schema PROCESSLIST def
1817
performance_schema RWLOCK_INSTANCES def
1918
performance_schema SETUP_CONSUMERS def
2019
performance_schema SETUP_INSTRUMENTS def
2120
performance_schema SETUP_OBJECTS def
2221
performance_schema SETUP_TIMERS def
22+
performance_schema THREADS def
2323
select upper(TABLE_NAME), TABLE_TYPE, ENGINE
2424
from information_schema.tables
2525
where TABLE_SCHEMA='performance_schema';
@@ -36,12 +36,12 @@ FILE_SUMMARY_BY_EVENT_NAME BASE TABLE PERFORMANCE_SCHEMA
3636
FILE_SUMMARY_BY_INSTANCE BASE TABLE PERFORMANCE_SCHEMA
3737
MUTEX_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
3838
PERFORMANCE_TIMERS BASE TABLE PERFORMANCE_SCHEMA
39-
PROCESSLIST BASE TABLE PERFORMANCE_SCHEMA
4039
RWLOCK_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
4140
SETUP_CONSUMERS BASE TABLE PERFORMANCE_SCHEMA
4241
SETUP_INSTRUMENTS BASE TABLE PERFORMANCE_SCHEMA
4342
SETUP_OBJECTS BASE TABLE PERFORMANCE_SCHEMA
4443
SETUP_TIMERS BASE TABLE PERFORMANCE_SCHEMA
44+
THREADS BASE TABLE PERFORMANCE_SCHEMA
4545
select upper(TABLE_NAME), VERSION, ROW_FORMAT
4646
from information_schema.tables
4747
where TABLE_SCHEMA='performance_schema';
@@ -58,12 +58,12 @@ FILE_SUMMARY_BY_EVENT_NAME 10 Dynamic
5858
FILE_SUMMARY_BY_INSTANCE 10 Dynamic
5959
MUTEX_INSTANCES 10 Dynamic
6060
PERFORMANCE_TIMERS 10 Fixed
61-
PROCESSLIST 10 Dynamic
6261
RWLOCK_INSTANCES 10 Dynamic
6362
SETUP_CONSUMERS 10 Dynamic
6463
SETUP_INSTRUMENTS 10 Dynamic
6564
SETUP_OBJECTS 10 Dynamic
6665
SETUP_TIMERS 10 Dynamic
66+
THREADS 10 Dynamic
6767
select upper(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
6868
from information_schema.tables
6969
where TABLE_SCHEMA='performance_schema';
@@ -80,12 +80,12 @@ FILE_SUMMARY_BY_EVENT_NAME 1000 0
8080
FILE_SUMMARY_BY_INSTANCE 1000 0
8181
MUTEX_INSTANCES 1000 0
8282
PERFORMANCE_TIMERS 5 0
83-
PROCESSLIST 1000 0
8483
RWLOCK_INSTANCES 1000 0
8584
SETUP_CONSUMERS 8 0
8685
SETUP_INSTRUMENTS 1000 0
8786
SETUP_OBJECTS 1000 0
8887
SETUP_TIMERS 1 0
88+
THREADS 1000 0
8989
select upper(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
9090
from information_schema.tables
9191
where TABLE_SCHEMA='performance_schema';
@@ -102,12 +102,12 @@ FILE_SUMMARY_BY_EVENT_NAME 0 0
102102
FILE_SUMMARY_BY_INSTANCE 0 0
103103
MUTEX_INSTANCES 0 0
104104
PERFORMANCE_TIMERS 0 0
105-
PROCESSLIST 0 0
106105
RWLOCK_INSTANCES 0 0
107106
SETUP_CONSUMERS 0 0
108107
SETUP_INSTRUMENTS 0 0
109108
SETUP_OBJECTS 0 0
110109
SETUP_TIMERS 0 0
110+
THREADS 0 0
111111
select upper(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
112112
from information_schema.tables
113113
where TABLE_SCHEMA='performance_schema';
@@ -124,12 +124,12 @@ FILE_SUMMARY_BY_EVENT_NAME 0 0 NULL
124124
FILE_SUMMARY_BY_INSTANCE 0 0 NULL
125125
MUTEX_INSTANCES 0 0 NULL
126126
PERFORMANCE_TIMERS 0 0 NULL
127-
PROCESSLIST 0 0 NULL
128127
RWLOCK_INSTANCES 0 0 NULL
129128
SETUP_CONSUMERS 0 0 NULL
130129
SETUP_INSTRUMENTS 0 0 NULL
131130
SETUP_OBJECTS 0 0 NULL
132131
SETUP_TIMERS 0 0 NULL
132+
THREADS 0 0 NULL
133133
select upper(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
134134
from information_schema.tables
135135
where TABLE_SCHEMA='performance_schema';
@@ -146,12 +146,12 @@ FILE_SUMMARY_BY_EVENT_NAME NULL NULL NULL
146146
FILE_SUMMARY_BY_INSTANCE NULL NULL NULL
147147
MUTEX_INSTANCES NULL NULL NULL
148148
PERFORMANCE_TIMERS NULL NULL NULL
149-
PROCESSLIST NULL NULL NULL
150149
RWLOCK_INSTANCES NULL NULL NULL
151150
SETUP_CONSUMERS NULL NULL NULL
152151
SETUP_INSTRUMENTS NULL NULL NULL
153152
SETUP_OBJECTS NULL NULL NULL
154153
SETUP_TIMERS NULL NULL NULL
154+
THREADS NULL NULL NULL
155155
select upper(TABLE_NAME), TABLE_COLLATION, CHECKSUM
156156
from information_schema.tables
157157
where TABLE_SCHEMA='performance_schema';
@@ -168,12 +168,12 @@ FILE_SUMMARY_BY_EVENT_NAME utf8_general_ci NULL
168168
FILE_SUMMARY_BY_INSTANCE utf8_general_ci NULL
169169
MUTEX_INSTANCES utf8_general_ci NULL
170170
PERFORMANCE_TIMERS utf8_general_ci NULL
171-
PROCESSLIST utf8_general_ci NULL
172171
RWLOCK_INSTANCES utf8_general_ci NULL
173172
SETUP_CONSUMERS utf8_general_ci NULL
174173
SETUP_INSTRUMENTS utf8_general_ci NULL
175174
SETUP_OBJECTS utf8_general_ci NULL
176175
SETUP_TIMERS utf8_general_ci NULL
176+
THREADS utf8_general_ci NULL
177177
select upper(TABLE_NAME), TABLE_COMMENT
178178
from information_schema.tables
179179
where TABLE_SCHEMA='performance_schema';
@@ -190,9 +190,9 @@ FILE_SUMMARY_BY_EVENT_NAME
190190
FILE_SUMMARY_BY_INSTANCE
191191
MUTEX_INSTANCES
192192
PERFORMANCE_TIMERS
193-
PROCESSLIST
194193
RWLOCK_INSTANCES
195194
SETUP_CONSUMERS
196195
SETUP_INSTRUMENTS
197196
SETUP_OBJECTS
198197
SETUP_TIMERS
198+
THREADS

mysql-test/suite/perfschema/r/misc.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
22
WHERE THREAD_ID IN
3-
(SELECT THREAD_ID FROM performance_schema.PROCESSLIST)
3+
(SELECT THREAD_ID FROM performance_schema.THREADS)
44
AND EVENT_NAME IN
55
(SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
66
WHERE NAME LIKE "wait/synch/%")

mysql-test/suite/perfschema/r/no_threads.result

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ show variables like "performance_schema_max_thread%";
1717
Variable_name Value
1818
performance_schema_max_thread_classes 50
1919
performance_schema_max_thread_instances 10
20-
select count(*) from performance_schema.PROCESSLIST
20+
select count(*) from performance_schema.THREADS
2121
where name like "thread/sql/main";
2222
count(*)
2323
1
24-
select count(*) from performance_schema.PROCESSLIST
24+
select count(*) from performance_schema.THREADS
2525
where name like "thread/sql/OneConnection";
2626
count(*)
2727
0

mysql-test/suite/perfschema/r/selects.result

+10-10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ OPERATION TOTAL
1313
chsize [NUM_BYTES]
1414
SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
1515
WHERE THREAD_ID IN
16-
(SELECT THREAD_ID FROM performance_schema.PROCESSLIST)
16+
(SELECT THREAD_ID FROM performance_schema.THREADS)
1717
AND EVENT_NAME IN
1818
(SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
1919
WHERE NAME LIKE "wait/synch/%")
@@ -76,21 +76,21 @@ id c
7676
12 [EVENT_ID]
7777
13 [EVENT_ID]
7878
DROP TRIGGER t_ps_trigger;
79-
CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
79+
CREATE PROCEDURE t_ps_proc(IN conid INT, OUT pid INT)
8080
BEGIN
81-
SELECT id FROM performance_schema.PROCESSLIST
82-
WHERE THREAD_ID = tid INTO pid;
81+
SELECT thread_id FROM performance_schema.THREADS
82+
WHERE PROCESSLIST_ID = conid INTO pid;
8383
END;
8484
|
85-
CALL t_ps_proc(0, @p_id);
86-
CREATE FUNCTION t_ps_func(tid INT) RETURNS int
85+
CALL t_ps_proc(connection_id(), @p_id);
86+
CREATE FUNCTION t_ps_func(conid INT) RETURNS int
8787
BEGIN
88-
return (SELECT id FROM performance_schema.PROCESSLIST
89-
WHERE THREAD_ID = tid);
88+
return (SELECT thread_id FROM performance_schema.THREADS
89+
WHERE PROCESSLIST_ID = conid);
9090
END;
9191
|
92-
SELECT t_ps_func(0) = @p_id;
93-
t_ps_func(0) = @p_id
92+
SELECT t_ps_func(connection_id()) = @p_id;
93+
t_ps_func(connection_id()) = @p_id
9494
1
9595
DROP PROCEDURE t_ps_proc;
9696
DROP FUNCTION t_ps_func;

mysql-test/suite/perfschema/r/start_server_no_cond_class.result

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
2929
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
3030
select * from performance_schema.MUTEX_INSTANCES;
3131
select * from performance_schema.PERFORMANCE_TIMERS;
32-
select * from performance_schema.PROCESSLIST;
3332
select * from performance_schema.RWLOCK_INSTANCES;
3433
select * from performance_schema.SETUP_CONSUMERS;
3534
select * from performance_schema.SETUP_INSTRUMENTS;
3635
select * from performance_schema.SETUP_OBJECTS;
3736
select * from performance_schema.SETUP_TIMERS;
37+
select * from performance_schema.THREADS;
3838
show variables like "performance_schema%";
3939
Variable_name Value
4040
performance_schema ON
@@ -53,6 +53,7 @@ performance_schema_max_table_handles 100000
5353
performance_schema_max_table_instances 50000
5454
performance_schema_max_thread_classes 50
5555
performance_schema_max_thread_instances 1000
56+
performance_schema_setup_actors_size 100
5657
show engine PERFORMANCE_SCHEMA status;
5758
show status like "performance_schema%";
5859
show variables like "performance_schema_max_cond_classes";

mysql-test/suite/perfschema/r/start_server_no_cond_inst.result

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
2929
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
3030
select * from performance_schema.MUTEX_INSTANCES;
3131
select * from performance_schema.PERFORMANCE_TIMERS;
32-
select * from performance_schema.PROCESSLIST;
3332
select * from performance_schema.RWLOCK_INSTANCES;
3433
select * from performance_schema.SETUP_CONSUMERS;
3534
select * from performance_schema.SETUP_INSTRUMENTS;
3635
select * from performance_schema.SETUP_OBJECTS;
3736
select * from performance_schema.SETUP_TIMERS;
37+
select * from performance_schema.THREADS;
3838
show variables like "performance_schema%";
3939
Variable_name Value
4040
performance_schema ON
@@ -53,6 +53,7 @@ performance_schema_max_table_handles 100000
5353
performance_schema_max_table_instances 50000
5454
performance_schema_max_thread_classes 50
5555
performance_schema_max_thread_instances 1000
56+
performance_schema_setup_actors_size 100
5657
show engine PERFORMANCE_SCHEMA status;
5758
show status like "performance_schema%";
5859
show variables like "performance_schema_max_cond_classes";

0 commit comments

Comments
 (0)