diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c2586cffd06b0fa483d7bb6911a36be0dea1f99..c10a35f935dadd433873f70eb549f058a508fb70 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 33f0bd82ba063239187801e2eb82b777afa9dfc0..c25c00f7a76db714df6cc074e78f09d743e487d0 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 0d0710a47d4b11680b77581aa6a03eec910f5a44..b46e722c94b69b91fe27dbb5ac3aef72a516a61c 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 7c22210a4397ddb52dffb7269e17e7db0942c525..be44b98dc207d6486f4140fa3c1a424b0ad8c3b6 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 cb43f5fed7fbc6d821b928478a54a6d2dd83ac23..b59c6a47aa766e9b7b426309f9be5959faaef2ca 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 57fae269a5d0afa50aad5e392dcf9ad90621b232..a1490ef4e5946b9273357b88f5e19fdc84446942 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 7e78afd8fa6b8134187116daa2bd2ea6e40c5048..7aef573a566138c8c8fb49363e150cb4d055b8e7 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 33b1ae021b59fac80e0ede852e2b0d9d1a59ce66..f1605a13447103f4ee0f7317540fcc21ca9af923 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 3b8691f4c95de05ed7474f6c465d4ce5a8ba2e2f..99faeb40742edc616f971b40f79fb469303182a6 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 fc961113aa4d0a19731f306a342b4c7755f7fcee..e5547c13b6dda1956820736b8ad7c23551683b68 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 5a5fa63426f7b1afaf0abd72bb5eef1f87d3e15d..f69dad39b528f12120e9d0c7ffff5161b65d5601 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 9536f98191972182c90ac20878ed322f1a3a327e..0b458de253c68e467505a8395f4c7c802ac5ebef 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 56bb257f252eb90ff39eb8dc46ec01ae790e8502..338d8e880bbcf75c785c644d2a3c1bf8267ca73a 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 53bfccfa3a22fedf5ec75b212230a10f4ddf2e2c..4fef8cf3978aef9a3ffb247fa74d7367a94b5422 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 98bd3040cccc62179c55969c0a8119a88d79c5c1..ac79f0ac2f2c5350d47fb44f3d17ecebe912a020 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 d3c6368c4f29a127dd9db85b4c4e04ec7f3af4b0..616b6d117d4126d4fae099c1f98c2de8bce260e3 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 a4b4959f38c74df68f58b70fedda615efc71547d..cc0ac9770a6c7cbd66fc6429ca8b0dc8ef03ac6a 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 46a995a86636eee22be73485b7c34a9d729cf845..197d666e5bebd369105b23186a1969717eafc69a 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 e4e4850049fee25235f6cea5cc1e6fbd0afbd627..f6aa06e98b6cfaae0235b5c8e3d4dec08349093d 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 68d8a7e68cee218d478a32370b54a6cf8c7b69cf..c8aaf4768428d50781491c5a9b9ac270616d57e6 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 3213435ab17e0aed5415771777a0fc60c5166b1e..329654cae4a140bdae4b89572e707cd551bcc8c7 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