| 1 |
SHOW TABLES FROM information_schema LIKE 'STATISTICS'; |
| 2 |
Tables_in_information_schema (STATISTICS) |
| 3 |
STATISTICS |
| 4 |
####################################################################### |
| 5 |
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT |
| 6 |
####################################################################### |
| 7 |
DROP VIEW IF EXISTS test.v1; |
| 8 |
DROP PROCEDURE IF EXISTS test.p1; |
| 9 |
DROP FUNCTION IF EXISTS test.f1; |
| 10 |
CREATE VIEW test.v1 AS SELECT * FROM information_schema.STATISTICS; |
| 11 |
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.STATISTICS; |
| 12 |
CREATE FUNCTION test.f1() returns BIGINT |
| 13 |
BEGIN |
| 14 |
DECLARE counter BIGINT DEFAULT NULL; |
| 15 |
SELECT COUNT(*) INTO counter FROM information_schema.STATISTICS; |
| 16 |
RETURN counter; |
| 17 |
END// |
| 18 |
# Attention: The printing of the next result sets is disabled. |
| 19 |
SELECT * FROM information_schema.STATISTICS; |
| 20 |
SELECT * FROM test.v1; |
| 21 |
CALL test.p1; |
| 22 |
SELECT test.f1(); |
| 23 |
DROP VIEW test.v1; |
| 24 |
DROP PROCEDURE test.p1; |
| 25 |
DROP FUNCTION test.f1; |
| 26 |
######################################################################### |
| 27 |
# Testcase 3.2.14.1: INFORMATION_SCHEMA.STATISTICS layout |
| 28 |
######################################################################### |
| 29 |
DESCRIBE information_schema.STATISTICS; |
| 30 |
Field Type Null Key Default Extra |
| 31 |
TABLE_CATALOG varchar(64) YES NULL |
| 32 |
TABLE_SCHEMA varchar(64) YES NULL |
| 33 |
TABLE_NAME varchar(64) YES NULL |
| 34 |
NON_UNIQUE int NO 0 |
| 35 |
INDEX_SCHEMA varchar(64) YES NULL |
| 36 |
INDEX_NAME varchar(64) YES NULL |
| 37 |
SEQ_IN_INDEX int unsigned NO NULL |
| 38 |
COLUMN_NAME varchar(64) YES NULL |
| 39 |
COLLATION varchar(1) YES NULL |
| 40 |
CARDINALITY bigint YES NULL |
| 41 |
SUB_PART bigint YES NULL |
| 42 |
PACKED binary(0) YES NULL |
| 43 |
NULLABLE varchar(3) NO |
| 44 |
INDEX_TYPE varchar(11) NO |
| 45 |
COMMENT varchar(8) NO |
| 46 |
INDEX_COMMENT varchar(2048) NO NULL |
| 47 |
IS_VISIBLE varchar(3) NO |
| 48 |
EXPRESSION longtext YES NULL |
| 49 |
SHOW CREATE TABLE information_schema.STATISTICS; |
| 50 |
View Create View character_set_client collation_connection |
| 51 |
STATISTICS CREATE ALGORITHM=UNDEFINED DEFINER=`mysql.infoschema`@`localhost` SQL SECURITY DEFINER VIEW `information_schema`.`STATISTICS` AS select (`cat`.`name` collate utf8mb3_tolower_ci) AS `TABLE_CATALOG`,(`sch`.`name` collate utf8mb3_tolower_ci) AS `TABLE_SCHEMA`,(`tbl`.`name` collate utf8mb3_tolower_ci) AS `TABLE_NAME`,if(((`idx`.`type` = 'PRIMARY') or (`idx`.`type` = 'UNIQUE')),0,1) AS `NON_UNIQUE`,(`sch`.`name` collate utf8mb3_tolower_ci) AS `INDEX_SCHEMA`,(`idx`.`name` collate utf8mb3_tolower_ci) AS `INDEX_NAME`,`icu`.`ordinal_position` AS `SEQ_IN_INDEX`,if((`col`.`hidden` = 'SQL'),NULL,(`col`.`name` collate utf8mb3_tolower_ci)) AS `COLUMN_NAME`,(case when (`icu`.`order` = 'DESC') then 'D' when (`icu`.`order` = 'ASC') then 'A' else NULL end) AS `COLLATION`,internal_index_column_cardinality(`sch`.`name`,`tbl`.`name`,`idx`.`name`,`col`.`name`,`idx`.`ordinal_position`,`icu`.`ordinal_position`,if((`tbl`.`partition_type` is null),`tbl`.`engine`,''),`tbl`.`se_private_id`,((`tbl`.`hidden` <> 'Visible') or (0 <> `idx`.`hidden`) or (0 <> `icu`.`hidden`)),coalesce(`stat`.`cardinality`,cast(-(1) as unsigned)),coalesce(cast(`stat`.`cached_time` as unsigned),0)) AS `CARDINALITY`,get_dd_index_sub_part_length(`icu`.`length`,`col`.`type`,`col`.`char_length`,`col`.`collation_id`,`idx`.`type`) AS `SUB_PART`,NULL AS `PACKED`,if((`col`.`is_nullable` = 1),'YES','') AS `NULLABLE`,(case when (`idx`.`type` = 'SPATIAL') then 'SPATIAL' when (`idx`.`algorithm` = 'SE_PRIVATE') then '' else `idx`.`algorithm` end) AS `INDEX_TYPE`,if(((`idx`.`type` = 'PRIMARY') or (`idx`.`type` = 'UNIQUE')),'',if(internal_keys_disabled(`tbl`.`options`),'disabled','')) AS `COMMENT`,`idx`.`comment` AS `INDEX_COMMENT`,if(`idx`.`is_visible`,'YES','NO') AS `IS_VISIBLE`,if((`col`.`hidden` = 'SQL'),`col`.`generation_expression_utf8`,NULL) AS `EXPRESSION` from (((((((`mysql`.`index_column_usage` `icu` join `mysql`.`indexes` `idx` on((`idx`.`id` = `icu`.`index_id`))) join `mysql`.`tables` `tbl` on((`idx`.`table_id` = `tbl`.`id`))) join `mysql`.`columns` `col` on((`icu`.`column_id` = `col`.`id`))) join `mysql`.`schemata` `sch` on((`tbl`.`schema_id` = `sch`.`id`))) join `mysql`.`catalogs` `cat` on((`cat`.`id` = `sch`.`catalog_id`))) join `mysql`.`collations` `coll` on((`tbl`.`collation_id` = `coll`.`id`))) left join `mysql`.`index_stats` `stat` on(((`tbl`.`name` = `stat`.`table_name`) and (`sch`.`name` = `stat`.`schema_name`) and (`idx`.`name` = `stat`.`index_name`) and (`col`.`name` = `stat`.`column_name`)))) where ((0 <> can_access_table(`sch`.`name`,`tbl`.`name`)) and (0 <> is_visible_dd_object(`tbl`.`hidden`,((0 <> `idx`.`hidden`) or (0 <> `icu`.`hidden`)),`idx`.`options`))) utf8mb3 utf8mb3_general_ci |
| 52 |
SHOW COLUMNS FROM information_schema.STATISTICS; |
| 53 |
Field Type Null Key Default Extra |
| 54 |
TABLE_CATALOG varchar(64) YES NULL |
| 55 |
TABLE_SCHEMA varchar(64) YES NULL |
| 56 |
TABLE_NAME varchar(64) YES NULL |
| 57 |
NON_UNIQUE int NO 0 |
| 58 |
INDEX_SCHEMA varchar(64) YES NULL |
| 59 |
INDEX_NAME varchar(64) YES NULL |
| 60 |
SEQ_IN_INDEX int unsigned NO NULL |
| 61 |
COLUMN_NAME varchar(64) YES NULL |
| 62 |
COLLATION varchar(1) YES NULL |
| 63 |
CARDINALITY bigint YES NULL |
| 64 |
SUB_PART bigint YES NULL |
| 65 |
PACKED binary(0) YES NULL |
| 66 |
NULLABLE varchar(3) NO |
| 67 |
INDEX_TYPE varchar(11) NO |
| 68 |
COMMENT varchar(8) NO |
| 69 |
INDEX_COMMENT varchar(2048) NO NULL |
| 70 |
IS_VISIBLE varchar(3) NO |
| 71 |
EXPRESSION longtext YES NULL |
| 72 |
SELECT table_catalog, table_schema, table_name, index_schema, index_name |
| 73 |
FROM information_schema.statistics WHERE table_catalog IS NOT NULL AND |
| 74 |
table_name != 'ndb_binlog_index' |
| 75 |
ORDER BY table_schema, table_name, index_schema, index_name; |
| 76 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME INDEX_SCHEMA INDEX_NAME |
| 77 |
def mtr asserted_test_suppressions mtr PRIMARY |
| 78 |
def mtr global_suppressions mtr pattern |
| 79 |
def mtr test_ignored_global_suppressions mtr PRIMARY |
| 80 |
def mysql columns_priv mysql PRIMARY |
| 81 |
def mysql columns_priv mysql PRIMARY |
| 82 |
def mysql columns_priv mysql PRIMARY |
| 83 |
def mysql columns_priv mysql PRIMARY |
| 84 |
def mysql columns_priv mysql PRIMARY |
| 85 |
def mysql component mysql PRIMARY |
| 86 |
def mysql db mysql PRIMARY |
| 87 |
def mysql db mysql PRIMARY |
| 88 |
def mysql db mysql PRIMARY |
| 89 |
def mysql db mysql User |
| 90 |
def mysql default_roles mysql PRIMARY |
| 91 |
def mysql default_roles mysql PRIMARY |
| 92 |
def mysql default_roles mysql PRIMARY |
| 93 |
def mysql default_roles mysql PRIMARY |
| 94 |
def mysql engine_cost mysql PRIMARY |
| 95 |
def mysql engine_cost mysql PRIMARY |
| 96 |
def mysql engine_cost mysql PRIMARY |
| 97 |
def mysql func mysql PRIMARY |
| 98 |
def mysql global_grants mysql PRIMARY |
| 99 |
def mysql global_grants mysql PRIMARY |
| 100 |
def mysql global_grants mysql PRIMARY |
| 101 |
def mysql gtid_executed mysql PRIMARY |
| 102 |
def mysql gtid_executed mysql PRIMARY |
| 103 |
def mysql help_category mysql PRIMARY |
| 104 |
def mysql help_category mysql name |
| 105 |
def mysql help_keyword mysql PRIMARY |
| 106 |
def mysql help_keyword mysql name |
| 107 |
def mysql help_relation mysql PRIMARY |
| 108 |
def mysql help_relation mysql PRIMARY |
| 109 |
def mysql help_topic mysql PRIMARY |
| 110 |
def mysql help_topic mysql name |
| 111 |
def mysql innodb_index_stats mysql PRIMARY |
| 112 |
def mysql innodb_index_stats mysql PRIMARY |
| 113 |
def mysql innodb_index_stats mysql PRIMARY |
| 114 |
def mysql innodb_index_stats mysql PRIMARY |
| 115 |
def mysql innodb_table_stats mysql PRIMARY |
| 116 |
def mysql innodb_table_stats mysql PRIMARY |
| 117 |
def mysql password_history mysql PRIMARY |
| 118 |
def mysql password_history mysql PRIMARY |
| 119 |
def mysql password_history mysql PRIMARY |
| 120 |
def mysql plugin mysql PRIMARY |
| 121 |
def mysql procs_priv mysql Grantor |
| 122 |
def mysql procs_priv mysql PRIMARY |
| 123 |
def mysql procs_priv mysql PRIMARY |
| 124 |
def mysql procs_priv mysql PRIMARY |
| 125 |
def mysql procs_priv mysql PRIMARY |
| 126 |
def mysql procs_priv mysql PRIMARY |
| 127 |
def mysql proxies_priv mysql Grantor |
| 128 |
def mysql proxies_priv mysql PRIMARY |
| 129 |
def mysql proxies_priv mysql PRIMARY |
| 130 |
def mysql proxies_priv mysql PRIMARY |
| 131 |
def mysql proxies_priv mysql PRIMARY |
| 132 |
def mysql replication_asynchronous_connection_failover mysql Channel_name |
| 133 |
def mysql replication_asynchronous_connection_failover mysql Channel_name |
| 134 |
def mysql replication_asynchronous_connection_failover mysql PRIMARY |
| 135 |
def mysql replication_asynchronous_connection_failover mysql PRIMARY |
| 136 |
def mysql replication_asynchronous_connection_failover mysql PRIMARY |
| 137 |
def mysql replication_asynchronous_connection_failover mysql PRIMARY |
| 138 |
def mysql replication_asynchronous_connection_failover mysql PRIMARY |
| 139 |
def mysql replication_asynchronous_connection_failover_managed mysql PRIMARY |
| 140 |
def mysql replication_asynchronous_connection_failover_managed mysql PRIMARY |
| 141 |
def mysql replication_group_configuration_version mysql PRIMARY |
| 142 |
def mysql replication_group_member_actions mysql PRIMARY |
| 143 |
def mysql replication_group_member_actions mysql PRIMARY |
| 144 |
def mysql replication_group_member_actions mysql event |
| 145 |
def mysql role_edges mysql PRIMARY |
| 146 |
def mysql role_edges mysql PRIMARY |
| 147 |
def mysql role_edges mysql PRIMARY |
| 148 |
def mysql role_edges mysql PRIMARY |
| 149 |
def mysql server_cost mysql PRIMARY |
| 150 |
def mysql servers mysql PRIMARY |
| 151 |
def mysql slave_master_info mysql PRIMARY |
| 152 |
def mysql slave_relay_log_info mysql PRIMARY |
| 153 |
def mysql slave_worker_info mysql PRIMARY |
| 154 |
def mysql slave_worker_info mysql PRIMARY |
| 155 |
def mysql tables_priv mysql Grantor |
| 156 |
def mysql tables_priv mysql PRIMARY |
| 157 |
def mysql tables_priv mysql PRIMARY |
| 158 |
def mysql tables_priv mysql PRIMARY |
| 159 |
def mysql tables_priv mysql PRIMARY |
| 160 |
def mysql time_zone mysql PRIMARY |
| 161 |
def mysql time_zone_leap_second mysql PRIMARY |
| 162 |
def mysql time_zone_name mysql PRIMARY |
| 163 |
def mysql time_zone_transition mysql PRIMARY |
| 164 |
def mysql time_zone_transition mysql PRIMARY |
| 165 |
def mysql time_zone_transition_type mysql PRIMARY |
| 166 |
def mysql time_zone_transition_type mysql PRIMARY |
| 167 |
def mysql user mysql PRIMARY |
| 168 |
def mysql user mysql PRIMARY |
| 169 |
def performance_schema accounts performance_schema ACCOUNT |
| 170 |
def performance_schema accounts performance_schema ACCOUNT |
| 171 |
def performance_schema cond_instances performance_schema NAME |
| 172 |
def performance_schema cond_instances performance_schema PRIMARY |
| 173 |
def performance_schema data_lock_waits performance_schema BLOCKING_ENGINE_LOCK_ID |
| 174 |
def performance_schema data_lock_waits performance_schema BLOCKING_ENGINE_LOCK_ID |
| 175 |
def performance_schema data_lock_waits performance_schema BLOCKING_ENGINE_TRANSACTION_ID |
| 176 |
def performance_schema data_lock_waits performance_schema BLOCKING_ENGINE_TRANSACTION_ID |
| 177 |
def performance_schema data_lock_waits performance_schema BLOCKING_THREAD_ID |
| 178 |
def performance_schema data_lock_waits performance_schema BLOCKING_THREAD_ID |
| 179 |
def performance_schema data_lock_waits performance_schema PRIMARY |
| 180 |
def performance_schema data_lock_waits performance_schema PRIMARY |
| 181 |
def performance_schema data_lock_waits performance_schema PRIMARY |
| 182 |
def performance_schema data_lock_waits performance_schema REQUESTING_ENGINE_LOCK_ID |
| 183 |
def performance_schema data_lock_waits performance_schema REQUESTING_ENGINE_LOCK_ID |
| 184 |
def performance_schema data_lock_waits performance_schema REQUESTING_ENGINE_TRANSACTION_ID |
| 185 |
def performance_schema data_lock_waits performance_schema REQUESTING_ENGINE_TRANSACTION_ID |
| 186 |
def performance_schema data_lock_waits performance_schema REQUESTING_THREAD_ID |
| 187 |
def performance_schema data_lock_waits performance_schema REQUESTING_THREAD_ID |
| 188 |
def performance_schema data_locks performance_schema ENGINE_TRANSACTION_ID |
| 189 |
def performance_schema data_locks performance_schema ENGINE_TRANSACTION_ID |
| 190 |
def performance_schema data_locks performance_schema OBJECT_SCHEMA |
| 191 |
def performance_schema data_locks performance_schema OBJECT_SCHEMA |
| 192 |
def performance_schema data_locks performance_schema OBJECT_SCHEMA |
| 193 |
def performance_schema data_locks performance_schema OBJECT_SCHEMA |
| 194 |
def performance_schema data_locks performance_schema PRIMARY |
| 195 |
def performance_schema data_locks performance_schema PRIMARY |
| 196 |
def performance_schema data_locks performance_schema THREAD_ID |
| 197 |
def performance_schema data_locks performance_schema THREAD_ID |
| 198 |
def performance_schema error_log performance_schema ERROR_CODE |
| 199 |
def performance_schema error_log performance_schema PRIMARY |
| 200 |
def performance_schema error_log performance_schema PRIO |
| 201 |
def performance_schema error_log performance_schema SUBSYSTEM |
| 202 |
def performance_schema error_log performance_schema THREAD_ID |
| 203 |
def performance_schema events_errors_summary_by_account_by_error performance_schema ACCOUNT |
| 204 |
def performance_schema events_errors_summary_by_account_by_error performance_schema ACCOUNT |
| 205 |
def performance_schema events_errors_summary_by_account_by_error performance_schema ACCOUNT |
| 206 |
def performance_schema events_errors_summary_by_host_by_error performance_schema HOST |
| 207 |
def performance_schema events_errors_summary_by_host_by_error performance_schema HOST |
| 208 |
def performance_schema events_errors_summary_by_thread_by_error performance_schema THREAD_ID |
| 209 |
def performance_schema events_errors_summary_by_thread_by_error performance_schema THREAD_ID |
| 210 |
def performance_schema events_errors_summary_by_user_by_error performance_schema USER |
| 211 |
def performance_schema events_errors_summary_by_user_by_error performance_schema USER |
| 212 |
def performance_schema events_errors_summary_global_by_error performance_schema ERROR_NUMBER |
| 213 |
def performance_schema events_stages_current performance_schema PRIMARY |
| 214 |
def performance_schema events_stages_current performance_schema PRIMARY |
| 215 |
def performance_schema events_stages_history performance_schema PRIMARY |
| 216 |
def performance_schema events_stages_history performance_schema PRIMARY |
| 217 |
def performance_schema events_stages_summary_by_account_by_event_name performance_schema ACCOUNT |
| 218 |
def performance_schema events_stages_summary_by_account_by_event_name performance_schema ACCOUNT |
| 219 |
def performance_schema events_stages_summary_by_account_by_event_name performance_schema ACCOUNT |
| 220 |
def performance_schema events_stages_summary_by_host_by_event_name performance_schema HOST |
| 221 |
def performance_schema events_stages_summary_by_host_by_event_name performance_schema HOST |
| 222 |
def performance_schema events_stages_summary_by_thread_by_event_name performance_schema PRIMARY |
| 223 |
def performance_schema events_stages_summary_by_thread_by_event_name performance_schema PRIMARY |
| 224 |
def performance_schema events_stages_summary_by_user_by_event_name performance_schema USER |
| 225 |
def performance_schema events_stages_summary_by_user_by_event_name performance_schema USER |
| 226 |
def performance_schema events_stages_summary_global_by_event_name performance_schema PRIMARY |
| 227 |
def performance_schema events_statements_current performance_schema PRIMARY |
| 228 |
def performance_schema events_statements_current performance_schema PRIMARY |
| 229 |
def performance_schema events_statements_histogram_by_digest performance_schema SCHEMA_NAME |
| 230 |
def performance_schema events_statements_histogram_by_digest performance_schema SCHEMA_NAME |
| 231 |
def performance_schema events_statements_histogram_by_digest performance_schema SCHEMA_NAME |
| 232 |
def performance_schema events_statements_histogram_global performance_schema PRIMARY |
| 233 |
def performance_schema events_statements_history performance_schema PRIMARY |
| 234 |
def performance_schema events_statements_history performance_schema PRIMARY |
| 235 |
def performance_schema events_statements_summary_by_account_by_event_name performance_schema ACCOUNT |
| 236 |
def performance_schema events_statements_summary_by_account_by_event_name performance_schema ACCOUNT |
| 237 |
def performance_schema events_statements_summary_by_account_by_event_name performance_schema ACCOUNT |
| 238 |
def performance_schema events_statements_summary_by_digest performance_schema SCHEMA_NAME |
| 239 |
def performance_schema events_statements_summary_by_digest performance_schema SCHEMA_NAME |
| 240 |
def performance_schema events_statements_summary_by_host_by_event_name performance_schema HOST |
| 241 |
def performance_schema events_statements_summary_by_host_by_event_name performance_schema HOST |
| 242 |
def performance_schema events_statements_summary_by_program performance_schema PRIMARY |
| 243 |
def performance_schema events_statements_summary_by_program performance_schema PRIMARY |
| 244 |
def performance_schema events_statements_summary_by_program performance_schema PRIMARY |
| 245 |
def performance_schema events_statements_summary_by_thread_by_event_name performance_schema PRIMARY |
| 246 |
def performance_schema events_statements_summary_by_thread_by_event_name performance_schema PRIMARY |
| 247 |
def performance_schema events_statements_summary_by_user_by_event_name performance_schema USER |
| 248 |
def performance_schema events_statements_summary_by_user_by_event_name performance_schema USER |
| 249 |
def performance_schema events_statements_summary_global_by_event_name performance_schema PRIMARY |
| 250 |
def performance_schema events_transactions_current performance_schema PRIMARY |
| 251 |
def performance_schema events_transactions_current performance_schema PRIMARY |
| 252 |
def performance_schema events_transactions_history performance_schema PRIMARY |
| 253 |
def performance_schema events_transactions_history performance_schema PRIMARY |
| 254 |
def performance_schema events_transactions_summary_by_account_by_event_name performance_schema ACCOUNT |
| 255 |
def performance_schema events_transactions_summary_by_account_by_event_name performance_schema ACCOUNT |
| 256 |
def performance_schema events_transactions_summary_by_account_by_event_name performance_schema ACCOUNT |
| 257 |
def performance_schema events_transactions_summary_by_host_by_event_name performance_schema HOST |
| 258 |
def performance_schema events_transactions_summary_by_host_by_event_name performance_schema HOST |
| 259 |
def performance_schema events_transactions_summary_by_thread_by_event_name performance_schema PRIMARY |
| 260 |
def performance_schema events_transactions_summary_by_thread_by_event_name performance_schema PRIMARY |
| 261 |
def performance_schema events_transactions_summary_by_user_by_event_name performance_schema USER |
| 262 |
def performance_schema events_transactions_summary_by_user_by_event_name performance_schema USER |
| 263 |
def performance_schema events_transactions_summary_global_by_event_name performance_schema PRIMARY |
| 264 |
def performance_schema events_waits_current performance_schema PRIMARY |
| 265 |
def performance_schema events_waits_current performance_schema PRIMARY |
| 266 |
def performance_schema events_waits_history performance_schema PRIMARY |
| 267 |
def performance_schema events_waits_history performance_schema PRIMARY |
| 268 |
def performance_schema events_waits_summary_by_account_by_event_name performance_schema ACCOUNT |
| 269 |
def performance_schema events_waits_summary_by_account_by_event_name performance_schema ACCOUNT |
| 270 |
def performance_schema events_waits_summary_by_account_by_event_name performance_schema ACCOUNT |
| 271 |
def performance_schema events_waits_summary_by_host_by_event_name performance_schema HOST |
| 272 |
def performance_schema events_waits_summary_by_host_by_event_name performance_schema HOST |
| 273 |
def performance_schema events_waits_summary_by_instance performance_schema EVENT_NAME |
| 274 |
def performance_schema events_waits_summary_by_instance performance_schema PRIMARY |
| 275 |
def performance_schema events_waits_summary_by_thread_by_event_name performance_schema PRIMARY |
| 276 |
def performance_schema events_waits_summary_by_thread_by_event_name performance_schema PRIMARY |
| 277 |
def performance_schema events_waits_summary_by_user_by_event_name performance_schema USER |
| 278 |
def performance_schema events_waits_summary_by_user_by_event_name performance_schema USER |
| 279 |
def performance_schema events_waits_summary_global_by_event_name performance_schema PRIMARY |
| 280 |
def performance_schema file_instances performance_schema EVENT_NAME |
| 281 |
def performance_schema file_instances performance_schema PRIMARY |
| 282 |
def performance_schema file_summary_by_event_name performance_schema PRIMARY |
| 283 |
def performance_schema file_summary_by_instance performance_schema EVENT_NAME |
| 284 |
def performance_schema file_summary_by_instance performance_schema FILE_NAME |
| 285 |
def performance_schema file_summary_by_instance performance_schema PRIMARY |
| 286 |
def performance_schema global_status performance_schema PRIMARY |
| 287 |
def performance_schema global_variables performance_schema PRIMARY |
| 288 |
def performance_schema host_cache performance_schema HOST |
| 289 |
def performance_schema host_cache performance_schema PRIMARY |
| 290 |
def performance_schema hosts performance_schema HOST |
| 291 |
def performance_schema memory_summary_by_account_by_event_name performance_schema ACCOUNT |
| 292 |
def performance_schema memory_summary_by_account_by_event_name performance_schema ACCOUNT |
| 293 |
def performance_schema memory_summary_by_account_by_event_name performance_schema ACCOUNT |
| 294 |
def performance_schema memory_summary_by_host_by_event_name performance_schema HOST |
| 295 |
def performance_schema memory_summary_by_host_by_event_name performance_schema HOST |
| 296 |
def performance_schema memory_summary_by_thread_by_event_name performance_schema PRIMARY |
| 297 |
def performance_schema memory_summary_by_thread_by_event_name performance_schema PRIMARY |
| 298 |
def performance_schema memory_summary_by_user_by_event_name performance_schema USER |
| 299 |
def performance_schema memory_summary_by_user_by_event_name performance_schema USER |
| 300 |
def performance_schema memory_summary_global_by_event_name performance_schema PRIMARY |
| 301 |
def performance_schema metadata_locks performance_schema OBJECT_TYPE |
| 302 |
def performance_schema metadata_locks performance_schema OBJECT_TYPE |
| 303 |
def performance_schema metadata_locks performance_schema OBJECT_TYPE |
| 304 |
def performance_schema metadata_locks performance_schema OBJECT_TYPE |
| 305 |
def performance_schema metadata_locks performance_schema OWNER_THREAD_ID |
| 306 |
def performance_schema metadata_locks performance_schema OWNER_THREAD_ID |
| 307 |
def performance_schema metadata_locks performance_schema PRIMARY |
| 308 |
def performance_schema mutex_instances performance_schema LOCKED_BY_THREAD_ID |
| 309 |
def performance_schema mutex_instances performance_schema NAME |
| 310 |
def performance_schema mutex_instances performance_schema PRIMARY |
| 311 |
def performance_schema objects_summary_global_by_type performance_schema OBJECT |
| 312 |
def performance_schema objects_summary_global_by_type performance_schema OBJECT |
| 313 |
def performance_schema objects_summary_global_by_type performance_schema OBJECT |
| 314 |
def performance_schema persisted_variables performance_schema PRIMARY |
| 315 |
def performance_schema prepared_statements_instances performance_schema OWNER_OBJECT_TYPE |
| 316 |
def performance_schema prepared_statements_instances performance_schema OWNER_OBJECT_TYPE |
| 317 |
def performance_schema prepared_statements_instances performance_schema OWNER_OBJECT_TYPE |
| 318 |
def performance_schema prepared_statements_instances performance_schema OWNER_THREAD_ID |
| 319 |
def performance_schema prepared_statements_instances performance_schema OWNER_THREAD_ID |
| 320 |
def performance_schema prepared_statements_instances performance_schema PRIMARY |
| 321 |
def performance_schema prepared_statements_instances performance_schema STATEMENT_ID |
| 322 |
def performance_schema prepared_statements_instances performance_schema STATEMENT_NAME |
| 323 |
def performance_schema processlist performance_schema PRIMARY |
| 324 |
def performance_schema replication_applier_configuration performance_schema PRIMARY |
| 325 |
def performance_schema replication_applier_status performance_schema PRIMARY |
| 326 |
def performance_schema replication_applier_status_by_coordinator performance_schema PRIMARY |
| 327 |
def performance_schema replication_applier_status_by_coordinator performance_schema THREAD_ID |
| 328 |
def performance_schema replication_applier_status_by_worker performance_schema PRIMARY |
| 329 |
def performance_schema replication_applier_status_by_worker performance_schema PRIMARY |
| 330 |
def performance_schema replication_applier_status_by_worker performance_schema THREAD_ID |
| 331 |
def performance_schema replication_connection_configuration performance_schema PRIMARY |
| 332 |
def performance_schema replication_connection_status performance_schema PRIMARY |
| 333 |
def performance_schema replication_connection_status performance_schema THREAD_ID |
| 334 |
def performance_schema rwlock_instances performance_schema NAME |
| 335 |
def performance_schema rwlock_instances performance_schema PRIMARY |
| 336 |
def performance_schema rwlock_instances performance_schema WRITE_LOCKED_BY_THREAD_ID |
| 337 |
def performance_schema session_account_connect_attrs performance_schema PRIMARY |
| 338 |
def performance_schema session_account_connect_attrs performance_schema PRIMARY |
| 339 |
def performance_schema session_connect_attrs performance_schema PRIMARY |
| 340 |
def performance_schema session_connect_attrs performance_schema PRIMARY |
| 341 |
def performance_schema session_status performance_schema PRIMARY |
| 342 |
def performance_schema session_variables performance_schema PRIMARY |
| 343 |
def performance_schema setup_actors performance_schema PRIMARY |
| 344 |
def performance_schema setup_actors performance_schema PRIMARY |
| 345 |
def performance_schema setup_actors performance_schema PRIMARY |
| 346 |
def performance_schema setup_consumers performance_schema PRIMARY |
| 347 |
def performance_schema setup_instruments performance_schema PRIMARY |
| 348 |
def performance_schema setup_objects performance_schema OBJECT |
| 349 |
def performance_schema setup_objects performance_schema OBJECT |
| 350 |
def performance_schema setup_objects performance_schema OBJECT |
| 351 |
def performance_schema setup_threads performance_schema PRIMARY |
| 352 |
def performance_schema socket_instances performance_schema IP |
| 353 |
def performance_schema socket_instances performance_schema IP |
| 354 |
def performance_schema socket_instances performance_schema PRIMARY |
| 355 |
def performance_schema socket_instances performance_schema SOCKET_ID |
| 356 |
def performance_schema socket_instances performance_schema THREAD_ID |
| 357 |
def performance_schema socket_summary_by_event_name performance_schema PRIMARY |
| 358 |
def performance_schema socket_summary_by_instance performance_schema EVENT_NAME |
| 359 |
def performance_schema socket_summary_by_instance performance_schema PRIMARY |
| 360 |
def performance_schema status_by_account performance_schema ACCOUNT |
| 361 |
def performance_schema status_by_account performance_schema ACCOUNT |
| 362 |
def performance_schema status_by_account performance_schema ACCOUNT |
| 363 |
def performance_schema status_by_host performance_schema HOST |
| 364 |
def performance_schema status_by_host performance_schema HOST |
| 365 |
def performance_schema status_by_thread performance_schema PRIMARY |
| 366 |
def performance_schema status_by_thread performance_schema PRIMARY |
| 367 |
def performance_schema status_by_user performance_schema USER |
| 368 |
def performance_schema status_by_user performance_schema USER |
| 369 |
def performance_schema table_handles performance_schema OBJECT_TYPE |
| 370 |
def performance_schema table_handles performance_schema OBJECT_TYPE |
| 371 |
def performance_schema table_handles performance_schema OBJECT_TYPE |
| 372 |
def performance_schema table_handles performance_schema OWNER_THREAD_ID |
| 373 |
def performance_schema table_handles performance_schema OWNER_THREAD_ID |
| 374 |
def performance_schema table_handles performance_schema PRIMARY |
| 375 |
def performance_schema table_io_waits_summary_by_index_usage performance_schema OBJECT |
| 376 |
def performance_schema table_io_waits_summary_by_index_usage performance_schema OBJECT |
| 377 |
def performance_schema table_io_waits_summary_by_index_usage performance_schema OBJECT |
| 378 |
def performance_schema table_io_waits_summary_by_index_usage performance_schema OBJECT |
| 379 |
def performance_schema table_io_waits_summary_by_table performance_schema OBJECT |
| 380 |
def performance_schema table_io_waits_summary_by_table performance_schema OBJECT |
| 381 |
def performance_schema table_io_waits_summary_by_table performance_schema OBJECT |
| 382 |
def performance_schema table_lock_waits_summary_by_table performance_schema OBJECT |
| 383 |
def performance_schema table_lock_waits_summary_by_table performance_schema OBJECT |
| 384 |
def performance_schema table_lock_waits_summary_by_table performance_schema OBJECT |
| 385 |
def performance_schema threads performance_schema NAME |
| 386 |
def performance_schema threads performance_schema PRIMARY |
| 387 |
def performance_schema threads performance_schema PROCESSLIST_ACCOUNT |
| 388 |
def performance_schema threads performance_schema PROCESSLIST_ACCOUNT |
| 389 |
def performance_schema threads performance_schema PROCESSLIST_HOST |
| 390 |
def performance_schema threads performance_schema PROCESSLIST_ID |
| 391 |
def performance_schema threads performance_schema RESOURCE_GROUP |
| 392 |
def performance_schema threads performance_schema THREAD_OS_ID |
| 393 |
def performance_schema user_defined_functions performance_schema PRIMARY |
| 394 |
def performance_schema user_variables_by_thread performance_schema PRIMARY |
| 395 |
def performance_schema user_variables_by_thread performance_schema PRIMARY |
| 396 |
def performance_schema users performance_schema USER |
| 397 |
def performance_schema variables_by_thread performance_schema PRIMARY |
| 398 |
def performance_schema variables_by_thread performance_schema PRIMARY |
| 399 |
def sys sys_config sys PRIMARY |
| 400 |
#################################################################################### |
| 401 |
# Testcase 3.2.14.2 + 3.2.14.3: INFORMATION_SCHEMA.STATISTICS accessible information |
| 402 |
#################################################################################### |
| 403 |
DROP DATABASE IF EXISTS db_datadict; |
| 404 |
DROP DATABASE IF EXISTS db_datadict_2; |
| 405 |
CREATE DATABASE db_datadict; |
| 406 |
CREATE DATABASE db_datadict_2; |
| 407 |
DROP USER 'testuser1'@'localhost'; |
| 408 |
CREATE USER 'testuser1'@'localhost'; |
| 409 |
DROP USER 'testuser2'@'localhost'; |
| 410 |
CREATE USER 'testuser2'@'localhost'; |
| 411 |
CREATE TABLE db_datadict.t1 |
| 412 |
(f1 INT NOT NULL, PRIMARY KEY(f1), f2 INT, INDEX f2_ind(f2)) |
| 413 |
ENGINE = <engine_type>; |
| 414 |
CREATE TABLE db_datadict.t2 |
| 415 |
(f1 INT NOT NULL, PRIMARY KEY(f1), f2 INT, INDEX f2_ind(f2)) |
| 416 |
ENGINE = <engine_type>; |
| 417 |
CREATE TABLE db_datadict_2.t3 |
| 418 |
(f1 INT NOT NULL, f2 INT, f5 DATE, |
| 419 |
PRIMARY KEY(f1), INDEX f2f1_ind(f2,f1), UNIQUE(f5)) |
| 420 |
ENGINE = InnoDB; |
| 421 |
CREATE TABLE db_datadict_2.t4 |
| 422 |
(f1 INT NOT NULL, PRIMARY KEY(f1), f2 INT, INDEX f2_ind(f2)) |
| 423 |
ENGINE = InnoDB; |
| 424 |
SELECT * FROM information_schema.statistics |
| 425 |
WHERE table_schema LIKE 'db_datadict%' |
| 426 |
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name; |
| 427 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT IS_VISIBLE EXPRESSION |
| 428 |
def db_datadict t1 1 db_datadict f2_ind 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 429 |
def db_datadict t1 0 db_datadict PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 430 |
def db_datadict t2 1 db_datadict f2_ind 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 431 |
def db_datadict t2 0 db_datadict PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 432 |
def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 433 |
def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 A 0 NULL NULL BTREE YES NULL |
| 434 |
def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 A 0 NULL NULL YES BTREE YES NULL |
| 435 |
def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 436 |
def db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 437 |
def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 438 |
SHOW GRANTS FOR 'testuser1'@'localhost'; |
| 439 |
Grants for testuser1@localhost |
| 440 |
GRANT USAGE ON *.* TO `testuser1`@`localhost` |
| 441 |
SHOW GRANTS FOR 'testuser2'@'localhost'; |
| 442 |
Grants for testuser2@localhost |
| 443 |
GRANT USAGE ON *.* TO `testuser2`@`localhost` |
| 444 |
# Establish connection testuser1 (user=testuser1) |
| 445 |
SELECT * FROM information_schema.statistics |
| 446 |
WHERE table_schema LIKE 'db_datadict%' |
| 447 |
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name; |
| 448 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT IS_VISIBLE EXPRESSION |
| 449 |
SHOW GRANTS FOR 'testuser1'@'localhost'; |
| 450 |
Grants for testuser1@localhost |
| 451 |
GRANT USAGE ON *.* TO `testuser1`@`localhost` |
| 452 |
SHOW GRANTS FOR 'testuser2'@'localhost'; |
| 453 |
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user' |
| 454 |
# Establish connection testuser2 (user=testuser2) |
| 455 |
SELECT * FROM information_schema.statistics |
| 456 |
WHERE table_schema LIKE 'db_datadict%' |
| 457 |
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name; |
| 458 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT IS_VISIBLE EXPRESSION |
| 459 |
SHOW GRANTS FOR 'testuser1'@'localhost'; |
| 460 |
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'user' |
| 461 |
SHOW GRANTS FOR 'testuser2'@'localhost'; |
| 462 |
Grants for testuser2@localhost |
| 463 |
GRANT USAGE ON *.* TO `testuser2`@`localhost` |
| 464 |
# Switch to connection default |
| 465 |
GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost' WITH GRANT OPTION; |
| 466 |
GRANT SELECT(f1,f5) ON db_datadict_2.t3 TO 'testuser1'@'localhost'; |
| 467 |
SELECT * FROM information_schema.statistics |
| 468 |
WHERE table_schema LIKE 'db_datadict%' |
| 469 |
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name; |
| 470 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT IS_VISIBLE EXPRESSION |
| 471 |
def db_datadict t1 1 db_datadict f2_ind 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 472 |
def db_datadict t1 0 db_datadict PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 473 |
def db_datadict t2 1 db_datadict f2_ind 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 474 |
def db_datadict t2 0 db_datadict PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 475 |
def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 476 |
def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 A 0 NULL NULL BTREE YES NULL |
| 477 |
def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 A 0 NULL NULL YES BTREE YES NULL |
| 478 |
def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 479 |
def db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 480 |
def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 481 |
SHOW GRANTS FOR 'testuser1'@'localhost'; |
| 482 |
Grants for testuser1@localhost |
| 483 |
GRANT SELECT (`f1`, `f5`) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost` |
| 484 |
GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION |
| 485 |
GRANT USAGE ON *.* TO `testuser1`@`localhost` |
| 486 |
SHOW GRANTS FOR 'testuser2'@'localhost'; |
| 487 |
Grants for testuser2@localhost |
| 488 |
GRANT USAGE ON *.* TO `testuser2`@`localhost` |
| 489 |
# Switch to connection testuser1 |
| 490 |
SELECT * FROM information_schema.statistics |
| 491 |
WHERE table_schema LIKE 'db_datadict%' |
| 492 |
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name; |
| 493 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT IS_VISIBLE EXPRESSION |
| 494 |
def db_datadict t1 1 db_datadict f2_ind 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 495 |
def db_datadict t1 0 db_datadict PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 496 |
def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 497 |
def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 A 0 NULL NULL BTREE YES NULL |
| 498 |
def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 A 0 NULL NULL YES BTREE YES NULL |
| 499 |
def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 500 |
SHOW GRANTS FOR 'testuser1'@'localhost'; |
| 501 |
Grants for testuser1@localhost |
| 502 |
GRANT SELECT (`f1`, `f5`) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost` |
| 503 |
GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION |
| 504 |
GRANT USAGE ON *.* TO `testuser1`@`localhost` |
| 505 |
SHOW GRANTS FOR 'testuser2'@'localhost'; |
| 506 |
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user' |
| 507 |
# Switch to connection testuser2 |
| 508 |
SELECT * FROM information_schema.statistics |
| 509 |
WHERE table_schema LIKE 'db_datadict%' |
| 510 |
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name; |
| 511 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT IS_VISIBLE EXPRESSION |
| 512 |
SHOW GRANTS FOR 'testuser1'@'localhost'; |
| 513 |
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'user' |
| 514 |
SHOW GRANTS FOR 'testuser2'@'localhost'; |
| 515 |
Grants for testuser2@localhost |
| 516 |
GRANT USAGE ON *.* TO `testuser2`@`localhost` |
| 517 |
# Switch to connection default |
| 518 |
REVOKE SELECT,GRANT OPTION ON db_datadict.t1 FROM 'testuser1'@'localhost'; |
| 519 |
SHOW GRANTS FOR 'testuser1'@'localhost'; |
| 520 |
Grants for testuser1@localhost |
| 521 |
GRANT SELECT (`f1`, `f5`) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost` |
| 522 |
GRANT USAGE ON *.* TO `testuser1`@`localhost` |
| 523 |
# Switch to connection testuser1 |
| 524 |
SELECT * FROM information_schema.statistics |
| 525 |
WHERE table_schema LIKE 'db_datadict%' |
| 526 |
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name; |
| 527 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT IS_VISIBLE EXPRESSION |
| 528 |
def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 529 |
def db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 A 0 NULL NULL BTREE YES NULL |
| 530 |
def db_datadict_2 t3 0 db_datadict_2 f5 1 f5 A 0 NULL NULL YES BTREE YES NULL |
| 531 |
def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 532 |
SHOW GRANTS FOR 'testuser1'@'localhost'; |
| 533 |
Grants for testuser1@localhost |
| 534 |
GRANT SELECT (`f1`, `f5`) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost` |
| 535 |
GRANT USAGE ON *.* TO `testuser1`@`localhost` |
| 536 |
# Switch to connection default and close connections testuser1, testuser2 |
| 537 |
DROP USER 'testuser1'@'localhost'; |
| 538 |
DROP USER 'testuser2'@'localhost'; |
| 539 |
DROP DATABASE db_datadict; |
| 540 |
DROP DATABASE db_datadict_2; |
| 541 |
######################################################################### |
| 542 |
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.STATISTICS modifications |
| 543 |
######################################################################### |
| 544 |
DROP TABLE IF EXISTS test.t1_my_table; |
| 545 |
DROP DATABASE IF EXISTS db_datadict; |
| 546 |
CREATE DATABASE db_datadict; |
| 547 |
CREATE TABLE test.t1_1 (f1 BIGINT, |
| 548 |
f2 TEXT, f2x TEXT, f3 CHAR(10), f3x CHAR(10), f4 BIGINT, f4x BIGINT, |
| 549 |
f5 POINT, f5x POINT NOT NULL) |
| 550 |
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci |
| 551 |
ENGINE = <other_engine_type>; |
| 552 |
CREATE TABLE test.t1_2 (f1 BIGINT, f2 BIGINT) |
| 553 |
ENGINE = <engine_type>; |
| 554 |
SELECT table_name FROM information_schema.statistics |
| 555 |
WHERE table_name LIKE 't1_%'; |
| 556 |
TABLE_NAME |
| 557 |
ALTER TABLE test.t1_1 ADD PRIMARY KEY (f1,f3); |
| 558 |
SELECT * FROM information_schema.statistics |
| 559 |
WHERE table_name LIKE 't1_%' |
| 560 |
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name; |
| 561 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT IS_VISIBLE EXPRESSION |
| 562 |
def test t1_1 0 test PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 563 |
def test t1_1 0 test PRIMARY 2 f3 A 0 NULL NULL BTREE YES NULL |
| 564 |
ALTER TABLE test.t1_1 DROP PRIMARY KEY; |
| 565 |
SELECT table_name FROM information_schema.statistics |
| 566 |
WHERE table_name LIKE 't1_%'; |
| 567 |
TABLE_NAME |
| 568 |
ALTER TABLE test.t1_1 ADD PRIMARY KEY (f1); |
| 569 |
SELECT * FROM information_schema.statistics |
| 570 |
WHERE table_name LIKE 't1_%'; |
| 571 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT IS_VISIBLE EXPRESSION |
| 572 |
def test t1_1 0 test PRIMARY 1 f1 A 0 NULL NULL BTREE YES NULL |
| 573 |
ALTER TABLE test.t1_1 ADD INDEX (f4); |
| 574 |
CREATE INDEX f3_f1 ON test.t1_1 (f3,f1); |
| 575 |
CREATE UNIQUE INDEX f4x_uni ON test.t1_1 (f4x); |
| 576 |
CREATE INDEX f2_hash USING HASH ON test.t1_2 (f2); |
| 577 |
Warnings: |
| 578 |
Note 3502 This storage engine does not support the HASH index algorithm, storage engine default was used instead. |
| 579 |
CREATE INDEX f1_idx ON test.t1_2 (f1) COMMENT = 'COMMENT'; |
| 580 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'COMMENT'' at line 1 |
| 581 |
CREATE INDEX not_null ON test.t1_1 (f3x); |
| 582 |
CREATE INDEX f2_prefix ON test.t1_1 (f2(20)); |
| 583 |
SELECT * FROM information_schema.statistics |
| 584 |
WHERE table_name LIKE 't1_%' AND index_name <> 'PRIMARY' |
| 585 |
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name; |
| 586 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT IS_VISIBLE EXPRESSION |
| 587 |
def test t1_1 1 test f2_prefix 1 f2 A 0 20 NULL YES BTREE YES NULL |
| 588 |
def test t1_1 1 test f3_f1 1 f3 A 0 NULL NULL BTREE YES NULL |
| 589 |
def test t1_1 1 test f3_f1 2 f1 A 0 NULL NULL BTREE YES NULL |
| 590 |
def test t1_1 1 test f4 1 f4 A 0 NULL NULL YES BTREE YES NULL |
| 591 |
def test t1_1 0 test f4x_uni 1 f4x A 0 NULL NULL YES BTREE YES NULL |
| 592 |
def test t1_1 1 test not_null 1 f3x A 0 NULL NULL YES BTREE YES NULL |
| 593 |
def test t1_2 1 test f2_hash 1 f2 A 0 NULL NULL YES BTREE YES NULL |
| 594 |
DROP TABLE test.t1_2; |
| 595 |
SELECT DISTINCT table_name FROM information_schema.statistics |
| 596 |
WHERE table_name = 't1_1'; |
| 597 |
TABLE_NAME |
| 598 |
t1_1 |
| 599 |
RENAME TABLE test.t1_1 TO test.t1_1x; |
| 600 |
SELECT DISTINCT table_name FROM information_schema.statistics |
| 601 |
WHERE table_name = 't1_1x'; |
| 602 |
TABLE_NAME |
| 603 |
t1_1x |
| 604 |
SELECT DISTINCT table_schema,table_name FROM information_schema.statistics |
| 605 |
WHERE table_name LIKE 't1_1%'; |
| 606 |
TABLE_SCHEMA TABLE_NAME |
| 607 |
test t1_1x |
| 608 |
RENAME TABLE test.t1_1x TO db_datadict.t1_1x; |
| 609 |
SELECT DISTINCT table_schema,table_name FROM information_schema.statistics |
| 610 |
WHERE table_name LIKE 't1_1%'; |
| 611 |
TABLE_SCHEMA TABLE_NAME |
| 612 |
db_datadict t1_1x |
| 613 |
SELECT DISTINCT table_name FROM information_schema.statistics |
| 614 |
WHERE table_name = 't1_1x'; |
| 615 |
TABLE_NAME |
| 616 |
t1_1x |
| 617 |
DROP TABLE db_datadict.t1_1x; |
| 618 |
SELECT DISTINCT table_name FROM information_schema.statistics |
| 619 |
WHERE table_name = 't1_1x'; |
| 620 |
TABLE_NAME |
| 621 |
CREATE TEMPORARY TABLE test.t1_1x (PRIMARY KEY(f1,f2)) |
| 622 |
ENGINE = <engine_type> |
| 623 |
AS SELECT 1 AS f1, 2 AS f2; |
| 624 |
SELECT * FROM information_schema.statistics |
| 625 |
WHERE table_name = 't1_1x'; |
| 626 |
DROP TEMPORARY TABLE test.t1_1x; |
| 627 |
CREATE TABLE db_datadict.t1_1x (PRIMARY KEY(f1)) |
| 628 |
ENGINE = <engine_type> |
| 629 |
AS SELECT 1 AS f1, 2 AS f2; |
| 630 |
SELECT table_name FROM information_schema.statistics |
| 631 |
WHERE table_name = 't1_1x'; |
| 632 |
TABLE_NAME |
| 633 |
t1_1x |
| 634 |
DROP DATABASE db_datadict; |
| 635 |
SELECT table_name FROM information_schema.statistics |
| 636 |
WHERE table_name = 't1_1x'; |
| 637 |
TABLE_NAME |
| 638 |
######################################################################## |
| 639 |
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and |
| 640 |
# DDL on INFORMATION_SCHEMA tables are not supported |
| 641 |
######################################################################## |
| 642 |
DROP DATABASE IF EXISTS db_datadict; |
| 643 |
CREATE DATABASE db_datadict; |
| 644 |
CREATE TABLE db_datadict.t1 (f1 BIGINT) |
| 645 |
ENGINE = <engine_type>; |
| 646 |
INSERT INTO information_schema.statistics |
| 647 |
SELECT * FROM information_schema.statistics; |
| 648 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 649 |
UPDATE information_schema.statistics SET table_schema = 'test' |
| 650 |
WHERE table_name = 't1'; |
| 651 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 652 |
DELETE FROM information_schema.statistics WHERE table_name = 't1'; |
| 653 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 654 |
TRUNCATE information_schema.statistics; |
| 655 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 656 |
CREATE INDEX my_idx_on_statistics |
| 657 |
ON information_schema.statistics(table_schema); |
| 658 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 659 |
ALTER TABLE information_schema.statistics DROP PRIMARY KEY; |
| 660 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 661 |
ALTER TABLE information_schema.statistics ADD f1 INT; |
| 662 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 663 |
DROP TABLE information_schema.statistics; |
| 664 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 665 |
ALTER TABLE information_schema.statistics RENAME db_datadict.statistics; |
| 666 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 667 |
ALTER TABLE information_schema.statistics RENAME information_schema.xstatistics; |
| 668 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 669 |
DROP DATABASE db_datadict; |