mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
Improve CCTZ contrib (#9687)
* common/Types.h → common/types.h Also split Core/Defines.h and merge with common/likely.h * Improve cctz contrib * Fix ALWAYS_INLINE and unbundled build * Update Dockerfile from master * Fix test for unbundled library
This commit is contained in:
parent
638d1e6466
commit
571d0d541c
@ -354,7 +354,6 @@ endif ()
|
||||
|
||||
# Need to process before "contrib" dir:
|
||||
include (cmake/find/jemalloc.cmake)
|
||||
include (cmake/find/cctz.cmake)
|
||||
include (cmake/find/mysqlclient.cmake)
|
||||
|
||||
# When testing for memory leaks with Valgrind, don't link tcmalloc or jemalloc.
|
||||
|
@ -41,10 +41,6 @@ endif ()
|
||||
|
||||
target_include_directories(common PUBLIC .. ${CMAKE_CURRENT_BINARY_DIR}/..)
|
||||
|
||||
if(CCTZ_INCLUDE_DIR)
|
||||
target_include_directories(common BEFORE PRIVATE ${CCTZ_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
if (NOT USE_INTERNAL_BOOST_LIBRARY)
|
||||
target_include_directories (common SYSTEM BEFORE PUBLIC ${Boost_INCLUDE_DIRS})
|
||||
endif ()
|
||||
@ -53,10 +49,6 @@ if(NOT USE_INTERNAL_POCO_LIBRARY)
|
||||
target_include_directories (common SYSTEM BEFORE PUBLIC ${Poco_Foundation_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
if(CCTZ_LIBRARY)
|
||||
target_link_libraries(common PRIVATE ${CCTZ_LIBRARY})
|
||||
endif()
|
||||
|
||||
# allow explicitly fallback to readline
|
||||
if (NOT ENABLE_REPLXX AND ENABLE_READLINE)
|
||||
message (STATUS "Attempt to fallback to readline explicitly")
|
||||
@ -88,6 +80,9 @@ target_link_libraries (common
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
FastMemcpy
|
||||
replxx
|
||||
|
||||
PRIVATE
|
||||
cctz
|
||||
)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
|
@ -1,9 +1,10 @@
|
||||
#include <common/DateLUT.h>
|
||||
#include "DateLUT.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <Poco/DigestStream.h>
|
||||
#include <Poco/Exception.h>
|
||||
#include <Poco/SHA1Engine.h>
|
||||
#include <Poco/DigestStream.h>
|
||||
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
|
@ -1,20 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "DateLUTImpl.h"
|
||||
#include <unordered_map>
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
#include <memory>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
// Also defined in Core/Defines.h
|
||||
#if !defined(ALWAYS_INLINE)
|
||||
#if defined(_MSC_VER)
|
||||
#define ALWAYS_INLINE __forceinline
|
||||
#else
|
||||
#define ALWAYS_INLINE __attribute__((__always_inline__))
|
||||
#endif
|
||||
#endif
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
/// This class provides lazy initialization and lookup of singleton DateLUTImpl objects for a given timezone.
|
||||
|
@ -1,23 +1,14 @@
|
||||
#if __has_include(<cctz/civil_time.h>)
|
||||
#include <cctz/civil_time.h> // bundled, debian
|
||||
#else
|
||||
#include <civil_time.h> // freebsd
|
||||
#endif
|
||||
#include "DateLUTImpl.h"
|
||||
|
||||
#if __has_include(<cctz/time_zone.h>)
|
||||
#include <cctz/civil_time.h>
|
||||
#include <cctz/time_zone.h>
|
||||
#else
|
||||
#include <time_zone.h>
|
||||
#endif
|
||||
|
||||
#include <common/DateLUTImpl.h>
|
||||
#include <Poco/Exception.h>
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
#include <chrono>
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
#define DATE_LUT_MIN 0
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "Types.h"
|
||||
#include "DayNum.h"
|
||||
#include "likely.h"
|
||||
#include "defines.h"
|
||||
#include "types.h"
|
||||
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <common/strong_typedef.h>
|
||||
|
||||
/** Represents number of days since 1970-01-01.
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <typeinfo>
|
||||
#include <Poco/Exception.h>
|
||||
#include <common/StringRef.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
|
||||
/** Очень простой класс для чтения JSON (или его кусочков).
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <vector>
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <functional>
|
||||
#include <ostream>
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <common/unaligned.h>
|
||||
|
||||
#include <city.h>
|
||||
|
87
base/common/defines.h
Normal file
87
base/common/defines.h
Normal file
@ -0,0 +1,87 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# if !defined(likely)
|
||||
# define likely(x) (x)
|
||||
# endif
|
||||
# if !defined(unlikely)
|
||||
# define unlikely(x) (x)
|
||||
# endif
|
||||
#else
|
||||
# if !defined(likely)
|
||||
# define likely(x) (__builtin_expect(!!(x), 1))
|
||||
# endif
|
||||
# if !defined(unlikely)
|
||||
# define unlikely(x) (__builtin_expect(!!(x), 0))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# define ALWAYS_INLINE __forceinline
|
||||
# define NO_INLINE static __declspec(noinline)
|
||||
# define MAY_ALIAS
|
||||
#else
|
||||
# define ALWAYS_INLINE __attribute__((__always_inline__))
|
||||
# define NO_INLINE __attribute__((__noinline__))
|
||||
# define MAY_ALIAS __attribute__((__may_alias__))
|
||||
#endif
|
||||
|
||||
#if !defined(__x86_64__) && !defined(__aarch64__) && !defined(__PPC__)
|
||||
# error "The only supported platforms are x86_64 and AArch64, PowerPC (work in progress)"
|
||||
#endif
|
||||
|
||||
/// Check for presence of address sanitizer
|
||||
#if !defined(ADDRESS_SANITIZER)
|
||||
# if defined(__has_feature)
|
||||
# if __has_feature(address_sanitizer)
|
||||
# define ADDRESS_SANITIZER 1
|
||||
# endif
|
||||
# elif defined(__SANITIZE_ADDRESS__)
|
||||
# define ADDRESS_SANITIZER 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(THREAD_SANITIZER)
|
||||
# if defined(__has_feature)
|
||||
# if __has_feature(thread_sanitizer)
|
||||
# define THREAD_SANITIZER 1
|
||||
# endif
|
||||
# elif defined(__SANITIZE_THREAD__)
|
||||
# define THREAD_SANITIZER 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(MEMORY_SANITIZER)
|
||||
# if defined(__has_feature)
|
||||
# if __has_feature(memory_sanitizer)
|
||||
# define MEMORY_SANITIZER 1
|
||||
# endif
|
||||
# elif defined(__MEMORY_SANITIZER__)
|
||||
# define MEMORY_SANITIZER 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/// TODO: Strange enough, there is no way to detect UB sanitizer.
|
||||
|
||||
/// Explicitly allow undefined behaviour for certain functions. Use it as a function attribute.
|
||||
/// It is useful in case when compiler cannot see (and exploit) it, but UBSan can.
|
||||
/// Example: multiplication of signed integers with possibility of overflow when both sides are from user input.
|
||||
#if defined(__clang__)
|
||||
# define NO_SANITIZE_UNDEFINED __attribute__((__no_sanitize__("undefined")))
|
||||
# define NO_SANITIZE_ADDRESS __attribute__((__no_sanitize__("address")))
|
||||
# define NO_SANITIZE_THREAD __attribute__((__no_sanitize__("thread")))
|
||||
#else /// It does not work in GCC. GCC 7 cannot recognize this attribute and GCC 8 simply ignores it.
|
||||
# define NO_SANITIZE_UNDEFINED
|
||||
# define NO_SANITIZE_ADDRESS
|
||||
# define NO_SANITIZE_THREAD
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && !defined __clang__
|
||||
# define OPTIMIZE(x) __attribute__((__optimize__(x)))
|
||||
#else
|
||||
# define OPTIMIZE(x)
|
||||
#endif
|
||||
|
||||
/// A macro for suppressing warnings about unused variables or function results.
|
||||
/// Useful for structured bindings which have no standard way to declare this.
|
||||
#define UNUSED(...) (void)(__VA_ARGS__)
|
@ -30,7 +30,6 @@
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <type_traits>
|
||||
#include "likely.h"
|
||||
|
||||
using int128_t = __int128;
|
||||
using uint128_t = unsigned __int128;
|
||||
|
@ -1,15 +0,0 @@
|
||||
#if defined(_MSC_VER)
|
||||
# if !defined(likely)
|
||||
# define likely(x) (x)
|
||||
# endif
|
||||
# if !defined(unlikely)
|
||||
# define unlikely(x) (x)
|
||||
# endif
|
||||
#else
|
||||
# if !defined(likely)
|
||||
# define likely(x) (__builtin_expect(!!(x), 1))
|
||||
# endif
|
||||
# if !defined(unlikely)
|
||||
# define unlikely(x) (__builtin_expect(!!(x), 0))
|
||||
# endif
|
||||
#endif
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <new>
|
||||
#include "likely.h"
|
||||
#include "defines.h"
|
||||
|
||||
#if __has_include(<common/config_common.h>)
|
||||
#include <common/config_common.h>
|
||||
@ -19,27 +19,11 @@
|
||||
#include <cstdlib>
|
||||
#endif
|
||||
|
||||
// Also defined in Core/Defines.h
|
||||
#if !defined(ALWAYS_INLINE)
|
||||
#if defined(_MSC_VER)
|
||||
#define ALWAYS_INLINE inline __forceinline
|
||||
#else
|
||||
#define ALWAYS_INLINE inline __attribute__((__always_inline__))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(NO_INLINE)
|
||||
#if defined(_MSC_VER)
|
||||
#define NO_INLINE static __declspec(noinline)
|
||||
#else
|
||||
#define NO_INLINE __attribute__((__noinline__))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace Memory
|
||||
{
|
||||
|
||||
ALWAYS_INLINE void * newImpl(std::size_t size)
|
||||
inline ALWAYS_INLINE void * newImpl(std::size_t size)
|
||||
{
|
||||
auto * ptr = malloc(size);
|
||||
if (likely(ptr != nullptr))
|
||||
@ -49,19 +33,19 @@ ALWAYS_INLINE void * newImpl(std::size_t size)
|
||||
throw std::bad_alloc{};
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void * newNoExept(std::size_t size) noexcept
|
||||
inline ALWAYS_INLINE void * newNoExept(std::size_t size) noexcept
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void deleteImpl(void * ptr) noexcept
|
||||
inline ALWAYS_INLINE void deleteImpl(void * ptr) noexcept
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
#if USE_JEMALLOC
|
||||
|
||||
ALWAYS_INLINE void deleteSized(void * ptr, std::size_t size) noexcept
|
||||
inline ALWAYS_INLINE void deleteSized(void * ptr, std::size_t size) noexcept
|
||||
{
|
||||
if (unlikely(ptr == nullptr))
|
||||
return;
|
||||
@ -71,7 +55,7 @@ ALWAYS_INLINE void deleteSized(void * ptr, std::size_t size) noexcept
|
||||
|
||||
#else
|
||||
|
||||
ALWAYS_INLINE void deleteSized(void * ptr, std::size_t size [[maybe_unused]]) noexcept
|
||||
inline ALWAYS_INLINE void deleteSized(void * ptr, std::size_t size [[maybe_unused]]) noexcept
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <common/shift10.h>
|
||||
|
||||
#include <common/likely.h>
|
||||
#include "defines.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
/** Almost the same as x = x * exp10(exponent), but gives more accurate result.
|
||||
* Example:
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <string>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
|
||||
/** Set color in terminal based on 64-bit hash value.
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <Poco/Util/ServerApplication.h>
|
||||
#include <Poco/Net/SocketAddress.h>
|
||||
#include <Poco/Version.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <common/logger_useful.h>
|
||||
#include <common/getThreadId.h>
|
||||
#include <daemon/GraphiteWriter.h>
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <limits>
|
||||
|
||||
#include <common/preciseExp10.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <common/DateLUT.h>
|
||||
|
||||
#include <mysqlxx/Types.h>
|
||||
|
@ -1,23 +0,0 @@
|
||||
option (USE_INTERNAL_CCTZ_LIBRARY "Set to FALSE to use system cctz library instead of bundled" ${NOT_UNBUNDLED})
|
||||
|
||||
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/cctz/include/cctz/time_zone.h")
|
||||
if(USE_INTERNAL_CCTZ_LIBRARY)
|
||||
message(WARNING "submodule contrib/cctz is missing. to fix try run: \n git submodule update --init --recursive")
|
||||
endif()
|
||||
set(USE_INTERNAL_CCTZ_LIBRARY 0)
|
||||
set(MISSING_INTERNAL_CCTZ_LIBRARY 1)
|
||||
endif()
|
||||
|
||||
if (NOT USE_INTERNAL_CCTZ_LIBRARY)
|
||||
find_library (CCTZ_LIBRARY cctz)
|
||||
find_path (CCTZ_INCLUDE_DIR NAMES cctz/civil_time.h civil_time.h PATHS ${CCTZ_INCLUDE_PATHS})
|
||||
endif ()
|
||||
|
||||
if (CCTZ_LIBRARY AND CCTZ_INCLUDE_DIR)
|
||||
elseif (NOT MISSING_INTERNAL_CCTZ_LIBRARY)
|
||||
set (USE_INTERNAL_CCTZ_LIBRARY 1)
|
||||
set (CCTZ_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/cctz/include")
|
||||
set (CCTZ_LIBRARY cctz)
|
||||
endif ()
|
||||
|
||||
message (STATUS "Using cctz: ${CCTZ_INCLUDE_DIR} : ${CCTZ_LIBRARY}")
|
4
contrib/CMakeLists.txt
vendored
4
contrib/CMakeLists.txt
vendored
@ -75,9 +75,7 @@ if (USE_INTERNAL_ZLIB_LIBRARY)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (USE_INTERNAL_CCTZ_LIBRARY)
|
||||
add_subdirectory (cctz-cmake)
|
||||
endif ()
|
||||
add_subdirectory (cctz-cmake)
|
||||
|
||||
if (ENABLE_JEMALLOC AND USE_INTERNAL_JEMALLOC_LIBRARY)
|
||||
add_subdirectory (jemalloc-cmake)
|
||||
|
@ -1,31 +1,50 @@
|
||||
SET(LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/cctz)
|
||||
option (USE_INTERNAL_CCTZ "Use internal cctz library" ${NOT_UNBUNDLED})
|
||||
|
||||
add_library(cctz
|
||||
${LIBRARY_DIR}/src/civil_time_detail.cc
|
||||
${LIBRARY_DIR}/src/time_zone_fixed.cc
|
||||
${LIBRARY_DIR}/src/time_zone_format.cc
|
||||
${LIBRARY_DIR}/src/time_zone_if.cc
|
||||
${LIBRARY_DIR}/src/time_zone_impl.cc
|
||||
${LIBRARY_DIR}/src/time_zone_info.cc
|
||||
${LIBRARY_DIR}/src/time_zone_libc.cc
|
||||
${LIBRARY_DIR}/src/time_zone_lookup.cc
|
||||
${LIBRARY_DIR}/src/time_zone_posix.cc
|
||||
${LIBRARY_DIR}/src/zone_info_source.cc
|
||||
if (USE_INTERNAL_CCTZ)
|
||||
SET(LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/cctz)
|
||||
|
||||
${LIBRARY_DIR}/src/time_zone_libc.h
|
||||
${LIBRARY_DIR}/src/time_zone_if.h
|
||||
${LIBRARY_DIR}/src/tzfile.h
|
||||
${LIBRARY_DIR}/src/time_zone_impl.h
|
||||
${LIBRARY_DIR}/src/time_zone_posix.h
|
||||
${LIBRARY_DIR}/src/time_zone_info.h
|
||||
SET (SRCS
|
||||
${LIBRARY_DIR}/src/civil_time_detail.cc
|
||||
${LIBRARY_DIR}/src/time_zone_fixed.cc
|
||||
${LIBRARY_DIR}/src/time_zone_format.cc
|
||||
${LIBRARY_DIR}/src/time_zone_if.cc
|
||||
${LIBRARY_DIR}/src/time_zone_impl.cc
|
||||
${LIBRARY_DIR}/src/time_zone_info.cc
|
||||
${LIBRARY_DIR}/src/time_zone_libc.cc
|
||||
${LIBRARY_DIR}/src/time_zone_lookup.cc
|
||||
${LIBRARY_DIR}/src/time_zone_posix.cc
|
||||
${LIBRARY_DIR}/src/zone_info_source.cc
|
||||
)
|
||||
|
||||
${LIBRARY_DIR}/include/cctz/time_zone.h
|
||||
${LIBRARY_DIR}/include/cctz/civil_time_detail.h
|
||||
${LIBRARY_DIR}/include/cctz/civil_time.h)
|
||||
add_library (cctz ${SRCS})
|
||||
target_include_directories (cctz PUBLIC ${LIBRARY_DIR}/include)
|
||||
|
||||
if (CMAKE_SYSTEM MATCHES "FreeBSD")
|
||||
# yes, need linux, because bsd check inside linux in time_zone_libc.cc:24
|
||||
target_compile_definitions (cctz PRIVATE __USE_BSD linux _XOPEN_SOURCE=600)
|
||||
if (OS_FREEBSD)
|
||||
# yes, need linux, because bsd check inside linux in time_zone_libc.cc:24
|
||||
target_compile_definitions (cctz PRIVATE __USE_BSD linux _XOPEN_SOURCE=600)
|
||||
endif ()
|
||||
else ()
|
||||
find_library (LIBRARY_CCTZ cctz)
|
||||
find_path (INCLUDE_CCTZ NAMES cctz/civil_time.h)
|
||||
|
||||
add_library (cctz UNKNOWN IMPORTED)
|
||||
set_property (TARGET cctz PROPERTY IMPORTED_LOCATION ${LIBRARY_CCTZ})
|
||||
set_property (TARGET cctz PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INCLUDE_CCTZ})
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES cctz)
|
||||
check_cxx_source_compiles(
|
||||
"
|
||||
#include <cctz/civil_time.h>
|
||||
int main() {
|
||||
cctz::civil_day date;
|
||||
}
|
||||
"
|
||||
EXTERNAL_CCTZ_WORKS
|
||||
)
|
||||
|
||||
if (NOT EXTERNAL_CCTZ_WORKS)
|
||||
message (FATAL_ERROR "cctz is unusable: ${LIBRARY_CCTZ} ${INCLUDE_CCTZ}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
target_include_directories (cctz PUBLIC ${LIBRARY_DIR}/include)
|
||||
message (STATUS "Using cctz")
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <AggregateFunctions/IAggregateFunction.h>
|
||||
|
||||
#include <type_traits>
|
||||
#include <common/likely.h>
|
||||
|
||||
#define AGGREGATE_FUNCTION_GROUP_ARRAY_MAX_ARRAY_SIZE 0xFFFFFF
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <IO/WriteBuffer.h>
|
||||
#include <IO/ReadHelpers.h>
|
||||
#include <IO/WriteHelpers.h>
|
||||
#include <common/likely.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <algorithm>
|
||||
#include <climits>
|
||||
#include <sstream>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <IO/ReadBuffer.h>
|
||||
#include <IO/ReadHelpers.h>
|
||||
#include <IO/WriteHelpers.h>
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <climits>
|
||||
#include <sstream>
|
||||
#include <AggregateFunctions/ReservoirSampler.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <Common/HashTable/Hash.h>
|
||||
#include <IO/ReadBuffer.h>
|
||||
#include <IO/ReadHelpers.h>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
#include <IO/WriteBuffer.h>
|
||||
#include <IO/WriteHelpers.h>
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <common/likely.h>
|
||||
#if __has_include(<sanitizer/asan_interface.h>)
|
||||
# include <sanitizer/asan_interface.h>
|
||||
#endif
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <Poco/Mutex.h>
|
||||
#include <Poco/Semaphore.h>
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
|
||||
namespace detail
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <IO/WriteHelpers.h>
|
||||
|
||||
#include <Common/Exception.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
#include "CurrentThread.h"
|
||||
#include <common/logger_useful.h>
|
||||
#include <common/likely.h>
|
||||
#include <Common/ThreadStatus.h>
|
||||
#include <Common/TaskStatsInfoGetter.h>
|
||||
#include <Interpreters/ProcessList.h>
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <common/likely.h>
|
||||
#include <common/StringRef.h>
|
||||
#include <Common/ThreadStatus.h>
|
||||
|
||||
@ -107,4 +106,3 @@ private:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,6 @@
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <common/likely.h>
|
||||
|
||||
#include <Core/Defines.h>
|
||||
#include <Core/Types.h>
|
||||
#include <Common/Exception.h>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <Common/HyperLogLogBiasEstimator.h>
|
||||
#include <Common/CompactArray.h>
|
||||
#include <Common/HashTable/Hash.h>
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <Common/CurrentThread.h>
|
||||
#include <Common/Exception.h>
|
||||
#include <Common/formatReadable.h>
|
||||
#include <common/likely.h>
|
||||
#include <common/logger_useful.h>
|
||||
|
||||
#include <atomic>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <Common/CurrentMetrics.h>
|
||||
#include <Common/SimpleActionBlocker.h>
|
||||
#include <Common/VariableContext.h>
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <common/likely.h>
|
||||
#include <common/strong_typedef.h>
|
||||
|
||||
#include <Common/Allocator.h>
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <climits>
|
||||
#include <random>
|
||||
#include <functional>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <ext/scope_guard.h>
|
||||
#include <Core/Types.h>
|
||||
#include <Common/PoolBase.h>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <atomic>
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* (~ 700 MB/sec, 15 million strings per second)
|
||||
*/
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <common/unaligned.h>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <Common/Arena.h>
|
||||
#include <common/likely.h>
|
||||
#include <ext/range.h>
|
||||
#include <ext/size.h>
|
||||
#include <ext/bit_cast.h>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/time.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <future>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <string.h>
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
@ -21,7 +21,7 @@ inline char hexDigitLowercase(unsigned char c)
|
||||
#include <cstring>
|
||||
#include <cstddef>
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
|
||||
/// Maps 0..255 to 00..FF or 00..ff correspondingly
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <Poco/Net/IPAddress.h>
|
||||
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
namespace Memory
|
||||
{
|
||||
|
||||
ALWAYS_INLINE void trackMemory(std::size_t size)
|
||||
inline ALWAYS_INLINE void trackMemory(std::size_t size)
|
||||
{
|
||||
#if USE_JEMALLOC
|
||||
/// The nallocx() function allocates no memory, but it performs the same size computation as the mallocx() function
|
||||
@ -31,7 +31,7 @@ ALWAYS_INLINE void trackMemory(std::size_t size)
|
||||
#endif
|
||||
}
|
||||
|
||||
ALWAYS_INLINE bool trackMemoryNoExcept(std::size_t size) noexcept
|
||||
inline ALWAYS_INLINE bool trackMemoryNoExcept(std::size_t size) noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -45,7 +45,7 @@ ALWAYS_INLINE bool trackMemoryNoExcept(std::size_t size) noexcept
|
||||
return true;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void untrackMemory(void * ptr [[maybe_unused]], std::size_t size [[maybe_unused]] = 0) noexcept
|
||||
inline ALWAYS_INLINE void untrackMemory(void * ptr [[maybe_unused]], std::size_t size [[maybe_unused]] = 0) noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <Common/Exception.h>
|
||||
#include <Common/RWLock.h>
|
||||
#include <Common/Stopwatch.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <Common/ThreadPool.h>
|
||||
#include <random>
|
||||
#include <pcg_random.hpp>
|
||||
|
@ -6,8 +6,7 @@
|
||||
#include <algorithm>
|
||||
#include <Core/Defines.h>
|
||||
#include <Common/Stopwatch.h>
|
||||
#include <common/likely.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <common/unaligned.h>
|
||||
|
||||
#ifdef __SSE2__
|
||||
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/defines.h>
|
||||
|
||||
#define DBMS_DEFAULT_HOST "localhost"
|
||||
#define DBMS_DEFAULT_PORT 9000
|
||||
#define DBMS_DEFAULT_SECURE_PORT 9440
|
||||
@ -81,76 +83,6 @@
|
||||
|
||||
// more aliases: https://mailman.videolan.org/pipermail/x264-devel/2014-May/010660.html
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define ALWAYS_INLINE __forceinline
|
||||
#define NO_INLINE static __declspec(noinline)
|
||||
#define MAY_ALIAS
|
||||
#else
|
||||
#define ALWAYS_INLINE __attribute__((__always_inline__))
|
||||
#define NO_INLINE __attribute__((__noinline__))
|
||||
#define MAY_ALIAS __attribute__((__may_alias__))
|
||||
#endif
|
||||
|
||||
|
||||
#define PLATFORM_NOT_SUPPORTED "The only supported platforms are x86_64 and AArch64, PowerPC (work in progress)"
|
||||
|
||||
#if !defined(__x86_64__) && !defined(__aarch64__) && !defined(__PPC__)
|
||||
#error PLATFORM_NOT_SUPPORTED
|
||||
#endif
|
||||
|
||||
/// Check for presence of address sanitizer
|
||||
#if !defined(ADDRESS_SANITIZER)
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(address_sanitizer)
|
||||
#define ADDRESS_SANITIZER 1
|
||||
#endif
|
||||
#elif defined(__SANITIZE_ADDRESS__)
|
||||
#define ADDRESS_SANITIZER 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(THREAD_SANITIZER)
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(thread_sanitizer)
|
||||
#define THREAD_SANITIZER 1
|
||||
#endif
|
||||
#elif defined(__SANITIZE_THREAD__)
|
||||
#define THREAD_SANITIZER 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(MEMORY_SANITIZER)
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(memory_sanitizer)
|
||||
#define MEMORY_SANITIZER 1
|
||||
#endif
|
||||
#elif defined(__MEMORY_SANITIZER__)
|
||||
#define MEMORY_SANITIZER 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// TODO Strange enough, there is no way to detect UB sanitizer.
|
||||
|
||||
/// Explicitly allow undefined behaviour for certain functions. Use it as a function attribute.
|
||||
/// It is useful in case when compiler cannot see (and exploit) it, but UBSan can.
|
||||
/// Example: multiplication of signed integers with possibility of overflow when both sides are from user input.
|
||||
#if defined(__clang__)
|
||||
#define NO_SANITIZE_UNDEFINED __attribute__((__no_sanitize__("undefined")))
|
||||
#define NO_SANITIZE_ADDRESS __attribute__((__no_sanitize__("address")))
|
||||
#define NO_SANITIZE_THREAD __attribute__((__no_sanitize__("thread")))
|
||||
#else
|
||||
/// It does not work in GCC. GCC 7 cannot recognize this attribute and GCC 8 simply ignores it.
|
||||
#define NO_SANITIZE_UNDEFINED
|
||||
#define NO_SANITIZE_ADDRESS
|
||||
#define NO_SANITIZE_THREAD
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && !defined __clang__
|
||||
#define OPTIMIZE(x) __attribute__((__optimize__(x)))
|
||||
#else
|
||||
#define OPTIMIZE(x)
|
||||
#endif
|
||||
|
||||
/// Marks that extra information is sent to a shard. It could be any magic numbers.
|
||||
#define DBMS_DISTRIBUTED_SIGNATURE_HEADER 0xCAFEDACEull
|
||||
#define DBMS_DISTRIBUTED_SIGNATURE_HEADER_OLD_FORMAT 0xCAFECABEull
|
||||
@ -159,7 +91,3 @@
|
||||
# define ASAN_UNPOISON_MEMORY_REGION(a, b)
|
||||
# define ASAN_POISON_MEMORY_REGION(a, b)
|
||||
#endif
|
||||
|
||||
/// A macro for suppressing warnings about unused variables or function results.
|
||||
/// Useful for structured bindings which have no standard way to declare this.
|
||||
#define UNUSED(...) (void)(__VA_ARGS__)
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <Common/intExp.h>
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
|
@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
#include <cmath>
|
||||
|
||||
#include <common/likely.h>
|
||||
#include <Columns/ColumnDecimal.h>
|
||||
#include <Core/DecimalFunctions.h>
|
||||
#include <DataTypes/IDataType.h>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <Columns/IColumn.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
|
||||
using RegionID = UInt32;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include "GeodataProviders/IHierarchiesProvider.h"
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <vector>
|
||||
#include <Poco/Exception.h>
|
||||
#include <common/StringRef.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include "GeodataProviders/INamesProvider.h"
|
||||
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
#include <common/likely.h>
|
||||
#include <Common/Exception.h>
|
||||
#include <Common/config.h>
|
||||
#include <DataTypes/NumberTraits.h>
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <Functions/FunctionHelpers.h>
|
||||
#include <Functions/IFunctionImpl.h>
|
||||
#include <Common/typeid_cast.h>
|
||||
#include <common/likely.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include <IO/MemoryReadWriteBuffer.h>
|
||||
#include <common/likely.h>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <atomic>
|
||||
#include <cstddef>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
#include <Core/Defines.h>
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include <Core/Defines.h>
|
||||
#include <IO/WriteBuffer.h>
|
||||
#include <common/itoa.h>
|
||||
#include <common/likely.h>
|
||||
|
||||
/// 40 digits or 39 digits and a sign
|
||||
#define WRITE_HELPERS_MAX_INT_WIDTH 40U
|
||||
|
@ -2,7 +2,6 @@
|
||||
#include <IO/ReadHelpers.h>
|
||||
#include <Core/Defines.h>
|
||||
#include <common/shift10.h>
|
||||
#include <common/likely.h>
|
||||
#include <Common/StringUtils/StringUtils.h>
|
||||
#include <double-conversion/double-conversion.h>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
#include <IO/ReadHelpers.h>
|
||||
#include <IO/WriteHelpers.h>
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include <Core/Defines.h>
|
||||
#include <Processors/Chunk.h>
|
||||
#include <Common/Exception.h>
|
||||
#include <common/likely.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
# docker build -t yandex/clickhouse-stateless-test .
|
||||
# docker build -t yandex/clickhouse-stateless-test .
|
||||
FROM yandex/clickhouse-deb-builder
|
||||
|
||||
ARG odbc_driver_url="https://github.com/ClickHouse/clickhouse-odbc/releases/download/v1.1.4.20200302/clickhouse-odbc-1.1.4-Linux.tar.gz"
|
||||
|
@ -1,8 +1,7 @@
|
||||
#include <lz4.h>
|
||||
#include <string.h>
|
||||
#include <optional>
|
||||
#include <common/likely.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
#include <IO/ReadBuffer.h>
|
||||
#include <IO/ReadBufferFromFileDescriptor.h>
|
||||
|
@ -1,8 +1,7 @@
|
||||
#include <string.h>
|
||||
#include <random>
|
||||
#include <pcg_random.hpp>
|
||||
#include <common/likely.h>
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
|
||||
#include <IO/ReadBuffer.h>
|
||||
#include <IO/ReadBufferFromFileDescriptor.h>
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <emmintrin.h>
|
||||
#endif
|
||||
|
||||
#include <common/Types.h>
|
||||
#include <common/types.h>
|
||||
#include <IO/ReadHelpers.h>
|
||||
#include <IO/ReadBufferFromFileDescriptor.h>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user