#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 #if !defined(ARCADIA_BUILD) #include #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef OS_LINUX #include #endif namespace DB { void attachSystemTablesLocal(IDatabase & system_database) { attach(system_database, "one"); attach(system_database, "numbers", false); attach(system_database, "numbers_mt", true); attach(system_database, "zeros", false); attach(system_database, "zeros_mt", true); attach(system_database, "databases"); attach(system_database, "tables"); attach(system_database, "columns"); attach(system_database, "functions"); attach(system_database, "events"); attach(system_database, "settings"); attach>(system_database, "merge_tree_settings"); attach>(system_database, "replicated_merge_tree_settings"); attach(system_database, "build_options"); attach(system_database, "formats"); attach(system_database, "table_functions"); attach(system_database, "aggregate_function_combinators"); attach(system_database, "data_type_families"); attach(system_database, "collations"); attach(system_database, "table_engines"); attach(system_database, "contributors"); attach(system_database, "users"); attach(system_database, "roles"); attach(system_database, "grants"); attach(system_database, "role_grants"); attach(system_database, "current_roles"); attach(system_database, "enabled_roles"); attach(system_database, "settings_profiles"); attach(system_database, "settings_profile_elements"); attach(system_database, "row_policies"); attach(system_database, "quotas"); attach(system_database, "quota_limits"); attach(system_database, "quota_usage"); attach(system_database, "quotas_usage"); attach(system_database, "user_directories"); attach(system_database, "privileges"); #if !defined(ARCADIA_BUILD) attach(system_database, "licenses"); attach(system_database, "time_zones"); #endif #ifdef OS_LINUX attach(system_database, "stack_trace"); #endif } void attachSystemTablesServer(IDatabase & system_database, bool has_zookeeper) { attachSystemTablesLocal(system_database); attach(system_database, "parts"); attach(system_database, "detached_parts"); attach(system_database, "parts_columns"); attach(system_database, "disks"); attach(system_database, "storage_policies"); attach(system_database, "processes"); attach(system_database, "metrics"); attach(system_database, "merges"); attach(system_database, "mutations"); attach(system_database, "replicas"); attach(system_database, "replication_queue"); attach(system_database, "distribution_queue"); attach(system_database, "dictionaries"); attach(system_database, "models"); attach(system_database, "clusters"); attach(system_database, "graphite_retentions"); attach(system_database, "macros"); attach(system_database, "fetches"); if (has_zookeeper) attach(system_database, "zookeeper"); } void attachSystemTablesAsync(IDatabase & system_database, AsynchronousMetrics & async_metrics) { attach(system_database, "asynchronous_metrics", async_metrics); } }