diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c2586cffd0..c10a35f935d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,6 +252,7 @@ if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/poco/cmake/FindODBC.cmake) else () include (cmake/find_odbc.cmake) endif () +message (STATUS "Using odbc: ${ODBC_INCLUDE_DIRECTORIES} : ${ODBC_LIBRARIES}") include (cmake/find_poco.cmake) include (cmake/find_lz4.cmake) include (cmake/find_sparsehash.cmake) diff --git a/cmake/Modules/FindPoco.cmake b/cmake/Modules/FindPoco.cmake index 33f0bd82ba0..c25c00f7a76 100644 --- a/cmake/Modules/FindPoco.cmake +++ b/cmake/Modules/FindPoco.cmake @@ -51,6 +51,7 @@ set(Poco_HINTS /usr/local + /usr/local/include/Poco C:/AppliedInformatics ${Poco_DIR} $ENV{Poco_DIR} @@ -230,5 +231,3 @@ if(${Poco_OSP_FOUND}) endif() message(STATUS "Found Poco: ${Poco_LIBRARIES}") - - diff --git a/cmake/find_poco.cmake b/cmake/find_poco.cmake index 0d0710a47d4..b46e722c94b 100644 --- a/cmake/find_poco.cmake +++ b/cmake/find_poco.cmake @@ -52,26 +52,33 @@ elseif (NOT MISSING_INTERNAL_POCO_LIBRARY) set (Poco_MongoDB_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/MongoDB/include/") endif () - if (ODBC_FOUND) - if (EXISTS "${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/ODBC/include/") - set (Poco_SQL_FOUND 1) - set (Poco_SQL_LIBRARY PocoSQL) - set (Poco_SQL_INCLUDE_DIRS - "${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/include" - "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include" - ) + + if (EXISTS "${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/ODBC/include/") + set (Poco_SQL_FOUND 1) + set (Poco_SQL_LIBRARY PocoSQL) + set (Poco_SQL_INCLUDE_DIRS + "${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/include" + "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include" + ) + if (ODBC_FOUND) set (Poco_SQLODBC_FOUND 1) set (Poco_SQLODBC_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/SQL/ODBC/include/" "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/ODBC/include/" + ${ODBC_INCLUDE_DIRECTORIES} ) set (Poco_SQLODBC_LIBRARY PocoSQLODBC ${ODBC_LIBRARIES} ${LTDL_LIBRARY}) - else () - set (Poco_Data_FOUND 1) - set (Poco_Data_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include") - set (Poco_Data_LIBRARY PocoData) + endif () + else () + set (Poco_Data_FOUND 1) + set (Poco_Data_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/include") + set (Poco_Data_LIBRARY PocoData) + if (ODBC_FOUND) set (Poco_DataODBC_FOUND 1) - set (Poco_DataODBC_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/ODBC/include/") + set (Poco_DataODBC_INCLUDE_DIRS + "${ClickHouse_SOURCE_DIR}/contrib/poco/Data/ODBC/include/" + ${ODBC_INCLUDE_DIRECTORIES} + ) set (Poco_DataODBC_LIBRARY PocoDataODBC ${ODBC_LIBRARIES} ${LTDL_LIBRARY}) endif () endif () diff --git a/dbms/src/Common/Exception.cpp b/dbms/src/Common/Exception.cpp index 7c22210a439..be44b98dc20 100644 --- a/dbms/src/Common/Exception.cpp +++ b/dbms/src/Common/Exception.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include namespace DB diff --git a/dbms/src/Common/FieldVisitors.h b/dbms/src/Common/FieldVisitors.h index cb43f5fed7f..b59c6a47aa7 100644 --- a/dbms/src/Common/FieldVisitors.h +++ b/dbms/src/Common/FieldVisitors.h @@ -3,7 +3,7 @@ #include #include #include -#include +#include class SipHash; diff --git a/dbms/src/Common/StackTrace.cpp b/dbms/src/Common/StackTrace.cpp index 57fae269a5d..a1490ef4e59 100644 --- a/dbms/src/Common/StackTrace.cpp +++ b/dbms/src/Common/StackTrace.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include StackTrace::StackTrace() diff --git a/dbms/src/Common/Visitor.h b/dbms/src/Common/Visitor.h index 7e78afd8fa6..7aef573a566 100644 --- a/dbms/src/Common/Visitor.h +++ b/dbms/src/Common/Visitor.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include diff --git a/dbms/src/Common/tests/CMakeLists.txt b/dbms/src/Common/tests/CMakeLists.txt index 33b1ae021b5..f1605a13447 100644 --- a/dbms/src/Common/tests/CMakeLists.txt +++ b/dbms/src/Common/tests/CMakeLists.txt @@ -71,6 +71,3 @@ target_link_libraries (cow_columns clickhouse_common_io) add_executable (stopwatch stopwatch.cpp) target_link_libraries (stopwatch clickhouse_common_io) - -add_executable (dump_variable dump_variable.cpp) -target_link_libraries (dump_variable clickhouse_common_io) diff --git a/dbms/src/Common/typeid_cast.h b/dbms/src/Common/typeid_cast.h index 3b8691f4c95..99faeb40742 100644 --- a/dbms/src/Common/typeid_cast.h +++ b/dbms/src/Common/typeid_cast.h @@ -6,7 +6,7 @@ #include #include -#include +#include namespace DB diff --git a/dbms/src/Core/iostream_debug_helpers.h b/dbms/src/Core/iostream_debug_helpers.h index fc961113aa4..e5547c13b6d 100644 --- a/dbms/src/Core/iostream_debug_helpers.h +++ b/dbms/src/Core/iostream_debug_helpers.h @@ -45,4 +45,4 @@ std::ostream & operator<<(std::ostream & stream, const Connection::Packet & what } /// some operator<< should be declared before operator<<(... std::shared_ptr<>) -#include +#include diff --git a/dbms/src/Functions/FunctionsMiscellaneous.cpp b/dbms/src/Functions/FunctionsMiscellaneous.cpp index 5a5fa63426f..f69dad39b52 100644 --- a/dbms/src/Functions/FunctionsMiscellaneous.cpp +++ b/dbms/src/Functions/FunctionsMiscellaneous.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include namespace DB diff --git a/dbms/src/Interpreters/Aggregator.cpp b/dbms/src/Interpreters/Aggregator.cpp index 9536f981919..0b458de253c 100644 --- a/dbms/src/Interpreters/Aggregator.cpp +++ b/dbms/src/Interpreters/Aggregator.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include diff --git a/dbms/src/TableFunctions/getStructureOfRemoteTable.cpp b/dbms/src/Storages/getStructureOfRemoteTable.cpp similarity index 98% rename from dbms/src/TableFunctions/getStructureOfRemoteTable.cpp rename to dbms/src/Storages/getStructureOfRemoteTable.cpp index 56bb257f252..338d8e880bb 100644 --- a/dbms/src/TableFunctions/getStructureOfRemoteTable.cpp +++ b/dbms/src/Storages/getStructureOfRemoteTable.cpp @@ -1,4 +1,4 @@ -#include +#include "getStructureOfRemoteTable.h" #include #include #include diff --git a/dbms/src/TableFunctions/getStructureOfRemoteTable.h b/dbms/src/Storages/getStructureOfRemoteTable.h similarity index 100% rename from dbms/src/TableFunctions/getStructureOfRemoteTable.h rename to dbms/src/Storages/getStructureOfRemoteTable.h diff --git a/dbms/src/TableFunctions/CMakeLists.txt b/dbms/src/TableFunctions/CMakeLists.txt index 53bfccfa3a2..4fef8cf3978 100644 --- a/dbms/src/TableFunctions/CMakeLists.txt +++ b/dbms/src/TableFunctions/CMakeLists.txt @@ -5,7 +5,7 @@ list(REMOVE_ITEM clickhouse_table_functions_sources ITableFunction.cpp TableFunc list(REMOVE_ITEM clickhouse_table_functions_headers ITableFunction.h TableFunctionFactory.h) add_library(clickhouse_table_functions ${clickhouse_table_functions_sources}) -target_link_libraries(clickhouse_table_functions dbms ${Poco_Foundation_LIBRARY}) +target_link_libraries(clickhouse_table_functions clickhouse_storages_system dbms ${Poco_Foundation_LIBRARY}) if (Poco_SQLODBC_FOUND) target_link_libraries (clickhouse_table_functions ${Poco_SQLODBC_LIBRARY}) diff --git a/dbms/src/TableFunctions/TableFunctionRemote.cpp b/dbms/src/TableFunctions/TableFunctionRemote.cpp index 98bd3040ccc..ac79f0ac2f2 100644 --- a/dbms/src/TableFunctions/TableFunctionRemote.cpp +++ b/dbms/src/TableFunctions/TableFunctionRemote.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/dbms/src/TableFunctions/TableFunctionShardByHash.cpp b/dbms/src/TableFunctions/TableFunctionShardByHash.cpp index d3c6368c4f2..616b6d117d4 100644 --- a/dbms/src/TableFunctions/TableFunctionShardByHash.cpp +++ b/dbms/src/TableFunctions/TableFunctionShardByHash.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/libs/libcommon/CMakeLists.txt b/libs/libcommon/CMakeLists.txt index a4b4959f38c..cc0ac9770a6 100644 --- a/libs/libcommon/CMakeLists.txt +++ b/libs/libcommon/CMakeLists.txt @@ -26,6 +26,7 @@ add_library (common ${SPLIT_SHARED} src/JSON.cpp src/getMemoryAmount.cpp src/ThreadPool.cpp + src/demangle.cpp include/common/Types.h include/common/DateLUT.h @@ -44,6 +45,7 @@ add_library (common ${SPLIT_SHARED} include/common/JSON.h include/common/getMemoryAmount.h include/common/ThreadPool.h + include/common/demangle.h include/ext/bit_cast.h include/ext/collection_cast.h diff --git a/dbms/src/Common/demangle.h b/libs/libcommon/include/common/demangle.h similarity index 100% rename from dbms/src/Common/demangle.h rename to libs/libcommon/include/common/demangle.h diff --git a/dbms/src/Common/iostream_debug_helpers.h b/libs/libcommon/include/common/iostream_debug_helpers.h similarity index 99% rename from dbms/src/Common/iostream_debug_helpers.h rename to libs/libcommon/include/common/iostream_debug_helpers.h index 46a995a8663..197d666e5be 100644 --- a/dbms/src/Common/iostream_debug_helpers.h +++ b/libs/libcommon/include/common/iostream_debug_helpers.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include diff --git a/dbms/src/Common/demangle.cpp b/libs/libcommon/src/demangle.cpp similarity index 94% rename from dbms/src/Common/demangle.cpp rename to libs/libcommon/src/demangle.cpp index e4e4850049f..f6aa06e98b6 100644 --- a/dbms/src/Common/demangle.cpp +++ b/libs/libcommon/src/demangle.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/libs/libcommon/src/tests/CMakeLists.txt b/libs/libcommon/src/tests/CMakeLists.txt index 68d8a7e68ce..c8aaf476842 100644 --- a/libs/libcommon/src/tests/CMakeLists.txt +++ b/libs/libcommon/src/tests/CMakeLists.txt @@ -20,3 +20,6 @@ add_check(multi_version) add_executable (unit_tests_libcommon gtest_json_test.cpp gtest_strong_typedef.cpp) target_link_libraries (unit_tests_libcommon gtest_main common) add_check(unit_tests_libcommon) + +add_executable (dump_variable dump_variable.cpp) +target_link_libraries (dump_variable clickhouse_common_io) diff --git a/dbms/src/Common/tests/dump_variable.cpp b/libs/libcommon/src/tests/dump_variable.cpp similarity index 94% rename from dbms/src/Common/tests/dump_variable.cpp rename to libs/libcommon/src/tests/dump_variable.cpp index 3213435ab17..329654cae4a 100644 --- a/dbms/src/Common/tests/dump_variable.cpp +++ b/libs/libcommon/src/tests/dump_variable.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include