Link issues and clang tidy

This commit is contained in:
Raúl Marín 2024-09-18 20:35:52 +02:00
parent f3df7bd171
commit a500a7ff50
21 changed files with 56 additions and 43 deletions

View File

@ -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()

View File

@ -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)

View File

@ -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)

View File

@ -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)
dbms
clickhouse_functions)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -1274,6 +1274,10 @@ Settings::Settings(const Settings & settings)
: impl(std::make_unique<SettingsImpl>(*settings.impl))
{}
Settings::Settings(Settings && settings) noexcept
: impl(std::make_unique<SettingsImpl>(std::move(*settings.impl)))
{}
Settings::~Settings() = default;
Settings & Settings::operator=(const Settings & other)

View File

@ -102,6 +102,7 @@ struct Settings
{
Settings();
Settings(const Settings & settings);
Settings(Settings && settings) noexcept;
~Settings();
Settings & operator=(const Settings & other);

View File

@ -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)

View File

@ -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 ()

View File

@ -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.

View File

@ -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)

View File

@ -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)

View File

@ -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_))

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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,

View File

@ -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)