| 1 |
# Tests for PERFORMANCE_SCHEMA |
| 2 |
|
| 3 |
# Several selects so the output is readable |
| 4 |
|
| 5 |
# Note that TABLE_NAME is in uppercase is some platforms, |
| 6 |
# and in lowercase in others. |
| 7 |
# Using lower(TABLE_NAME) to have consistent results. |
| 8 |
|
| 9 |
--sorted_result |
| 10 |
select TABLE_SCHEMA, lower(TABLE_NAME), TABLE_CATALOG |
| 11 |
from information_schema.tables |
| 12 |
where TABLE_SCHEMA='performance_schema'; |
| 13 |
|
| 14 |
--sorted_result |
| 15 |
select lower(TABLE_NAME), TABLE_TYPE, ENGINE |
| 16 |
from information_schema.tables |
| 17 |
where TABLE_SCHEMA='performance_schema'; |
| 18 |
|
| 19 |
--sorted_result |
| 20 |
select lower(TABLE_NAME), VERSION, ROW_FORMAT |
| 21 |
from information_schema.tables |
| 22 |
where TABLE_SCHEMA='performance_schema'; |
| 23 |
|
| 24 |
# Query status and system variable tables separately because AVG_ROW_LENGTH |
| 25 |
# depends upon which plugins are loaded at the time of the query. |
| 26 |
# |
| 27 |
# TABLE_ROWS is unpredictable with autoscaling buffers |
| 28 |
--sorted_result |
| 29 |
select lower(TABLE_NAME), AVG_ROW_LENGTH |
| 30 |
from information_schema.tables |
| 31 |
where TABLE_SCHEMA='performance_schema' and |
| 32 |
lower(TABLE_NAME) not regexp '^variables|variables$|^status|session_status|global_status'; |
| 33 |
|
| 34 |
--sorted_result |
| 35 |
--replace_column 2 table_rows 3 avg_row_len |
| 36 |
select lower(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH |
| 37 |
from information_schema.tables |
| 38 |
where TABLE_SCHEMA='performance_schema' and |
| 39 |
lower(TABLE_NAME) regexp '^variables|variables$|^status|session_status|global_status'; |
| 40 |
|
| 41 |
--sorted_result |
| 42 |
select lower(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH |
| 43 |
from information_schema.tables |
| 44 |
where TABLE_SCHEMA='performance_schema'; |
| 45 |
|
| 46 |
--sorted_result |
| 47 |
select lower(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT |
| 48 |
from information_schema.tables |
| 49 |
where TABLE_SCHEMA='performance_schema'; |
| 50 |
|
| 51 |
--sorted_result |
| 52 |
--replace_column 2 NULL |
| 53 |
select lower(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME |
| 54 |
from information_schema.tables |
| 55 |
where TABLE_SCHEMA='performance_schema'; |
| 56 |
|
| 57 |
--sorted_result |
| 58 |
select lower(TABLE_NAME), TABLE_COLLATION, CHECKSUM |
| 59 |
from information_schema.tables |
| 60 |
where TABLE_SCHEMA='performance_schema'; |
| 61 |
|
| 62 |
# TABLESPACE_NAME does not exist in 5.4 |
| 63 |
--sorted_result |
| 64 |
select lower(TABLE_NAME), CREATE_OPTIONS |
| 65 |
from information_schema.tables |
| 66 |
where TABLE_SCHEMA='performance_schema'; |
| 67 |
|
| 68 |
--sorted_result |
| 69 |
select lower(TABLE_NAME), TABLE_COMMENT |
| 70 |
from information_schema.tables |
| 71 |
where TABLE_SCHEMA='performance_schema'; |
| 72 |
|