diff --git a/src/Access/examples/CMakeLists.txt b/src/Access/examples/CMakeLists.txt index 99d040cec68..18f40c2ef14 100644 --- a/src/Access/examples/CMakeLists.txt +++ b/src/Access/examples/CMakeLists.txt @@ -1,4 +1,4 @@ if (TARGET ch_contrib::krb5) clickhouse_add_executable (kerberos_init kerberos_init.cpp) - target_link_libraries (kerberos_init PRIVATE dbms ch_contrib::krb5) + target_link_libraries (kerberos_init PRIVATE dbms clickhouse_functions ch_contrib::krb5) endif() diff --git a/src/AggregateFunctions/examples/CMakeLists.txt b/src/AggregateFunctions/examples/CMakeLists.txt index a9033fd8508..8ded1e5472a 100644 --- a/src/AggregateFunctions/examples/CMakeLists.txt +++ b/src/AggregateFunctions/examples/CMakeLists.txt @@ -1,5 +1,5 @@ clickhouse_add_executable (quantile-t-digest quantile-t-digest.cpp) -target_link_libraries (quantile-t-digest PRIVATE dbms clickhouse_aggregate_functions) +target_link_libraries (quantile-t-digest PRIVATE dbms clickhouse_functions clickhouse_aggregate_functions) clickhouse_add_executable (group_array_sorted group_array_sorted.cpp) -target_link_libraries (group_array_sorted PRIVATE dbms clickhouse_aggregate_functions) +target_link_libraries (group_array_sorted PRIVATE dbms clickhouse_functions clickhouse_aggregate_functions) diff --git a/src/Client/examples/CMakeLists.txt b/src/Client/examples/CMakeLists.txt index 9d788a49c59..469f7aa0852 100644 --- a/src/Client/examples/CMakeLists.txt +++ b/src/Client/examples/CMakeLists.txt @@ -1,2 +1,2 @@ clickhouse_add_executable(test-connect test_connect.cpp) -target_link_libraries (test-connect PRIVATE dbms) +target_link_libraries (test-connect PRIVATE dbms clickhouse_functions) diff --git a/src/Columns/benchmarks/CMakeLists.txt b/src/Columns/benchmarks/CMakeLists.txt index 47f5dfe4c59..04c4bb88ac3 100644 --- a/src/Columns/benchmarks/CMakeLists.txt +++ b/src/Columns/benchmarks/CMakeLists.txt @@ -1,4 +1,5 @@ clickhouse_add_executable(column_insert_many_from benchmark_column_insert_many_from.cpp) target_link_libraries (column_insert_many_from PRIVATE ch_contrib::gbenchmark_all - dbms) \ No newline at end of file + dbms + clickhouse_functions) diff --git a/src/Common/benchmarks/CMakeLists.txt b/src/Common/benchmarks/CMakeLists.txt index 690ced1eb88..8b4b9d187b7 100644 --- a/src/Common/benchmarks/CMakeLists.txt +++ b/src/Common/benchmarks/CMakeLists.txt @@ -2,6 +2,7 @@ clickhouse_add_executable(integer_hash_tables_and_hashes integer_hash_tables_and target_link_libraries (integer_hash_tables_and_hashes PRIVATE ch_contrib::gbenchmark_all dbms + clickhouse_functions ch_contrib::abseil_swiss_tables ch_contrib::sparsehash ch_contrib::wyhash @@ -11,4 +12,5 @@ target_link_libraries (integer_hash_tables_and_hashes PRIVATE clickhouse_add_executable(orc_string_dictionary orc_string_dictionary.cpp) target_link_libraries (orc_string_dictionary PRIVATE ch_contrib::gbenchmark_all - dbms) + dbms + clickhouse_functions) diff --git a/src/Common/examples/CMakeLists.txt b/src/Common/examples/CMakeLists.txt index 8383e80d09d..47aa6a664f5 100644 --- a/src/Common/examples/CMakeLists.txt +++ b/src/Common/examples/CMakeLists.txt @@ -26,24 +26,24 @@ clickhouse_add_executable (radix_sort radix_sort.cpp) target_link_libraries (radix_sort PRIVATE clickhouse_common_io clickhouse_common_config ch_contrib::pdqsort) clickhouse_add_executable (arena_with_free_lists arena_with_free_lists.cpp) -target_link_libraries (arena_with_free_lists PRIVATE dbms) +target_link_libraries (arena_with_free_lists PRIVATE dbms clickhouse_functions) clickhouse_add_executable (lru_hash_map_perf lru_hash_map_perf.cpp) -target_link_libraries (lru_hash_map_perf PRIVATE dbms) +target_link_libraries (lru_hash_map_perf PRIVATE dbms clickhouse_functions) if (OS_LINUX) clickhouse_add_executable (thread_creation_latency thread_creation_latency.cpp) - target_link_libraries (thread_creation_latency PRIVATE clickhouse_common_io clickhouse_common_config) + target_link_libraries (thread_creation_latency PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config) endif() clickhouse_add_executable (array_cache array_cache.cpp) target_link_libraries (array_cache PRIVATE clickhouse_common_io clickhouse_common_config) clickhouse_add_executable (space_saving space_saving.cpp) -target_link_libraries (space_saving PRIVATE clickhouse_common_io clickhouse_common_config) +target_link_libraries (space_saving PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config) clickhouse_add_executable (integer_hash_tables_benchmark integer_hash_tables_benchmark.cpp) -target_link_libraries (integer_hash_tables_benchmark PRIVATE dbms ch_contrib::abseil_swiss_tables ch_contrib::sparsehash) +target_link_libraries (integer_hash_tables_benchmark PRIVATE dbms clickhouse_functions ch_contrib::abseil_swiss_tables ch_contrib::sparsehash) clickhouse_add_executable (cow_columns cow_columns.cpp) target_link_libraries (cow_columns PRIVATE clickhouse_common_io clickhouse_common_config) @@ -69,13 +69,13 @@ clickhouse_add_executable (procfs_metrics_provider_perf procfs_metrics_provider_ target_link_libraries (procfs_metrics_provider_perf PRIVATE clickhouse_common_io clickhouse_common_config) clickhouse_add_executable (average average.cpp) -target_link_libraries (average PRIVATE clickhouse_common_io clickhouse_common_config) +target_link_libraries (average PRIVATE dbms clickhouse_common_io clickhouse_common_config clickhouse_functions) clickhouse_add_executable (shell_command_inout shell_command_inout.cpp) target_link_libraries (shell_command_inout PRIVATE clickhouse_common_io clickhouse_common_config) clickhouse_add_executable (executable_udf executable_udf.cpp) -target_link_libraries (executable_udf PRIVATE dbms) +target_link_libraries (executable_udf PRIVATE dbms clickhouse_functions) if (ENABLE_HIVE) clickhouse_add_executable (hive_metastore_client hive_metastore_client.cpp) @@ -83,7 +83,7 @@ if (ENABLE_HIVE) endif() clickhouse_add_executable (interval_tree interval_tree.cpp) -target_link_libraries (interval_tree PRIVATE dbms) +target_link_libraries (interval_tree PRIVATE dbms clickhouse_functions) if (ENABLE_SSL) clickhouse_add_executable (encrypt_decrypt encrypt_decrypt.cpp) diff --git a/src/Compression/examples/CMakeLists.txt b/src/Compression/examples/CMakeLists.txt index fee8cf89942..f686f250ae9 100644 --- a/src/Compression/examples/CMakeLists.txt +++ b/src/Compression/examples/CMakeLists.txt @@ -1,2 +1,2 @@ clickhouse_add_executable (compressed_buffer compressed_buffer.cpp) -target_link_libraries (compressed_buffer PRIVATE clickhouse_common_io clickhouse_common_config clickhouse_compression) +target_link_libraries (compressed_buffer PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config clickhouse_compression) diff --git a/src/Core/Settings.cpp b/src/Core/Settings.cpp index b03f502a469..84c124f7fb0 100644 --- a/src/Core/Settings.cpp +++ b/src/Core/Settings.cpp @@ -1274,6 +1274,10 @@ Settings::Settings(const Settings & settings) : impl(std::make_unique(*settings.impl)) {} +Settings::Settings(Settings && settings) noexcept + : impl(std::make_unique(std::move(*settings.impl))) +{} + Settings::~Settings() = default; Settings & Settings::operator=(const Settings & other) diff --git a/src/Core/Settings.h b/src/Core/Settings.h index 8d57d624e32..3c79139b27f 100644 --- a/src/Core/Settings.h +++ b/src/Core/Settings.h @@ -102,6 +102,7 @@ struct Settings { Settings(); Settings(const Settings & settings); + Settings(Settings && settings) noexcept; ~Settings(); Settings & operator=(const Settings & other); diff --git a/src/Core/examples/CMakeLists.txt b/src/Core/examples/CMakeLists.txt index 97e5e8e67e6..369c6101032 100644 --- a/src/Core/examples/CMakeLists.txt +++ b/src/Core/examples/CMakeLists.txt @@ -1,8 +1,8 @@ clickhouse_add_executable (string_pool string_pool.cpp) -target_link_libraries (string_pool PRIVATE clickhouse_common_io clickhouse_common_config ch_contrib::sparsehash) +target_link_libraries (string_pool PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config ch_contrib::sparsehash) clickhouse_add_executable (field field.cpp) -target_link_libraries (field PRIVATE dbms) +target_link_libraries (field PRIVATE dbms clickhouse_functions) clickhouse_add_executable (string_ref_hash string_ref_hash.cpp) target_link_libraries (string_ref_hash PRIVATE clickhouse_common_io clickhouse_common_config) diff --git a/src/IO/examples/CMakeLists.txt b/src/IO/examples/CMakeLists.txt index bfd171a3d00..48fb9ce858b 100644 --- a/src/IO/examples/CMakeLists.txt +++ b/src/IO/examples/CMakeLists.txt @@ -38,7 +38,7 @@ clickhouse_add_executable (o_direct_and_dirty_pages o_direct_and_dirty_pages.cpp target_link_libraries (o_direct_and_dirty_pages PRIVATE clickhouse_common_io clickhouse_common_config) clickhouse_add_executable (io_operators io_operators.cpp) -target_link_libraries (io_operators PRIVATE clickhouse_common_io clickhouse_common_config) +target_link_libraries (io_operators PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config) clickhouse_add_executable (write_int write_int.cpp) target_link_libraries (write_int PRIVATE clickhouse_common_io clickhouse_common_config) @@ -56,7 +56,7 @@ clickhouse_add_executable (limit_read_buffer2 limit_read_buffer2.cpp) target_link_libraries (limit_read_buffer2 PRIVATE clickhouse_common_io clickhouse_common_config) clickhouse_add_executable (parse_date_time_best_effort parse_date_time_best_effort.cpp) -target_link_libraries (parse_date_time_best_effort PRIVATE clickhouse_common_io clickhouse_common_config) +target_link_libraries (parse_date_time_best_effort PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config) clickhouse_add_executable (zlib_ng_bug zlib_ng_bug.cpp) target_link_libraries (zlib_ng_bug PRIVATE ch_contrib::zlib clickhouse_common_io clickhouse_common_config) @@ -75,7 +75,7 @@ target_link_libraries (hadoop_snappy_read_buffer PRIVATE clickhouse_common_io cl if (TARGET ch_contrib::hdfs) clickhouse_add_executable (read_buffer_from_hdfs read_buffer_from_hdfs.cpp) - target_link_libraries (read_buffer_from_hdfs PRIVATE dbms ch_contrib::hdfs) + target_link_libraries (read_buffer_from_hdfs PRIVATE dbms clickhouse_functions ch_contrib::hdfs) endif () diff --git a/src/Interpreters/ClusterProxy/executeQuery.cpp b/src/Interpreters/ClusterProxy/executeQuery.cpp index a3a7fb51f9a..c1d301f068d 100644 --- a/src/Interpreters/ClusterProxy/executeQuery.cpp +++ b/src/Interpreters/ClusterProxy/executeQuery.cpp @@ -87,7 +87,7 @@ ContextMutablePtr updateSettingsAndClientInfoForCluster(const Cluster & cluster, const DistributedSettings * distributed_settings) { ClientInfo new_client_info = context->getClientInfo(); - Settings new_settings = settings; + Settings new_settings {settings}; new_settings[Setting::queue_max_wait_ms] = Cluster::saturate(new_settings[Setting::queue_max_wait_ms], settings[Setting::max_execution_time]); /// In case of interserver mode we should reset initial_user for remote() function to use passed user from the query. diff --git a/src/Interpreters/examples/CMakeLists.txt b/src/Interpreters/examples/CMakeLists.txt index 4b1ec970b26..dff777af115 100644 --- a/src/Interpreters/examples/CMakeLists.txt +++ b/src/Interpreters/examples/CMakeLists.txt @@ -1,35 +1,35 @@ clickhouse_add_executable (hash_map hash_map.cpp) -target_link_libraries (hash_map PRIVATE dbms clickhouse_functions ch_contrib::sparsehash) +target_link_libraries (hash_map PRIVATE dbms clickhouse_functions clickhouse_functions ch_contrib::sparsehash) clickhouse_add_executable (hash_map_lookup hash_map_lookup.cpp) -target_link_libraries (hash_map_lookup PRIVATE clickhouse_common_io clickhouse_common_config clickhouse_compression) +target_link_libraries (hash_map_lookup PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config clickhouse_compression) clickhouse_add_executable (hash_map3 hash_map3.cpp) -target_link_libraries (hash_map3 PRIVATE clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::farmhash ch_contrib::metrohash) +target_link_libraries (hash_map3 PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::farmhash ch_contrib::metrohash) clickhouse_add_executable (hash_map_string hash_map_string.cpp) -target_link_libraries (hash_map_string PRIVATE clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::sparsehash) +target_link_libraries (hash_map_string PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::sparsehash) clickhouse_add_executable (hash_map_string_2 hash_map_string_2.cpp) -target_link_libraries (hash_map_string_2 PRIVATE clickhouse_common_io clickhouse_common_config clickhouse_compression) +target_link_libraries (hash_map_string_2 PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config clickhouse_compression) clickhouse_add_executable (hash_map_string_3 hash_map_string_3.cpp) -target_link_libraries (hash_map_string_3 PRIVATE clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::farmhash ch_contrib::metrohash) +target_link_libraries (hash_map_string_3 PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::farmhash ch_contrib::metrohash) clickhouse_add_executable (hash_map_string_small hash_map_string_small.cpp) -target_link_libraries (hash_map_string_small PRIVATE clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::sparsehash) +target_link_libraries (hash_map_string_small PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::sparsehash) clickhouse_add_executable (string_hash_map string_hash_map.cpp) -target_link_libraries (string_hash_map PRIVATE clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::sparsehash) +target_link_libraries (string_hash_map PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::sparsehash) clickhouse_add_executable (string_hash_map_aggregation string_hash_map.cpp) -target_link_libraries (string_hash_map_aggregation PRIVATE clickhouse_common_io clickhouse_common_config clickhouse_compression) +target_link_libraries (string_hash_map_aggregation PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config clickhouse_compression) clickhouse_add_executable (string_hash_set string_hash_set.cpp) -target_link_libraries (string_hash_set PRIVATE clickhouse_common_io clickhouse_common_config clickhouse_compression) +target_link_libraries (string_hash_set PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config clickhouse_compression) clickhouse_add_executable (two_level_hash_map two_level_hash_map.cpp) -target_link_libraries (two_level_hash_map PRIVATE clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::sparsehash) +target_link_libraries (two_level_hash_map PRIVATE dbms clickhouse_functions clickhouse_common_io clickhouse_common_config clickhouse_compression ch_contrib::sparsehash) clickhouse_add_executable (jit_example jit_example.cpp) -target_link_libraries (jit_example PRIVATE dbms) +target_link_libraries (jit_example PRIVATE dbms clickhouse_functions) diff --git a/src/Parsers/examples/CMakeLists.txt b/src/Parsers/examples/CMakeLists.txt index 07f60601acd..0ea52497ecc 100644 --- a/src/Parsers/examples/CMakeLists.txt +++ b/src/Parsers/examples/CMakeLists.txt @@ -4,7 +4,7 @@ clickhouse_add_executable(lexer lexer.cpp ${SRCS}) target_link_libraries(lexer PRIVATE clickhouse_parsers clickhouse_common_config) clickhouse_add_executable(select_parser select_parser.cpp ${SRCS} "../../Server/ServerType.cpp") -target_link_libraries(select_parser PRIVATE dbms) +target_link_libraries(select_parser PRIVATE dbms clickhouse_functions) clickhouse_add_executable(create_parser create_parser.cpp ${SRCS} "../../Server/ServerType.cpp") -target_link_libraries(create_parser PRIVATE dbms) +target_link_libraries(create_parser PRIVATE dbms clickhouse_functions) diff --git a/src/Storages/Distributed/DistributedAsyncInsertDirectoryQueue.cpp b/src/Storages/Distributed/DistributedAsyncInsertDirectoryQueue.cpp index 8218f3daec6..c517a055044 100644 --- a/src/Storages/Distributed/DistributedAsyncInsertDirectoryQueue.cpp +++ b/src/Storages/Distributed/DistributedAsyncInsertDirectoryQueue.cpp @@ -477,7 +477,7 @@ struct DistributedAsyncInsertDirectoryQueue::BatchHeader Block header; BatchHeader(Settings settings_, String query_, ClientInfo client_info_, Block header_) - : settings(std::move(settings_)) + : settings(settings_) , query(std::move(query_)) , client_info(std::move(client_info_)) , header(std::move(header_)) diff --git a/src/Storages/IStorageCluster.cpp b/src/Storages/IStorageCluster.cpp index 7d8c046507b..32c3ee4130e 100644 --- a/src/Storages/IStorageCluster.cpp +++ b/src/Storages/IStorageCluster.cpp @@ -232,7 +232,7 @@ QueryProcessingStage::Enum IStorageCluster::getQueryProcessingStage( ContextPtr ReadFromCluster::updateSettings(const Settings & settings) { - Settings new_settings = settings; + Settings new_settings{settings}; /// Cluster table functions should always skip unavailable shards. new_settings[Setting::skip_unavailable_shards] = true; diff --git a/src/Storages/examples/CMakeLists.txt b/src/Storages/examples/CMakeLists.txt index 4f221efbd2b..0d6accbc895 100644 --- a/src/Storages/examples/CMakeLists.txt +++ b/src/Storages/examples/CMakeLists.txt @@ -1,8 +1,8 @@ clickhouse_add_executable (merge_selector merge_selector.cpp) -target_link_libraries (merge_selector PRIVATE dbms) +target_link_libraries (merge_selector PRIVATE dbms clickhouse_functions) clickhouse_add_executable (merge_selector2 merge_selector2.cpp) -target_link_libraries (merge_selector2 PRIVATE dbms) +target_link_libraries (merge_selector2 PRIVATE dbms clickhouse_functions) clickhouse_add_executable (get_current_inserts_in_replicated get_current_inserts_in_replicated.cpp) target_link_libraries (get_current_inserts_in_replicated PRIVATE dbms clickhouse_common_config clickhouse_common_zookeeper clickhouse_functions) diff --git a/utils/checksum-for-compressed-block/CMakeLists.txt b/utils/checksum-for-compressed-block/CMakeLists.txt index da0434c0ffe..84378f6c1b7 100644 --- a/utils/checksum-for-compressed-block/CMakeLists.txt +++ b/utils/checksum-for-compressed-block/CMakeLists.txt @@ -1,2 +1,2 @@ clickhouse_add_executable (checksum-for-compressed-block-find-bit-flips main.cpp) -target_link_libraries(checksum-for-compressed-block-find-bit-flips PRIVATE dbms) +target_link_libraries(checksum-for-compressed-block-find-bit-flips PRIVATE dbms clickhouse_functions) diff --git a/utils/compressor/CMakeLists.txt b/utils/compressor/CMakeLists.txt index f6c4cbd56b9..81f981f8126 100644 --- a/utils/compressor/CMakeLists.txt +++ b/utils/compressor/CMakeLists.txt @@ -1,2 +1,2 @@ clickhouse_add_executable (decompress_perf decompress_perf.cpp) -target_link_libraries(decompress_perf PRIVATE dbms ch_contrib::lz4) +target_link_libraries(decompress_perf PRIVATE dbms clickhouse_functions ch_contrib::lz4) diff --git a/utils/keeper-bench/Runner.cpp b/utils/keeper-bench/Runner.cpp index 7abc5f1b3b4..6a055d68f5b 100644 --- a/utils/keeper-bench/Runner.cpp +++ b/utils/keeper-bench/Runner.cpp @@ -37,6 +37,11 @@ namespace CurrentMetrics extern const Metric LocalThreadScheduled; } +namespace DB::Setting +{ + extern const SettingsUInt64 max_block_size; +} + namespace DB::ErrorCodes { extern const int CANNOT_BLOCK_SIGNAL; @@ -564,7 +569,7 @@ struct ZooKeeperRequestFromLogReader *file_read_buf, header_block, context, - context->getSettingsRef().max_block_size, + context->getSettingsRef()[DB::Setting::max_block_size], format_settings, 1, std::nullopt, diff --git a/utils/memcpy-bench/CMakeLists.txt b/utils/memcpy-bench/CMakeLists.txt index c0b0b8a589d..842b63b6070 100644 --- a/utils/memcpy-bench/CMakeLists.txt +++ b/utils/memcpy-bench/CMakeLists.txt @@ -28,5 +28,5 @@ endif() set_source_files_properties(FastMemcpy.cpp PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast") set_source_files_properties(FastMemcpy_Avx.cpp PROPERTIES COMPILE_FLAGS "-mavx -Wno-old-style-cast -Wno-cast-qual -Wno-cast-align") -target_link_libraries(memcpy-bench PRIVATE dbms boost::program_options) +target_link_libraries(memcpy-bench PRIVATE dbms clickhouse_functions boost::program_options)