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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
##
## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
## Verify behavior for regular users and PROCESS_ACL.
##
SELECT @@global.performance_schema_show_processlist INTO @save_processlist;
SET @@global.performance_schema_show_processlist = OFF;
Warnings:
Warning 4166 '@@performance_schema_show_processlist' is deprecated and will be removed in a future release. When it is removed, SHOW PROCESSLIST will always use the performance schema implementation.
CREATE USER 'regular'@'localhost';
SHOW GRANTS;
Grants for regular@localhost
GRANT USAGE ON *.* TO `regular`@`localhost`
SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
USER INFO
regular SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST
Warnings:
Warning 1287 'INFORMATION_SCHEMA.PROCESSLIST' is deprecated and will be removed in a future release. Please use performance_schema.processlist instead
SELECT USER, INFO FROM performance_schema.processlist;
USER INFO
regular SELECT USER, INFO FROM performance_schema.processlist
SHOW PROCESSLIST;
SELECT "Previous statement is now completed." as status;
status
Previous statement is now completed.
SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
FROM performance_schema.events_statements_history
WHERE SQL_TEXT = "SHOW PROCESSLIST";
EVENT_NAME SQL_TEXT BROKEN_ROWS_SENT
statement/sql/show_processlist SHOW PROCESSLIST 0
TRUNCATE TABLE performance_schema.events_statements_history;
SET @@global.performance_schema_show_processlist = ON;
Warnings:
Warning 4166 '@@performance_schema_show_processlist' is deprecated and will be removed in a future release. When it is removed, SHOW PROCESSLIST will always use the performance schema implementation.
SHOW GRANTS;
Grants for regular@localhost
GRANT USAGE ON *.* TO `regular`@`localhost`
SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
USER INFO
regular SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST
Warnings:
Warning 1287 'INFORMATION_SCHEMA.PROCESSLIST' is deprecated and will be removed in a future release. Please use performance_schema.processlist instead
SELECT USER, INFO FROM performance_schema.processlist;
USER INFO
regular SELECT USER, INFO FROM performance_schema.processlist
SHOW PROCESSLIST;
SELECT "Previous statement is now completed." as status;
status
Previous statement is now completed.
SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT
FROM performance_schema.events_statements_history
WHERE SQL_TEXT = "SHOW PROCESSLIST";
EVENT_NAME SQL_TEXT ROWS_SENT
statement/sql/show_processlist SHOW PROCESSLIST 1
TRUNCATE TABLE performance_schema.events_statements_history;
GRANT PROCESS ON *.* TO 'regular'@'localhost';
SET @@global.performance_schema_show_processlist = OFF;
Warnings:
Warning 4166 '@@performance_schema_show_processlist' is deprecated and will be removed in a future release. When it is removed, SHOW PROCESSLIST will always use the performance schema implementation.
SHOW GRANTS;
Grants for regular@localhost
GRANT PROCESS ON *.* TO `regular`@`localhost`
SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
count(*) >= 2
1
Warnings:
Warning 1287 'INFORMATION_SCHEMA.PROCESSLIST' is deprecated and will be removed in a future release. Please use performance_schema.processlist instead
SELECT count(*) >= 2 FROM performance_schema.processlist;
count(*) >= 2
1
SHOW PROCESSLIST;
SELECT "Previous statement is now completed." as status;
status
Previous statement is now completed.
SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
FROM performance_schema.events_statements_history
WHERE SQL_TEXT = "SHOW PROCESSLIST";
EVENT_NAME SQL_TEXT BROKEN_ROWS_SENT
statement/sql/show_processlist SHOW PROCESSLIST 0
TRUNCATE TABLE performance_schema.events_statements_history;
SET @@global.performance_schema_show_processlist = ON;
Warnings:
Warning 4166 '@@performance_schema_show_processlist' is deprecated and will be removed in a future release. When it is removed, SHOW PROCESSLIST will always use the performance schema implementation.
SHOW GRANTS;
Grants for regular@localhost
GRANT PROCESS ON *.* TO `regular`@`localhost`
SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
count(*) >= 2
1
Warnings:
Warning 1287 'INFORMATION_SCHEMA.PROCESSLIST' is deprecated and will be removed in a future release. Please use performance_schema.processlist instead
SELECT count(*) >= 2 FROM performance_schema.processlist;
count(*) >= 2
1
SHOW PROCESSLIST;
SELECT "Previous statement is now completed." as status;
status
Previous statement is now completed.
SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT >= 2
FROM performance_schema.events_statements_history
WHERE SQL_TEXT = "SHOW PROCESSLIST";
EVENT_NAME SQL_TEXT ROWS_SENT >= 2
statement/sql/show_processlist SHOW PROCESSLIST 1
TRUNCATE TABLE performance_schema.events_statements_history;
SET @@global.performance_schema_show_processlist = @save_processlist;
Warnings:
Warning 4166 '@@performance_schema_show_processlist' is deprecated and will be removed in a future release. When it is removed, SHOW PROCESSLIST will always use the performance schema implementation.
DROP USER 'regular'@'localhost';
|