#include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef OS_LINUX #include #endif #if USE_ROCKSDB #include #include #endif namespace DB { void attachSystemTablesLocal(ContextPtr context, IDatabase & system_database) { attach(context, system_database, "one"); attach(context, system_database, "numbers", false); attach(context, system_database, "numbers_mt", true); attach(context, system_database, "zeros", false); attach(context, system_database, "zeros_mt", true); attach(context, system_database, "databases"); attach(context, system_database, "tables"); attach(context, system_database, "columns"); attach(context, system_database, "functions"); attach(context, system_database, "events"); attach(context, system_database, "settings"); attach(context, system_database, "settings_changes"); attach>(context, system_database, "merge_tree_settings"); attach>(context, system_database, "replicated_merge_tree_settings"); attach(context, system_database, "build_options"); attach(context, system_database, "formats"); attach(context, system_database, "table_functions"); attach(context, system_database, "aggregate_function_combinators"); attach(context, system_database, "data_type_families"); attach(context, system_database, "collations"); attach(context, system_database, "table_engines"); attach(context, system_database, "contributors"); attach(context, system_database, "users"); attach(context, system_database, "roles"); attach(context, system_database, "grants"); attach(context, system_database, "role_grants"); attach(context, system_database, "current_roles"); attach(context, system_database, "enabled_roles"); attach(context, system_database, "settings_profiles"); attach(context, system_database, "settings_profile_elements"); attach(context, system_database, "row_policies"); attach(context, system_database, "quotas"); attach(context, system_database, "quota_limits"); attach(context, system_database, "quota_usage"); attach(context, system_database, "quotas_usage"); attach(context, system_database, "user_directories"); attach(context, system_database, "privileges"); attach(context, system_database, "errors"); attach(context, system_database, "warnings"); attach(context, system_database, "data_skipping_indices"); attach(context, system_database, "licenses"); attach(context, system_database, "time_zones"); attach(context, system_database, "backups"); attach(context, system_database, "schema_inference_cache"); #ifdef OS_LINUX attach(context, system_database, "stack_trace"); #endif #if USE_ROCKSDB attach(context, system_database, "rocksdb"); attach(context, system_database, "merge_tree_metadata_cache"); #endif } void attachSystemTablesServer(ContextPtr context, IDatabase & system_database, bool has_zookeeper) { attachSystemTablesLocal(context, system_database); attach(context, system_database, "parts"); attach(context, system_database, "projection_parts"); attach(context, system_database, "detached_parts"); attach(context, system_database, "parts_columns"); attach(context, system_database, "projection_parts_columns"); attach(context, system_database, "disks"); attach(context, system_database, "storage_policies"); attach(context, system_database, "processes"); attach(context, system_database, "metrics"); attach(context, system_database, "merges"); attach(context, system_database, "mutations"); attach(context, system_database, "replicas"); attach(context, system_database, "replication_queue"); attach(context, system_database, "distributed_ddl_queue"); attach(context, system_database, "distribution_queue"); attach(context, system_database, "dictionaries"); attach(context, system_database, "models"); attach(context, system_database, "clusters"); attach(context, system_database, "graphite_retentions"); attach(context, system_database, "macros"); attach(context, system_database, "replicated_fetches"); attach(context, system_database, "part_moves_between_shards"); attach(context, system_database, "asynchronous_inserts"); attach(context, system_database, "filesystem_cache"); attach(context, system_database, "remote_data_paths"); attach(context, system_database, "certificates"); if (has_zookeeper) attach(context, system_database, "zookeeper"); if (context->getConfigRef().getInt("allow_experimental_transactions", 0)) attach(context, system_database, "transactions"); } void attachSystemTablesAsync(ContextPtr context, IDatabase & system_database, AsynchronousMetrics & async_metrics) { attach(context, system_database, "asynchronous_metrics", async_metrics); } }