| 1 |
# Tests for PERFORMANCE_SCHEMA |
| 2 |
|
| 3 |
truncate performance_schema.status_by_account; |
| 4 |
truncate performance_schema.status_by_host; |
| 5 |
truncate performance_schema.status_by_user; |
| 6 |
truncate performance_schema.status_by_thread; |
| 7 |
|
| 8 |
let $get_thread_id= |
| 9 |
SELECT thread_id INTO @my_thread_id |
| 10 |
FROM performance_schema.threads |
| 11 |
WHERE processlist_id = connection_id(); |
| 12 |
eval $get_thread_id; |
| 13 |
CREATE USER user1@localhost; |
| 14 |
GRANT ALL ON *.* to 'user1'@localhost; |
| 15 |
connect(con1, localhost, user1,,); |
| 16 |
|
| 17 |
--connection default |
| 18 |
|
| 19 |
--replace_column 3 # |
| 20 |
SELECT * FROM performance_schema.status_by_account WHERE user = 'user1' AND variable_name = 'Opened_tables'; |
| 21 |
|
| 22 |
--replace_column 3 # |
| 23 |
SELECT * FROM performance_schema.status_by_host WHERE host = 'localhost' AND variable_name = 'Opened_tables'; |
| 24 |
|
| 25 |
--replace_column 3 # |
| 26 |
SELECT * FROM performance_schema.status_by_user WHERE user = 'user1' AND variable_name = 'Opened_tables'; |
| 27 |
|
| 28 |
--replace_column 1 tid 3 # |
| 29 |
SELECT * FROM performance_schema.status_by_thread WHERE thread_id = @my_thread_id AND variable_name = 'Opened_tables'; |
| 30 |
|
| 31 |
DROP USER user1@localhost; |
| 32 |
--disconnect con1 |