| 1 |
# Tests for PERFORMANCE_SCHEMA |
| 2 |
|
| 3 |
insert into performance_schema.setup_actors values ("host1","user1","%",'YES','YES'); |
| 4 |
insert into performance_schema.setup_actors values ("host2","user1","%",'YES','YES'); |
| 5 |
insert into performance_schema.setup_actors values ("host3","user1","%",'YES','YES'); |
| 6 |
|
| 7 |
# Test index on HOST, USER, `ROLE` |
| 8 |
|
| 9 |
--echo ############ Explain for Query #################################### |
| 10 |
--replace_column 10 # |
| 11 |
explain select HOST, USER, `ROLE` |
| 12 |
from performance_schema.setup_actors |
| 13 |
where HOST = 'host1'; |
| 14 |
|
| 15 |
--echo ############ Explain for Query #################################### |
| 16 |
--replace_column 10 # |
| 17 |
explain select * |
| 18 |
from performance_schema.setup_actors |
| 19 |
where HOST = 'host1' and USER = 'user1'; |
| 20 |
|
| 21 |
--echo ############ Explain for Query #################################### |
| 22 |
--replace_column 10 # |
| 23 |
explain select * |
| 24 |
from performance_schema.setup_actors |
| 25 |
where HOST = 'host1' and USER = 'user1' |
| 26 |
and `ROLE` = 'norole'; |
| 27 |
|
| 28 |
--echo ############ Explain for Query #################################### |
| 29 |
--replace_column 10 # |
| 30 |
explain select HOST, USER, `ROLE` |
| 31 |
from performance_schema.setup_actors |
| 32 |
where HOST = 'nohost' and USER = 'user1' |
| 33 |
and `ROLE` = '%'; |
| 34 |
|
| 35 |
--echo ############ Explain for Query #################################### |
| 36 |
--replace_column 10 # |
| 37 |
explain select HOST, USER, `ROLE` |
| 38 |
from performance_schema.setup_actors |
| 39 |
where HOST = 'host1' and USER = 'nouser' |
| 40 |
and `ROLE` = '%'; |
| 41 |
|
| 42 |
--echo ############ Explain for Query #################################### |
| 43 |
--replace_column 10 # |
| 44 |
explain select HOST, USER, `ROLE` |
| 45 |
from performance_schema.setup_actors |
| 46 |
where HOST = 'host1' and USER = 'user1' |
| 47 |
and `ROLE` = '%'; |
| 48 |
|
| 49 |
--echo ############# Explain End ######################################### |
| 50 |
|
| 51 |
flush status; |
| 52 |
|
| 53 |
select ENABLED, HISTORY |
| 54 |
from performance_schema.setup_actors |
| 55 |
where HOST = 'TBALE' and USER = 'user1' |
| 56 |
and `ROLE` = '%'; |
| 57 |
|
| 58 |
show session status like "handler_read%"; |
| 59 |
|
| 60 |
select ENABLED, HISTORY |
| 61 |
from performance_schema.setup_actors |
| 62 |
where HOST = 'host1' and USER = 'user1' |
| 63 |
and `ROLE` = '%'; |
| 64 |
|
| 65 |
show session status like "handler_read%"; |
| 66 |
|
| 67 |
delete from performance_schema.setup_actors where user = 'user1'; |