| 1 |
--source include/have_ndb.inc |
| 2 |
|
| 3 |
# |
| 4 |
# Check that session and global status variables returned from |
| 5 |
# performance schema are properly prefixed with Ndb_(using that |
| 6 |
# exact case) and that the number of global and session status |
| 7 |
# variables match |
| 8 |
# |
| 9 |
# Expected output: |
| 10 |
# select * from performance_schema.global_status |
| 11 |
# where VARIABLE_NAME LIKE 'Ndb\_%'; |
| 12 |
# VARIABLE_NAME VARIABLE_VALUE |
| 13 |
# Ndb_api_wait_exec_complete_count 2 |
| 14 |
# Ndb_api_wait_scan_result_count 3 |
| 15 |
# Ndb_api_wait_meta_request_count 94 |
| 16 |
# ... |
| 17 |
|
| 18 |
# Count number of global ndb_ status variables(ignoring case) |
| 19 |
let $num_global_status_vars = |
| 20 |
`select count(*) from performance_schema.global_status |
| 21 |
where VARIABLE_NAME LIKE 'Ndb\_%'`; |
| 22 |
#echo num_global_status_vars: $num_global_status_vars; |
| 23 |
|
| 24 |
# Count number of global Ndb_ status variables(using case sensitive |
| 25 |
# like to find those which start with Ndb_ exactly). |
| 26 |
let $num_global_status_vars_case = |
| 27 |
`select count(*) from performance_schema.global_status |
| 28 |
where VARIABLE_NAME LIKE binary 'Ndb\_%'`; |
| 29 |
#echo num_global_status_vars_case: $num_global_status_vars_case; |
| 30 |
|
| 31 |
# Check that all variables have proper prefix Ndb_ |
| 32 |
if ($num_global_status_vars != $num_global_status_vars_case) |
| 33 |
{ |
| 34 |
die Faulty prefix of some global Ndb_ status variables; |
| 35 |
} |
| 36 |
|
| 37 |
# Count number of session ndb_ status variables(ignoring case) |
| 38 |
let $num_session_status_vars = |
| 39 |
`select count(*) from performance_schema.session_status |
| 40 |
where VARIABLE_NAME LIKE 'Ndb\_%'`; |
| 41 |
#echo num_session_status_vars: $num_session_status_vars; |
| 42 |
|
| 43 |
# Count number of session Ndb_ status variables(using case sensitive |
| 44 |
# like to find those which start with Ndb_ exactly). |
| 45 |
let $num_session_status_vars_case = |
| 46 |
`select count(*) from performance_schema.session_status |
| 47 |
where VARIABLE_NAME LIKE binary 'Ndb\_%'`; |
| 48 |
#echo num_session _status_vars_case: $num_session_status_vars_case; |
| 49 |
|
| 50 |
# Check that all variables have proper prefix Ndb_ |
| 51 |
if ($num_session_status_vars != $num_session_status_vars_case) |
| 52 |
{ |
| 53 |
die Faulty prefix of some session Ndb_ status variables; |
| 54 |
} |
| 55 |
|
| 56 |
# Check that the number of status variables match between session and global |
| 57 |
if ($num_session_status_vars != $num_global_status_vars) |
| 58 |
{ |
| 59 |
die Difference in number of sesssion and global status variables; |
| 60 |
} |
| 61 |
|
| 62 |
# Check that one arbitrary global status variable can be selected |
| 63 |
--replace_column 2 <value> |
| 64 |
select VARIABLE_NAME, VARIABLE_VALUE |
| 65 |
from performance_schema.global_status |
| 66 |
where VARIABLE_NAME = 'Ndb_sorted_scan_count'; |
| 67 |
|
| 68 |
# Check that one arbitrary session status variable can be selected |
| 69 |
--replace_column 2 <value> |
| 70 |
select VARIABLE_NAME, VARIABLE_VALUE |
| 71 |
from performance_schema.session_status |
| 72 |
where VARIABLE_NAME = 'Ndb_config_from_host'; |
| 73 |
|
| 74 |
|
| 75 |
# |
| 76 |
# Check that session and global variables returned from |
| 77 |
# performance schema are properly prefixed with ndb_(using that |
| 78 |
# exact case) and that the number of global and session variables match |
| 79 |
# |
| 80 |
# Expected output: |
| 81 |
# select * from performance_schema.global_variables |
| 82 |
# where VARIABLE_NAME LIKE 'ndb\_%'; |
| 83 |
# VARIABLE_NAME VARIABLE_VALUE |
| 84 |
# ndb_allow_copying_alter_table ON |
| 85 |
# ndb_autoincrement_prefetch_sz 1 |
| 86 |
# ... |
| 87 |
|
| 88 |
# Count number of global ndb_ status variables(ignoring case) |
| 89 |
let $num_global_variables_vars = |
| 90 |
`select count(*) from performance_schema.global_variables |
| 91 |
where VARIABLE_NAME LIKE 'ndb\_%'`; |
| 92 |
#echo num_global_variables_vars: $num_global_variables_vars; |
| 93 |
|
| 94 |
# Count number of global ndb_ variables(using case sensitive |
| 95 |
# like to find those which start with Ndb_ exactly). |
| 96 |
let $num_global_variables_vars_case = |
| 97 |
`select count(*) from performance_schema.global_variables |
| 98 |
where VARIABLE_NAME LIKE binary 'ndb\_%'`; |
| 99 |
#echo num_global_variables_vars_case: $num_global_variables_vars_case; |
| 100 |
|
| 101 |
# Check that all variables have proper prefix ndb_ |
| 102 |
if ($num_global_variables_vars != $num_global_variables_vars_case) |
| 103 |
{ |
| 104 |
die Faulty prefix of some global ndb_ variables; |
| 105 |
} |
| 106 |
|
| 107 |
# Count number of session ndb_ status variables(ignoring case) |
| 108 |
let $num_session_variables_vars = |
| 109 |
`select count(*) from performance_schema.session_variables |
| 110 |
where VARIABLE_NAME LIKE 'ndb\_%'`; |
| 111 |
#echo num_session_variables_vars: $num_session_variables_vars; |
| 112 |
|
| 113 |
# Count number of session ndb_ variables(using case sensitive |
| 114 |
# like to find those which start with ndb_ exactly). |
| 115 |
let $num_session_variables_vars_case = |
| 116 |
`select count(*) from performance_schema.session_variables |
| 117 |
where VARIABLE_NAME LIKE binary 'ndb\_%'`; |
| 118 |
#echo num_session _status_vars_case: $num_session_variables_vars_case; |
| 119 |
|
| 120 |
# Check that all variables have proper prefix ndb_ |
| 121 |
if ($num_session_variables_vars != $num_session_variables_vars_case) |
| 122 |
{ |
| 123 |
die Faulty prefix of some session ndb_ variables; |
| 124 |
} |
| 125 |
|
| 126 |
# Check that the number of status variables match between session and global |
| 127 |
if ($num_session_variables_vars != $num_global_variables_vars) |
| 128 |
{ |
| 129 |
die Difference in number of sesssion and global variables; |
| 130 |
} |
| 131 |
|
| 132 |
# Check that one arbitrary global variable can be selected |
| 133 |
--replace_column 2 <value> |
| 134 |
select VARIABLE_NAME, VARIABLE_VALUE |
| 135 |
from performance_schema.global_variables |
| 136 |
where VARIABLE_NAME = 'ndb_version_string'; |
| 137 |
|
| 138 |
# Check that one arbitrary status variable can be selected |
| 139 |
--replace_column 2 <value> |
| 140 |
select VARIABLE_NAME, VARIABLE_VALUE |
| 141 |
from performance_schema.session_variables |
| 142 |
where VARIABLE_NAME = 'ndb_nodeid'; |