33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
# Tests for PERFORMANCE_SCHEMA
|
|
|
|
truncate performance_schema.status_by_account;
|
|
truncate performance_schema.status_by_host;
|
|
truncate performance_schema.status_by_user;
|
|
truncate performance_schema.status_by_thread;
|
|
|
|
let $get_thread_id=
|
|
SELECT thread_id INTO @my_thread_id
|
|
FROM performance_schema.threads
|
|
WHERE processlist_id = connection_id();
|
|
eval $get_thread_id;
|
|
CREATE USER user1@localhost;
|
|
GRANT ALL ON *.* to 'user1'@localhost;
|
|
connect(con1, localhost, user1,,);
|
|
|
|
--connection default
|
|
|
|
--replace_column 3 #
|
|
SELECT * FROM performance_schema.status_by_account WHERE user = 'user1' AND variable_name = 'Opened_tables';
|
|
|
|
--replace_column 3 #
|
|
SELECT * FROM performance_schema.status_by_host WHERE host = 'localhost' AND variable_name = 'Opened_tables';
|
|
|
|
--replace_column 3 #
|
|
SELECT * FROM performance_schema.status_by_user WHERE user = 'user1' AND variable_name = 'Opened_tables';
|
|
|
|
--replace_column 1 tid 3 #
|
|
SELECT * FROM performance_schema.status_by_thread WHERE thread_id = @my_thread_id AND variable_name = 'Opened_tables';
|
|
|
|
DROP USER user1@localhost;
|
|
--disconnect con1
|