mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Merge branch 'master' into optimize_uniq_to_count2
This commit is contained in:
commit
826f7ac7eb
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -257,6 +257,9 @@
|
||||
[submodule "contrib/corrosion"]
|
||||
path = contrib/corrosion
|
||||
url = https://github.com/corrosion-rs/corrosion
|
||||
[submodule "contrib/libssh"]
|
||||
path = contrib/libssh
|
||||
url = https://github.com/ClickHouse/libssh.git
|
||||
[submodule "contrib/morton-nd"]
|
||||
path = contrib/morton-nd
|
||||
url = https://github.com/morton-nd/morton-nd
|
||||
|
@ -318,7 +318,16 @@ set (COMPILER_FLAGS "${COMPILER_FLAGS}")
|
||||
# Our built-in unwinder only supports DWARF version up to 4.
|
||||
set (DEBUG_INFO_FLAGS "-g -gdwarf-4")
|
||||
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS}")
|
||||
# Disable omit frame pointer compiler optimization using -fno-omit-frame-pointer
|
||||
option(DISABLE_OMIT_FRAME_POINTER "Disable omit frame pointer compiler optimization" OFF)
|
||||
|
||||
if (DISABLE_OMIT_FRAME_POINTER)
|
||||
set (CMAKE_CXX_FLAGS_ADD "${CMAKE_CXX_FLAGS_ADD} -fno-omit-frame-pointer")
|
||||
set (CMAKE_C_FLAGS_ADD "${CMAKE_C_FLAGS_ADD} -fno-omit-frame-pointer")
|
||||
set (CMAKE_ASM_FLAGS_ADD "${CMAKE_ASM_FLAGS_ADD} -fno-omit-frame-pointer")
|
||||
endif()
|
||||
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS} ${CMAKE_CXX_FLAGS_ADD}")
|
||||
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 ${DEBUG_INFO_FLAGS} ${CMAKE_CXX_FLAGS_ADD}")
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 ${DEBUG_INFO_FLAGS} ${CMAKE_CXX_FLAGS_ADD}")
|
||||
|
||||
|
@ -289,3 +289,13 @@ inline void writeBinByte(UInt8 byte, void * out)
|
||||
{
|
||||
memcpy(out, &impl::bin_byte_to_char_table[static_cast<size_t>(byte) * 8], 8);
|
||||
}
|
||||
|
||||
/// Converts byte array to a hex string. Useful for debug logging.
|
||||
inline std::string hexString(const void * data, size_t size)
|
||||
{
|
||||
const char * p = reinterpret_cast<const char *>(data);
|
||||
std::string s(size * 2, '\0');
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
writeHexByteLowercase(p[i], s.data() + i * 2);
|
||||
return s;
|
||||
}
|
||||
|
@ -131,3 +131,29 @@ void sort(RandomIt first, RandomIt last)
|
||||
using comparator = std::less<value_type>;
|
||||
::sort(first, last, comparator());
|
||||
}
|
||||
|
||||
/** Try to fast sort elements for common sorting patterns:
|
||||
* 1. If elements are already sorted.
|
||||
* 2. If elements are already almost sorted.
|
||||
* 3. If elements are already sorted in reverse order.
|
||||
*
|
||||
* Returns true if fast sort was performed or elements were already sorted, false otherwise.
|
||||
*/
|
||||
template <typename RandomIt, typename Compare>
|
||||
bool trySort(RandomIt first, RandomIt last, Compare compare)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
::shuffle(first, last);
|
||||
#endif
|
||||
|
||||
ComparatorWrapper<Compare> compare_wrapper = compare;
|
||||
return ::pdqsort_try_sort(first, last, compare_wrapper);
|
||||
}
|
||||
|
||||
template <typename RandomIt>
|
||||
bool trySort(RandomIt first, RandomIt last)
|
||||
{
|
||||
using value_type = typename std::iterator_traits<RandomIt>::value_type;
|
||||
using comparator = std::less<value_type>;
|
||||
return ::trySort(first, last, comparator());
|
||||
}
|
||||
|
@ -75,9 +75,11 @@ endif ()
|
||||
|
||||
if (LINKER_NAME)
|
||||
message(STATUS "Using linker: ${LINKER_NAME}")
|
||||
else()
|
||||
elseif (NOT ARCH_S390X AND NOT OS_FREEBSD)
|
||||
message (FATAL_ERROR "The only supported linker is LLVM's LLD, but we cannot find it.")
|
||||
else ()
|
||||
message(STATUS "Using linker: <default>")
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
# Archiver
|
||||
|
||||
|
2
contrib/CMakeLists.txt
vendored
2
contrib/CMakeLists.txt
vendored
@ -212,6 +212,8 @@ add_contrib (libbcrypt-cmake libbcrypt)
|
||||
add_contrib (google-benchmark-cmake google-benchmark)
|
||||
add_contrib (ulid-c-cmake ulid-c)
|
||||
|
||||
add_contrib (libssh-cmake libssh)
|
||||
|
||||
# Put all targets defined here and in subdirectories under "contrib/<immediate-subdir>" folders in GUI-based IDEs.
|
||||
# Some of third-party projects may override CMAKE_FOLDER or FOLDER property of their targets, so they would not appear
|
||||
# in "contrib/..." as originally planned, so we workaround this by fixing FOLDER properties of all targets manually,
|
||||
|
1
contrib/libssh
vendored
Submodule
1
contrib/libssh
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit acea3e2d5ad6e22f52961b43411b4ed2d9224b9e
|
77
contrib/libssh-cmake/CMakeLists.txt
Normal file
77
contrib/libssh-cmake/CMakeLists.txt
Normal file
@ -0,0 +1,77 @@
|
||||
set(LIB_SOURCE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libssh")
|
||||
set(LIB_BINARY_DIR "${ClickHouse_BINARY_DIR}/contrib/libssh")
|
||||
# Specify search path for CMake modules to be loaded by include()
|
||||
# and find_package()
|
||||
list(APPEND CMAKE_MODULE_PATH "${LIB_SOURCE_DIR}/cmake/Modules")
|
||||
|
||||
include(DefineCMakeDefaults)
|
||||
include(DefineCompilerFlags)
|
||||
|
||||
project(libssh VERSION 0.9.7 LANGUAGES C)
|
||||
|
||||
# global needed variable
|
||||
set(APPLICATION_NAME ${PROJECT_NAME})
|
||||
|
||||
# SOVERSION scheme: CURRENT.AGE.REVISION
|
||||
# If there was an incompatible interface change:
|
||||
# Increment CURRENT. Set AGE and REVISION to 0
|
||||
# If there was a compatible interface change:
|
||||
# Increment AGE. Set REVISION to 0
|
||||
# If the source code was changed, but there were no interface changes:
|
||||
# Increment REVISION.
|
||||
set(LIBRARY_VERSION "4.8.7")
|
||||
set(LIBRARY_SOVERSION "4")
|
||||
|
||||
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
|
||||
|
||||
# add definitions
|
||||
|
||||
include(DefinePlatformDefaults)
|
||||
|
||||
# Copy library files to a lib sub-directory
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${LIB_BINARY_DIR}/lib")
|
||||
|
||||
set(CMAKE_THREAD_PREFER_PTHREADS ON)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
|
||||
set(WITH_ZLIB OFF)
|
||||
set(WITH_SYMBOL_VERSIONING OFF)
|
||||
set(WITH_SERVER ON)
|
||||
|
||||
include(IncludeSources.cmake)
|
||||
if (OS_LINUX)
|
||||
if (ARCH_AMD64)
|
||||
if (USE_MUSL)
|
||||
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/linux/x86-64-musl")
|
||||
else()
|
||||
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/linux/x86-64")
|
||||
endif ()
|
||||
elseif (ARCH_AARCH64)
|
||||
if (USE_MUSL)
|
||||
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/linux/aarch64-musl")
|
||||
else()
|
||||
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/linux/aarch64")
|
||||
endif ()
|
||||
elseif (ARCH_PPC64LE)
|
||||
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/linux/ppc64le")
|
||||
elseif (ARCH_S390X)
|
||||
# Like ppc64le but with HAVE_OPENSSL_FIPS_MODE undefined. This is because the OpenSSL used by s390x doesn't support
|
||||
# FIPS_mode(). Besides that, the custom s390x/config.h only exists to make things compile without additional ifdefs.
|
||||
# With high probability, libssl with OpenSSL on s390x is broken.
|
||||
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/linux/s390x")
|
||||
elseif (ARCH_RISCV64)
|
||||
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/linux/riscv64")
|
||||
else ()
|
||||
message(FATAL_ERROR "Platform is not supported")
|
||||
endif ()
|
||||
elseif (OS_DARWIN)
|
||||
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/darwin")
|
||||
elseif (OS_FREEBSD)
|
||||
target_include_directories(_ssh PRIVATE "${ClickHouse_SOURCE_DIR}/contrib/libssh-cmake/freebsd")
|
||||
else ()
|
||||
message(FATAL_ERROR "Platform is not supported")
|
||||
endif()
|
||||
|
||||
configure_file(${LIB_SOURCE_DIR}/include/libssh/libssh_version.h.cmake
|
||||
${LIB_BINARY_DIR}/include/libssh/libssh_version.h
|
||||
@ONLY)
|
141
contrib/libssh-cmake/IncludeSources.cmake
Normal file
141
contrib/libssh-cmake/IncludeSources.cmake
Normal file
@ -0,0 +1,141 @@
|
||||
set(LIBSSH_LINK_LIBRARIES
|
||||
${LIBSSH_REQUIRED_LIBRARIES}
|
||||
)
|
||||
|
||||
|
||||
set(LIBSSH_LINK_LIBRARIES
|
||||
${LIBSSH_LINK_LIBRARIES}
|
||||
OpenSSL::Crypto
|
||||
)
|
||||
|
||||
if (MINGW AND Threads_FOUND)
|
||||
set(LIBSSH_LINK_LIBRARIES
|
||||
${LIBSSH_LINK_LIBRARIES}
|
||||
Threads::Threads
|
||||
)
|
||||
endif()
|
||||
|
||||
set(libssh_SRCS
|
||||
${LIB_SOURCE_DIR}/src/agent.c
|
||||
${LIB_SOURCE_DIR}/src/auth.c
|
||||
${LIB_SOURCE_DIR}/src/base64.c
|
||||
${LIB_SOURCE_DIR}/src/bignum.c
|
||||
${LIB_SOURCE_DIR}/src/buffer.c
|
||||
${LIB_SOURCE_DIR}/src/callbacks.c
|
||||
${LIB_SOURCE_DIR}/src/channels.c
|
||||
${LIB_SOURCE_DIR}/src/client.c
|
||||
${LIB_SOURCE_DIR}/src/config.c
|
||||
${LIB_SOURCE_DIR}/src/connect.c
|
||||
${LIB_SOURCE_DIR}/src/connector.c
|
||||
${LIB_SOURCE_DIR}/src/curve25519.c
|
||||
${LIB_SOURCE_DIR}/src/dh.c
|
||||
${LIB_SOURCE_DIR}/src/ecdh.c
|
||||
${LIB_SOURCE_DIR}/src/error.c
|
||||
${LIB_SOURCE_DIR}/src/getpass.c
|
||||
${LIB_SOURCE_DIR}/src/init.c
|
||||
${LIB_SOURCE_DIR}/src/kdf.c
|
||||
${LIB_SOURCE_DIR}/src/kex.c
|
||||
${LIB_SOURCE_DIR}/src/known_hosts.c
|
||||
${LIB_SOURCE_DIR}/src/knownhosts.c
|
||||
${LIB_SOURCE_DIR}/src/legacy.c
|
||||
${LIB_SOURCE_DIR}/src/log.c
|
||||
${LIB_SOURCE_DIR}/src/match.c
|
||||
${LIB_SOURCE_DIR}/src/messages.c
|
||||
${LIB_SOURCE_DIR}/src/misc.c
|
||||
${LIB_SOURCE_DIR}/src/options.c
|
||||
${LIB_SOURCE_DIR}/src/packet.c
|
||||
${LIB_SOURCE_DIR}/src/packet_cb.c
|
||||
${LIB_SOURCE_DIR}/src/packet_crypt.c
|
||||
${LIB_SOURCE_DIR}/src/pcap.c
|
||||
${LIB_SOURCE_DIR}/src/pki.c
|
||||
${LIB_SOURCE_DIR}/src/pki_container_openssh.c
|
||||
${LIB_SOURCE_DIR}/src/poll.c
|
||||
${LIB_SOURCE_DIR}/src/session.c
|
||||
${LIB_SOURCE_DIR}/src/scp.c
|
||||
${LIB_SOURCE_DIR}/src/socket.c
|
||||
${LIB_SOURCE_DIR}/src/string.c
|
||||
${LIB_SOURCE_DIR}/src/threads.c
|
||||
${LIB_SOURCE_DIR}/src/wrapper.c
|
||||
${LIB_SOURCE_DIR}/src/external/bcrypt_pbkdf.c
|
||||
${LIB_SOURCE_DIR}/src/external/blowfish.c
|
||||
${LIB_SOURCE_DIR}/src/external/chacha.c
|
||||
${LIB_SOURCE_DIR}/src/external/poly1305.c
|
||||
${LIB_SOURCE_DIR}/src/chachapoly.c
|
||||
${LIB_SOURCE_DIR}/src/config_parser.c
|
||||
${LIB_SOURCE_DIR}/src/token.c
|
||||
${LIB_SOURCE_DIR}/src/pki_ed25519_common.c
|
||||
)
|
||||
|
||||
if (DEFAULT_C_NO_DEPRECATION_FLAGS)
|
||||
set_source_files_properties(known_hosts.c
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS ${DEFAULT_C_NO_DEPRECATION_FLAGS})
|
||||
endif()
|
||||
|
||||
if (CMAKE_USE_PTHREADS_INIT)
|
||||
set(libssh_SRCS
|
||||
${libssh_SRCS}
|
||||
${LIB_SOURCE_DIR}/src/threads/noop.c
|
||||
${LIB_SOURCE_DIR}/src/threads/pthread.c
|
||||
)
|
||||
elseif (CMAKE_USE_WIN32_THREADS_INIT)
|
||||
set(libssh_SRCS
|
||||
${libssh_SRCS}
|
||||
${LIB_SOURCE_DIR}/src/threads/noop.c
|
||||
${LIB_SOURCE_DIR}/src/threads/winlocks.c
|
||||
)
|
||||
else()
|
||||
set(libssh_SRCS
|
||||
${libssh_SRCS}
|
||||
${LIB_SOURCE_DIR}/src/threads/noop.c
|
||||
)
|
||||
endif()
|
||||
|
||||
# LIBCRYPT specific
|
||||
set(libssh_SRCS
|
||||
${libssh_SRCS}
|
||||
${LIB_SOURCE_DIR}/src/threads/libcrypto.c
|
||||
${LIB_SOURCE_DIR}/src/pki_crypto.c
|
||||
${LIB_SOURCE_DIR}/src/ecdh_crypto.c
|
||||
${LIB_SOURCE_DIR}/src/libcrypto.c
|
||||
${LIB_SOURCE_DIR}/src/dh_crypto.c
|
||||
)
|
||||
|
||||
# see the comment on s390x in libssh-cmake/CMakeLists.txt
|
||||
if(OPENSSL_VERSION VERSION_LESS "1.1.0" AND NOT ARCH_S390X)
|
||||
set(libssh_SRCS ${libssh_SRCS} ${LIB_SOURCE_DIR}/src/libcrypto-compat.c)
|
||||
endif()
|
||||
|
||||
set(libssh_SRCS
|
||||
${libssh_SRCS}
|
||||
${LIB_SOURCE_DIR}/src/options.c
|
||||
${LIB_SOURCE_DIR}/src/server.c
|
||||
${LIB_SOURCE_DIR}/src/bind.c
|
||||
${LIB_SOURCE_DIR}/src/bind_config.c
|
||||
)
|
||||
|
||||
|
||||
add_library(_ssh STATIC ${libssh_SRCS})
|
||||
|
||||
target_include_directories(_ssh PRIVATE ${LIB_BINARY_DIR})
|
||||
target_include_directories(_ssh PUBLIC "${LIB_SOURCE_DIR}/include" "${LIB_BINARY_DIR}/include")
|
||||
target_link_libraries(_ssh
|
||||
PRIVATE ${LIBSSH_LINK_LIBRARIES})
|
||||
|
||||
add_library(ch_contrib::ssh ALIAS _ssh)
|
||||
|
||||
target_compile_options(_ssh
|
||||
PRIVATE
|
||||
${DEFAULT_C_COMPILE_FLAGS}
|
||||
-D_GNU_SOURCE)
|
||||
|
||||
|
||||
set_target_properties(_ssh
|
||||
PROPERTIES
|
||||
VERSION
|
||||
${LIBRARY_VERSION}
|
||||
SOVERSION
|
||||
${LIBRARY_SOVERSION}
|
||||
DEFINE_SYMBOL
|
||||
LIBSSH_EXPORTS
|
||||
)
|
285
contrib/libssh-cmake/darwin/config.h
Normal file
285
contrib/libssh-cmake/darwin/config.h
Normal file
@ -0,0 +1,285 @@
|
||||
/* Name of package */
|
||||
#define PACKAGE "libssh"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.9.7"
|
||||
|
||||
#define SYSCONFDIR "etc"
|
||||
#define BINARYDIR "/home/ubuntu/workdir/ClickHouse/build/darwin"
|
||||
#define SOURCEDIR "/home/ubuntu/workdir/ClickHouse"
|
||||
|
||||
/* Global bind configuration file path */
|
||||
#define GLOBAL_BIND_CONFIG "/etc/ssh/libssh_server_config"
|
||||
|
||||
/* Global client configuration file path */
|
||||
#define GLOBAL_CLIENT_CONFIG "/etc/ssh/ssh_config"
|
||||
|
||||
/************************** HEADER FILES *************************/
|
||||
|
||||
/* Define to 1 if you have the <argp.h> header file. */
|
||||
/* #undef HAVE_ARGP_H */
|
||||
|
||||
/* Define to 1 if you have the <aprpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <glob.h> header file. */
|
||||
#define HAVE_GLOB_H 1
|
||||
|
||||
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
|
||||
/* #undef HAVE_VALGRIND_VALGRIND_H */
|
||||
|
||||
/* Define to 1 if you have the <pty.h> header file. */
|
||||
/* #undef HAVE_PTY_H */
|
||||
|
||||
/* Define to 1 if you have the <utmp.h> header file. */
|
||||
#define HAVE_UTMP_H 1
|
||||
|
||||
/* Define to 1 if you have the <util.h> header file. */
|
||||
#define HAVE_UTIL_H 1
|
||||
|
||||
/* Define to 1 if you have the <libutil.h> header file. */
|
||||
/* #undef HAVE_LIBUTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/aes.h> header file. */
|
||||
#define HAVE_OPENSSL_AES_H 1
|
||||
|
||||
/* Define to 1 if you have the <wspiapi.h> header file. */
|
||||
/* #undef HAVE_WSPIAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/blowfish.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_BLOWFISH_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/des.h> header file. */
|
||||
#define HAVE_OPENSSL_DES_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdh.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDH_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ec.h> header file. */
|
||||
#define HAVE_OPENSSL_EC_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdsa.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#define HAVE_PTHREAD_H 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in openssl */
|
||||
#define HAVE_OPENSSL_ECC 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in gcrypt */
|
||||
/* #undef HAVE_GCRYPT_ECC */
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography */
|
||||
#define HAVE_ECC 1
|
||||
|
||||
/* Define to 1 if you have DSA */
|
||||
/* #undef HAVE_DSA */
|
||||
|
||||
/* Define to 1 if you have gl_flags as a glob_t sturct member */
|
||||
#define HAVE_GLOB_GL_FLAGS_MEMBER 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with Ed25519 support */
|
||||
#define HAVE_OPENSSL_ED25519 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with X25519 support */
|
||||
#define HAVE_OPENSSL_X25519 1
|
||||
|
||||
/*************************** FUNCTIONS ***************************/
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CTR 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_cbc' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CBC 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_gcm' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_AES_GCM */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
|
||||
#define HAVE_OPENSSL_EVP_CIPHER_CTX_NEW 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_KDF_CTX_new_id' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID */
|
||||
|
||||
/* Define to 1 if you have the `FIPS_mode' function. */
|
||||
#define HAVE_OPENSSL_FIPS_MODE 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestSign' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTSIGN 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestVerify' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTVERIFY 1
|
||||
|
||||
/* Define to 1 if you have the `OPENSSL_ia32cap_loc' function. */
|
||||
/* #undef HAVE_OPENSSL_IA32CAP_LOC */
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_snprintf' function. */
|
||||
/* #undef HAVE__SNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_snprintf_s' function. */
|
||||
/* #undef HAVE__SNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf' function. */
|
||||
/* #undef HAVE__VSNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf_s' function. */
|
||||
/* #undef HAVE__VSNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `isblank' function. */
|
||||
#define HAVE_ISBLANK 1
|
||||
|
||||
/* Define to 1 if you have the `strncpy' function. */
|
||||
#define HAVE_STRNCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strndup' function. */
|
||||
#define HAVE_STRNDUP 1
|
||||
|
||||
/* Define to 1 if you have the `cfmakeraw' function. */
|
||||
/* #undef HAVE_CFMAKERAW */
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
/* #undef HAVE_CLOCK_GETTIME */
|
||||
|
||||
/* Define to 1 if you have the `ntohll' function. */
|
||||
#define HAVE_NTOHLL 1
|
||||
|
||||
/* Define to 1 if you have the `htonll' function. */
|
||||
#define HAVE_HTONLL 1
|
||||
|
||||
/* Define to 1 if you have the `strtoull' function. */
|
||||
#define HAVE_STRTOULL 1
|
||||
|
||||
/* Define to 1 if you have the `__strtoull' function. */
|
||||
/* #undef HAVE___STRTOULL */
|
||||
|
||||
/* Define to 1 if you have the `_strtoui64' function. */
|
||||
/* #undef HAVE__STRTOUI64 */
|
||||
|
||||
/* Define to 1 if you have the `glob' function. */
|
||||
#define HAVE_GLOB 1
|
||||
|
||||
/* Define to 1 if you have the `explicit_bzero' function. */
|
||||
/* #undef HAVE_EXPLICIT_BZERO */
|
||||
|
||||
/* Define to 1 if you have the `memset_s' function. */
|
||||
#define HAVE_MEMSET_S 1
|
||||
|
||||
/* Define to 1 if you have the `SecureZeroMemory' function. */
|
||||
/* #undef HAVE_SECURE_ZERO_MEMORY */
|
||||
|
||||
/* Define to 1 if you have the `cmocka_set_test_filter' function. */
|
||||
/* #undef HAVE_CMOCKA_SET_TEST_FILTER */
|
||||
|
||||
/*************************** LIBRARIES ***************************/
|
||||
|
||||
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
|
||||
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
|
||||
/* #undef HAVE_LIBGCRYPT */
|
||||
|
||||
/* Define to 1 if you have the 'mbedTLS' library (-lmbedtls). */
|
||||
/* #undef HAVE_LIBMBEDCRYPTO */
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#define HAVE_PTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `cmocka' library (-lcmocka). */
|
||||
/* #undef HAVE_CMOCKA */
|
||||
|
||||
/**************************** OPTIONS ****************************/
|
||||
|
||||
#define HAVE_GCC_THREAD_LOCAL_STORAGE 1
|
||||
/* #undef HAVE_MSC_THREAD_LOCAL_STORAGE */
|
||||
|
||||
#define HAVE_FALLTHROUGH_ATTRIBUTE 1
|
||||
#define HAVE_UNUSED_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
||||
#define HAVE_DESTRUCTOR_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
|
||||
|
||||
#define HAVE_COMPILER__FUNC__ 1
|
||||
#define HAVE_COMPILER__FUNCTION__ 1
|
||||
|
||||
/* #undef HAVE_GCC_BOUNDED_ATTRIBUTE */
|
||||
|
||||
/* Define to 1 if you want to enable GSSAPI */
|
||||
/* #undef WITH_GSSAPI */
|
||||
|
||||
/* Define to 1 if you want to enable ZLIB */
|
||||
/* #undef WITH_ZLIB */
|
||||
|
||||
/* Define to 1 if you want to enable SFTP */
|
||||
/* #undef WITH_SFTP */
|
||||
|
||||
/* Define to 1 if you want to enable server support */
|
||||
#define WITH_SERVER 1
|
||||
|
||||
/* Define to 1 if you want to enable DH group exchange algorithms */
|
||||
/* #undef WITH_GEX */
|
||||
|
||||
/* Define to 1 if you want to enable blowfish cipher support */
|
||||
/* #undef WITH_BLOWFISH_CIPHER */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for crypto functions */
|
||||
/* #undef DEBUG_CRYPTO */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for packet functions */
|
||||
/* #undef DEBUG_PACKET */
|
||||
|
||||
/* Define to 1 if you want to enable pcap output support (experimental) */
|
||||
/* #undef WITH_PCAP */
|
||||
|
||||
/* Define to 1 if you want to enable calltrace debug output */
|
||||
/* #undef DEBUG_CALLTRACE */
|
||||
|
||||
/* Define to 1 if you want to enable NaCl support */
|
||||
/* #undef WITH_NACL */
|
||||
|
||||
/*************************** ENDIAN *****************************/
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
285
contrib/libssh-cmake/freebsd/config.h
Normal file
285
contrib/libssh-cmake/freebsd/config.h
Normal file
@ -0,0 +1,285 @@
|
||||
/* Name of package */
|
||||
#define PACKAGE "libssh"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.9.7"
|
||||
|
||||
#define SYSCONFDIR "etc"
|
||||
#define BINARYDIR "/home/ubuntu/workdir/ClickHouse/build/freebsd"
|
||||
#define SOURCEDIR "/home/ubuntu/workdir/ClickHouse"
|
||||
|
||||
/* Global bind configuration file path */
|
||||
#define GLOBAL_BIND_CONFIG "/etc/ssh/libssh_server_config"
|
||||
|
||||
/* Global client configuration file path */
|
||||
#define GLOBAL_CLIENT_CONFIG "/etc/ssh/ssh_config"
|
||||
|
||||
/************************** HEADER FILES *************************/
|
||||
|
||||
/* Define to 1 if you have the <argp.h> header file. */
|
||||
/* #undef HAVE_ARGP_H */
|
||||
|
||||
/* Define to 1 if you have the <aprpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <glob.h> header file. */
|
||||
#define HAVE_GLOB_H 1
|
||||
|
||||
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
|
||||
/* #undef HAVE_VALGRIND_VALGRIND_H */
|
||||
|
||||
/* Define to 1 if you have the <pty.h> header file. */
|
||||
/* #undef HAVE_PTY_H */
|
||||
|
||||
/* Define to 1 if you have the <utmp.h> header file. */
|
||||
/* #undef HAVE_UTMP_H */
|
||||
|
||||
/* Define to 1 if you have the <util.h> header file. */
|
||||
/* #undef HAVE_UTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <libutil.h> header file. */
|
||||
/* #undef HAVE_LIBUTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/aes.h> header file. */
|
||||
#define HAVE_OPENSSL_AES_H 1
|
||||
|
||||
/* Define to 1 if you have the <wspiapi.h> header file. */
|
||||
/* #undef HAVE_WSPIAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/blowfish.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_BLOWFISH_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/des.h> header file. */
|
||||
#define HAVE_OPENSSL_DES_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdh.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDH_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ec.h> header file. */
|
||||
#define HAVE_OPENSSL_EC_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdsa.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#define HAVE_PTHREAD_H 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in openssl */
|
||||
#define HAVE_OPENSSL_ECC 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in gcrypt */
|
||||
/* #undef HAVE_GCRYPT_ECC */
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography */
|
||||
#define HAVE_ECC 1
|
||||
|
||||
/* Define to 1 if you have DSA */
|
||||
/* #undef HAVE_DSA */
|
||||
|
||||
/* Define to 1 if you have gl_flags as a glob_t sturct member */
|
||||
#define HAVE_GLOB_GL_FLAGS_MEMBER 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with Ed25519 support */
|
||||
#define HAVE_OPENSSL_ED25519 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with X25519 support */
|
||||
#define HAVE_OPENSSL_X25519 1
|
||||
|
||||
/*************************** FUNCTIONS ***************************/
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CTR 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_cbc' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CBC 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_gcm' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_AES_GCM */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
|
||||
#define HAVE_OPENSSL_EVP_CIPHER_CTX_NEW 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_KDF_CTX_new_id' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID */
|
||||
|
||||
/* Define to 1 if you have the `FIPS_mode' function. */
|
||||
#define HAVE_OPENSSL_FIPS_MODE 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestSign' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTSIGN 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestVerify' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTVERIFY 1
|
||||
|
||||
/* Define to 1 if you have the `OPENSSL_ia32cap_loc' function. */
|
||||
/* #undef HAVE_OPENSSL_IA32CAP_LOC */
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_snprintf' function. */
|
||||
/* #undef HAVE__SNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_snprintf_s' function. */
|
||||
/* #undef HAVE__SNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf' function. */
|
||||
/* #undef HAVE__VSNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf_s' function. */
|
||||
/* #undef HAVE__VSNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `isblank' function. */
|
||||
#define HAVE_ISBLANK 1
|
||||
|
||||
/* Define to 1 if you have the `strncpy' function. */
|
||||
#define HAVE_STRNCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strndup' function. */
|
||||
#define HAVE_STRNDUP 1
|
||||
|
||||
/* Define to 1 if you have the `cfmakeraw' function. */
|
||||
/* #undef HAVE_CFMAKERAW */
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
/* #undef HAVE_CLOCK_GETTIME */
|
||||
|
||||
/* Define to 1 if you have the `ntohll' function. */
|
||||
/* #undef HAVE_NTOHLL */
|
||||
|
||||
/* Define to 1 if you have the `htonll' function. */
|
||||
/* #undef HAVE_HTONLL */
|
||||
|
||||
/* Define to 1 if you have the `strtoull' function. */
|
||||
#define HAVE_STRTOULL 1
|
||||
|
||||
/* Define to 1 if you have the `__strtoull' function. */
|
||||
/* #undef HAVE___STRTOULL */
|
||||
|
||||
/* Define to 1 if you have the `_strtoui64' function. */
|
||||
/* #undef HAVE__STRTOUI64 */
|
||||
|
||||
/* Define to 1 if you have the `glob' function. */
|
||||
#define HAVE_GLOB 1
|
||||
|
||||
/* Define to 1 if you have the `explicit_bzero' function. */
|
||||
#define HAVE_EXPLICIT_BZERO 1
|
||||
|
||||
/* Define to 1 if you have the `memset_s' function. */
|
||||
/* #undef HAVE_MEMSET_S */
|
||||
|
||||
/* Define to 1 if you have the `SecureZeroMemory' function. */
|
||||
/* #undef HAVE_SECURE_ZERO_MEMORY */
|
||||
|
||||
/* Define to 1 if you have the `cmocka_set_test_filter' function. */
|
||||
/* #undef HAVE_CMOCKA_SET_TEST_FILTER */
|
||||
|
||||
/*************************** LIBRARIES ***************************/
|
||||
|
||||
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
|
||||
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
|
||||
/* #undef HAVE_LIBGCRYPT */
|
||||
|
||||
/* Define to 1 if you have the 'mbedTLS' library (-lmbedtls). */
|
||||
/* #undef HAVE_LIBMBEDCRYPTO */
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#define HAVE_PTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `cmocka' library (-lcmocka). */
|
||||
/* #undef HAVE_CMOCKA */
|
||||
|
||||
/**************************** OPTIONS ****************************/
|
||||
|
||||
#define HAVE_GCC_THREAD_LOCAL_STORAGE 1
|
||||
/* #undef HAVE_MSC_THREAD_LOCAL_STORAGE */
|
||||
|
||||
#define HAVE_FALLTHROUGH_ATTRIBUTE 1
|
||||
#define HAVE_UNUSED_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
||||
#define HAVE_DESTRUCTOR_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
|
||||
|
||||
#define HAVE_COMPILER__FUNC__ 1
|
||||
#define HAVE_COMPILER__FUNCTION__ 1
|
||||
|
||||
/* #undef HAVE_GCC_BOUNDED_ATTRIBUTE */
|
||||
|
||||
/* Define to 1 if you want to enable GSSAPI */
|
||||
/* #undef WITH_GSSAPI */
|
||||
|
||||
/* Define to 1 if you want to enable ZLIB */
|
||||
/* #undef WITH_ZLIB */
|
||||
|
||||
/* Define to 1 if you want to enable SFTP */
|
||||
/* #undef WITH_SFTP */
|
||||
|
||||
/* Define to 1 if you want to enable server support */
|
||||
#define WITH_SERVER 1
|
||||
|
||||
/* Define to 1 if you want to enable DH group exchange algorithms */
|
||||
/* #undef WITH_GEX */
|
||||
|
||||
/* Define to 1 if you want to enable blowfish cipher support */
|
||||
/* #undef WITH_BLOWFISH_CIPHER */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for crypto functions */
|
||||
/* #undef DEBUG_CRYPTO */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for packet functions */
|
||||
/* #undef DEBUG_PACKET */
|
||||
|
||||
/* Define to 1 if you want to enable pcap output support (experimental) */
|
||||
/* #undef WITH_PCAP */
|
||||
|
||||
/* Define to 1 if you want to enable calltrace debug output */
|
||||
/* #undef DEBUG_CALLTRACE */
|
||||
|
||||
/* Define to 1 if you want to enable NaCl support */
|
||||
/* #undef WITH_NACL */
|
||||
|
||||
/*************************** ENDIAN *****************************/
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
285
contrib/libssh-cmake/linux/aarch64-musl/config.h
Normal file
285
contrib/libssh-cmake/linux/aarch64-musl/config.h
Normal file
@ -0,0 +1,285 @@
|
||||
/* Name of package */
|
||||
#define PACKAGE "libssh"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.9.7"
|
||||
|
||||
#define SYSCONFDIR "etc"
|
||||
#define BINARYDIR "/home/ubuntu/workdir/ClickHouse/build/aarch64-musl"
|
||||
#define SOURCEDIR "/home/ubuntu/workdir/ClickHouse"
|
||||
|
||||
/* Global bind configuration file path */
|
||||
#define GLOBAL_BIND_CONFIG "/etc/ssh/libssh_server_config"
|
||||
|
||||
/* Global client configuration file path */
|
||||
#define GLOBAL_CLIENT_CONFIG "/etc/ssh/ssh_config"
|
||||
|
||||
/************************** HEADER FILES *************************/
|
||||
|
||||
/* Define to 1 if you have the <argp.h> header file. */
|
||||
/* #undef HAVE_ARGP_H */
|
||||
|
||||
/* Define to 1 if you have the <aprpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <glob.h> header file. */
|
||||
#define HAVE_GLOB_H 1
|
||||
|
||||
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
|
||||
/* #undef HAVE_VALGRIND_VALGRIND_H */
|
||||
|
||||
/* Define to 1 if you have the <pty.h> header file. */
|
||||
/* #undef HAVE_PTY_H */
|
||||
|
||||
/* Define to 1 if you have the <utmp.h> header file. */
|
||||
/* #undef HAVE_UTMP_H */
|
||||
|
||||
/* Define to 1 if you have the <util.h> header file. */
|
||||
/* #undef HAVE_UTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <libutil.h> header file. */
|
||||
/* #undef HAVE_LIBUTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/aes.h> header file. */
|
||||
#define HAVE_OPENSSL_AES_H 1
|
||||
|
||||
/* Define to 1 if you have the <wspiapi.h> header file. */
|
||||
/* #undef HAVE_WSPIAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/blowfish.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_BLOWFISH_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/des.h> header file. */
|
||||
#define HAVE_OPENSSL_DES_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdh.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDH_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ec.h> header file. */
|
||||
#define HAVE_OPENSSL_EC_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdsa.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#define HAVE_PTHREAD_H 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in openssl */
|
||||
#define HAVE_OPENSSL_ECC 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in gcrypt */
|
||||
/* #undef HAVE_GCRYPT_ECC */
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography */
|
||||
#define HAVE_ECC 1
|
||||
|
||||
/* Define to 1 if you have DSA */
|
||||
/* #undef HAVE_DSA */
|
||||
|
||||
/* Define to 1 if you have gl_flags as a glob_t sturct member */
|
||||
/* #undef HAVE_GLOB_GL_FLAGS_MEMBER
|
||||
|
||||
/* Define to 1 if you have OpenSSL with Ed25519 support */
|
||||
#define HAVE_OPENSSL_ED25519 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with X25519 support */
|
||||
#define HAVE_OPENSSL_X25519 1
|
||||
|
||||
/*************************** FUNCTIONS ***************************/
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CTR 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_cbc' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CBC 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_gcm' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_AES_GCM */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
|
||||
#define HAVE_OPENSSL_EVP_CIPHER_CTX_NEW 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_KDF_CTX_new_id' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID */
|
||||
|
||||
/* Define to 1 if you have the `FIPS_mode' function. */
|
||||
#define HAVE_OPENSSL_FIPS_MODE 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestSign' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTSIGN 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestVerify' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTVERIFY 1
|
||||
|
||||
/* Define to 1 if you have the `OPENSSL_ia32cap_loc' function. */
|
||||
/* #undef HAVE_OPENSSL_IA32CAP_LOC */
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_snprintf' function. */
|
||||
/* #undef HAVE__SNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_snprintf_s' function. */
|
||||
/* #undef HAVE__SNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf' function. */
|
||||
/* #undef HAVE__VSNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf_s' function. */
|
||||
/* #undef HAVE__VSNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `isblank' function. */
|
||||
#define HAVE_ISBLANK 1
|
||||
|
||||
/* Define to 1 if you have the `strncpy' function. */
|
||||
#define HAVE_STRNCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strndup' function. */
|
||||
#define HAVE_STRNDUP 1
|
||||
|
||||
/* Define to 1 if you have the `cfmakeraw' function. */
|
||||
/* #undef HAVE_CFMAKERAW */
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
/* #undef HAVE_CLOCK_GETTIME */
|
||||
|
||||
/* Define to 1 if you have the `ntohll' function. */
|
||||
/* #undef HAVE_NTOHLL */
|
||||
|
||||
/* Define to 1 if you have the `htonll' function. */
|
||||
/* #undef HAVE_HTONLL */
|
||||
|
||||
/* Define to 1 if you have the `strtoull' function. */
|
||||
#define HAVE_STRTOULL 1
|
||||
|
||||
/* Define to 1 if you have the `__strtoull' function. */
|
||||
/* #undef HAVE___STRTOULL */
|
||||
|
||||
/* Define to 1 if you have the `_strtoui64' function. */
|
||||
/* #undef HAVE__STRTOUI64 */
|
||||
|
||||
/* Define to 1 if you have the `glob' function. */
|
||||
#define HAVE_GLOB 1
|
||||
|
||||
/* Define to 1 if you have the `explicit_bzero' function. */
|
||||
#define HAVE_EXPLICIT_BZERO 1
|
||||
|
||||
/* Define to 1 if you have the `memset_s' function. */
|
||||
/* #undef HAVE_MEMSET_S */
|
||||
|
||||
/* Define to 1 if you have the `SecureZeroMemory' function. */
|
||||
/* #undef HAVE_SECURE_ZERO_MEMORY */
|
||||
|
||||
/* Define to 1 if you have the `cmocka_set_test_filter' function. */
|
||||
/* #undef HAVE_CMOCKA_SET_TEST_FILTER */
|
||||
|
||||
/*************************** LIBRARIES ***************************/
|
||||
|
||||
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
|
||||
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
|
||||
/* #undef HAVE_LIBGCRYPT */
|
||||
|
||||
/* Define to 1 if you have the 'mbedTLS' library (-lmbedtls). */
|
||||
/* #undef HAVE_LIBMBEDCRYPTO */
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#define HAVE_PTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `cmocka' library (-lcmocka). */
|
||||
/* #undef HAVE_CMOCKA */
|
||||
|
||||
/**************************** OPTIONS ****************************/
|
||||
|
||||
#define HAVE_GCC_THREAD_LOCAL_STORAGE 1
|
||||
/* #undef HAVE_MSC_THREAD_LOCAL_STORAGE */
|
||||
|
||||
#define HAVE_FALLTHROUGH_ATTRIBUTE 1
|
||||
#define HAVE_UNUSED_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
||||
#define HAVE_DESTRUCTOR_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
|
||||
|
||||
#define HAVE_COMPILER__FUNC__ 1
|
||||
#define HAVE_COMPILER__FUNCTION__ 1
|
||||
|
||||
/* #undef HAVE_GCC_BOUNDED_ATTRIBUTE */
|
||||
|
||||
/* Define to 1 if you want to enable GSSAPI */
|
||||
/* #undef WITH_GSSAPI */
|
||||
|
||||
/* Define to 1 if you want to enable ZLIB */
|
||||
/* #undef WITH_ZLIB */
|
||||
|
||||
/* Define to 1 if you want to enable SFTP */
|
||||
/* #undef WITH_SFTP */
|
||||
|
||||
/* Define to 1 if you want to enable server support */
|
||||
#define WITH_SERVER 1
|
||||
|
||||
/* Define to 1 if you want to enable DH group exchange algorithms */
|
||||
/* #undef WITH_GEX */
|
||||
|
||||
/* Define to 1 if you want to enable blowfish cipher support */
|
||||
/* #undef WITH_BLOWFISH_CIPHER */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for crypto functions */
|
||||
/* #undef DEBUG_CRYPTO */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for packet functions */
|
||||
/* #undef DEBUG_PACKET */
|
||||
|
||||
/* Define to 1 if you want to enable pcap output support (experimental) */
|
||||
/* #undef WITH_PCAP */
|
||||
|
||||
/* Define to 1 if you want to enable calltrace debug output */
|
||||
/* #undef DEBUG_CALLTRACE */
|
||||
|
||||
/* Define to 1 if you want to enable NaCl support */
|
||||
/* #undef WITH_NACL */
|
||||
|
||||
/*************************** ENDIAN *****************************/
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
285
contrib/libssh-cmake/linux/aarch64/config.h
Normal file
285
contrib/libssh-cmake/linux/aarch64/config.h
Normal file
@ -0,0 +1,285 @@
|
||||
/* Name of package */
|
||||
#define PACKAGE "libssh"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.9.7"
|
||||
|
||||
#define SYSCONFDIR "etc"
|
||||
#define BINARYDIR "/home/ubuntu/workdir/ClickHouse/build/aarch64"
|
||||
#define SOURCEDIR "/home/ubuntu/workdir/ClickHouse"
|
||||
|
||||
/* Global bind configuration file path */
|
||||
#define GLOBAL_BIND_CONFIG "/etc/ssh/libssh_server_config"
|
||||
|
||||
/* Global client configuration file path */
|
||||
#define GLOBAL_CLIENT_CONFIG "/etc/ssh/ssh_config"
|
||||
|
||||
/************************** HEADER FILES *************************/
|
||||
|
||||
/* Define to 1 if you have the <argp.h> header file. */
|
||||
/* #undef HAVE_ARGP_H */
|
||||
|
||||
/* Define to 1 if you have the <aprpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <glob.h> header file. */
|
||||
#define HAVE_GLOB_H 1
|
||||
|
||||
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
|
||||
/* #undef HAVE_VALGRIND_VALGRIND_H */
|
||||
|
||||
/* Define to 1 if you have the <pty.h> header file. */
|
||||
/* #undef HAVE_PTY_H */
|
||||
|
||||
/* Define to 1 if you have the <utmp.h> header file. */
|
||||
/* #undef HAVE_UTMP_H */
|
||||
|
||||
/* Define to 1 if you have the <util.h> header file. */
|
||||
/* #undef HAVE_UTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <libutil.h> header file. */
|
||||
/* #undef HAVE_LIBUTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/aes.h> header file. */
|
||||
#define HAVE_OPENSSL_AES_H 1
|
||||
|
||||
/* Define to 1 if you have the <wspiapi.h> header file. */
|
||||
/* #undef HAVE_WSPIAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/blowfish.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_BLOWFISH_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/des.h> header file. */
|
||||
#define HAVE_OPENSSL_DES_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdh.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDH_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ec.h> header file. */
|
||||
#define HAVE_OPENSSL_EC_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdsa.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#define HAVE_PTHREAD_H 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in openssl */
|
||||
#define HAVE_OPENSSL_ECC 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in gcrypt */
|
||||
/* #undef HAVE_GCRYPT_ECC */
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography */
|
||||
#define HAVE_ECC 1
|
||||
|
||||
/* Define to 1 if you have DSA */
|
||||
/* #undef HAVE_DSA */
|
||||
|
||||
/* Define to 1 if you have gl_flags as a glob_t sturct member */
|
||||
#define HAVE_GLOB_GL_FLAGS_MEMBER 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with Ed25519 support */
|
||||
#define HAVE_OPENSSL_ED25519 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with X25519 support */
|
||||
#define HAVE_OPENSSL_X25519 1
|
||||
|
||||
/*************************** FUNCTIONS ***************************/
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CTR 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_cbc' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CBC 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_gcm' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_AES_GCM */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
|
||||
#define HAVE_OPENSSL_EVP_CIPHER_CTX_NEW 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_KDF_CTX_new_id' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID */
|
||||
|
||||
/* Define to 1 if you have the `FIPS_mode' function. */
|
||||
#define HAVE_OPENSSL_FIPS_MODE 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestSign' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTSIGN 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestVerify' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTVERIFY 1
|
||||
|
||||
/* Define to 1 if you have the `OPENSSL_ia32cap_loc' function. */
|
||||
/* #undef HAVE_OPENSSL_IA32CAP_LOC */
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_snprintf' function. */
|
||||
/* #undef HAVE__SNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_snprintf_s' function. */
|
||||
/* #undef HAVE__SNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf' function. */
|
||||
/* #undef HAVE__VSNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf_s' function. */
|
||||
/* #undef HAVE__VSNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `isblank' function. */
|
||||
#define HAVE_ISBLANK 1
|
||||
|
||||
/* Define to 1 if you have the `strncpy' function. */
|
||||
#define HAVE_STRNCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strndup' function. */
|
||||
#define HAVE_STRNDUP 1
|
||||
|
||||
/* Define to 1 if you have the `cfmakeraw' function. */
|
||||
/* #undef HAVE_CFMAKERAW */
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
/* #undef HAVE_CLOCK_GETTIME */
|
||||
|
||||
/* Define to 1 if you have the `ntohll' function. */
|
||||
/* #undef HAVE_NTOHLL */
|
||||
|
||||
/* Define to 1 if you have the `htonll' function. */
|
||||
/* #undef HAVE_HTONLL */
|
||||
|
||||
/* Define to 1 if you have the `strtoull' function. */
|
||||
#define HAVE_STRTOULL 1
|
||||
|
||||
/* Define to 1 if you have the `__strtoull' function. */
|
||||
/* #undef HAVE___STRTOULL */
|
||||
|
||||
/* Define to 1 if you have the `_strtoui64' function. */
|
||||
/* #undef HAVE__STRTOUI64 */
|
||||
|
||||
/* Define to 1 if you have the `glob' function. */
|
||||
#define HAVE_GLOB 1
|
||||
|
||||
/* Define to 1 if you have the `explicit_bzero' function. */
|
||||
#define HAVE_EXPLICIT_BZERO 1
|
||||
|
||||
/* Define to 1 if you have the `memset_s' function. */
|
||||
#define HAVE_MEMSET_S 1
|
||||
|
||||
/* Define to 1 if you have the `SecureZeroMemory' function. */
|
||||
/* #undef HAVE_SECURE_ZERO_MEMORY */
|
||||
|
||||
/* Define to 1 if you have the `cmocka_set_test_filter' function. */
|
||||
/* #undef HAVE_CMOCKA_SET_TEST_FILTER */
|
||||
|
||||
/*************************** LIBRARIES ***************************/
|
||||
|
||||
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
|
||||
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
|
||||
/* #undef HAVE_LIBGCRYPT */
|
||||
|
||||
/* Define to 1 if you have the 'mbedTLS' library (-lmbedtls). */
|
||||
/* #undef HAVE_LIBMBEDCRYPTO */
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#define HAVE_PTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `cmocka' library (-lcmocka). */
|
||||
/* #undef HAVE_CMOCKA */
|
||||
|
||||
/**************************** OPTIONS ****************************/
|
||||
|
||||
#define HAVE_GCC_THREAD_LOCAL_STORAGE 1
|
||||
/* #undef HAVE_MSC_THREAD_LOCAL_STORAGE */
|
||||
|
||||
#define HAVE_FALLTHROUGH_ATTRIBUTE 1
|
||||
#define HAVE_UNUSED_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
||||
#define HAVE_DESTRUCTOR_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
|
||||
|
||||
#define HAVE_COMPILER__FUNC__ 1
|
||||
#define HAVE_COMPILER__FUNCTION__ 1
|
||||
|
||||
/* #undef HAVE_GCC_BOUNDED_ATTRIBUTE */
|
||||
|
||||
/* Define to 1 if you want to enable GSSAPI */
|
||||
/* #undef WITH_GSSAPI */
|
||||
|
||||
/* Define to 1 if you want to enable ZLIB */
|
||||
/* #undef WITH_ZLIB */
|
||||
|
||||
/* Define to 1 if you want to enable SFTP */
|
||||
/* #undef WITH_SFTP */
|
||||
|
||||
/* Define to 1 if you want to enable server support */
|
||||
#define WITH_SERVER 1
|
||||
|
||||
/* Define to 1 if you want to enable DH group exchange algorithms */
|
||||
/* #undef WITH_GEX */
|
||||
|
||||
/* Define to 1 if you want to enable blowfish cipher support */
|
||||
/* #undef WITH_BLOWFISH_CIPHER */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for crypto functions */
|
||||
/* #undef DEBUG_CRYPTO */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for packet functions */
|
||||
/* #undef DEBUG_PACKET */
|
||||
|
||||
/* Define to 1 if you want to enable pcap output support (experimental) */
|
||||
/* #undef WITH_PCAP */
|
||||
|
||||
/* Define to 1 if you want to enable calltrace debug output */
|
||||
/* #undef DEBUG_CALLTRACE */
|
||||
|
||||
/* Define to 1 if you want to enable NaCl support */
|
||||
/* #undef WITH_NACL */
|
||||
|
||||
/*************************** ENDIAN *****************************/
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
285
contrib/libssh-cmake/linux/ppc64le/config.h
Normal file
285
contrib/libssh-cmake/linux/ppc64le/config.h
Normal file
@ -0,0 +1,285 @@
|
||||
/* Name of package */
|
||||
#define PACKAGE "libssh"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.9.7"
|
||||
|
||||
#define SYSCONFDIR "etc"
|
||||
#define BINARYDIR "/home/ubuntu/workdir/ClickHouse/build/ppc64le"
|
||||
#define SOURCEDIR "/home/ubuntu/workdir/ClickHouse"
|
||||
|
||||
/* Global bind configuration file path */
|
||||
#define GLOBAL_BIND_CONFIG "/etc/ssh/libssh_server_config"
|
||||
|
||||
/* Global client configuration file path */
|
||||
#define GLOBAL_CLIENT_CONFIG "/etc/ssh/ssh_config"
|
||||
|
||||
/************************** HEADER FILES *************************/
|
||||
|
||||
/* Define to 1 if you have the <argp.h> header file. */
|
||||
/* #undef HAVE_ARGP_H */
|
||||
|
||||
/* Define to 1 if you have the <aprpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <glob.h> header file. */
|
||||
#define HAVE_GLOB_H 1
|
||||
|
||||
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
|
||||
/* #undef HAVE_VALGRIND_VALGRIND_H */
|
||||
|
||||
/* Define to 1 if you have the <pty.h> header file. */
|
||||
/* #undef HAVE_PTY_H */
|
||||
|
||||
/* Define to 1 if you have the <utmp.h> header file. */
|
||||
/* #undef HAVE_UTMP_H */
|
||||
|
||||
/* Define to 1 if you have the <util.h> header file. */
|
||||
/* #undef HAVE_UTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <libutil.h> header file. */
|
||||
/* #undef HAVE_LIBUTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/aes.h> header file. */
|
||||
#define HAVE_OPENSSL_AES_H 1
|
||||
|
||||
/* Define to 1 if you have the <wspiapi.h> header file. */
|
||||
/* #undef HAVE_WSPIAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/blowfish.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_BLOWFISH_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/des.h> header file. */
|
||||
#define HAVE_OPENSSL_DES_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdh.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDH_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ec.h> header file. */
|
||||
#define HAVE_OPENSSL_EC_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdsa.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#define HAVE_PTHREAD_H 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in openssl */
|
||||
#define HAVE_OPENSSL_ECC 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in gcrypt */
|
||||
/* #undef HAVE_GCRYPT_ECC */
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography */
|
||||
#define HAVE_ECC 1
|
||||
|
||||
/* Define to 1 if you have DSA */
|
||||
/* #undef HAVE_DSA */
|
||||
|
||||
/* Define to 1 if you have gl_flags as a glob_t sturct member */
|
||||
#define HAVE_GLOB_GL_FLAGS_MEMBER 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with Ed25519 support */
|
||||
#define HAVE_OPENSSL_ED25519 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with X25519 support */
|
||||
#define HAVE_OPENSSL_X25519 1
|
||||
|
||||
/*************************** FUNCTIONS ***************************/
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CTR 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_cbc' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CBC 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_gcm' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_AES_GCM */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
|
||||
#define HAVE_OPENSSL_EVP_CIPHER_CTX_NEW 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_KDF_CTX_new_id' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID */
|
||||
|
||||
/* Define to 1 if you have the `FIPS_mode' function. */
|
||||
#define HAVE_OPENSSL_FIPS_MODE 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestSign' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTSIGN 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestVerify' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTVERIFY 1
|
||||
|
||||
/* Define to 1 if you have the `OPENSSL_ia32cap_loc' function. */
|
||||
/* #undef HAVE_OPENSSL_IA32CAP_LOC */
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_snprintf' function. */
|
||||
/* #undef HAVE__SNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_snprintf_s' function. */
|
||||
/* #undef HAVE__SNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf' function. */
|
||||
/* #undef HAVE__VSNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf_s' function. */
|
||||
/* #undef HAVE__VSNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `isblank' function. */
|
||||
#define HAVE_ISBLANK 1
|
||||
|
||||
/* Define to 1 if you have the `strncpy' function. */
|
||||
#define HAVE_STRNCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strndup' function. */
|
||||
#define HAVE_STRNDUP 1
|
||||
|
||||
/* Define to 1 if you have the `cfmakeraw' function. */
|
||||
/* #undef HAVE_CFMAKERAW */
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
/* #undef HAVE_CLOCK_GETTIME */
|
||||
|
||||
/* Define to 1 if you have the `ntohll' function. */
|
||||
/* #undef HAVE_NTOHLL */
|
||||
|
||||
/* Define to 1 if you have the `htonll' function. */
|
||||
/* #undef HAVE_HTONLL */
|
||||
|
||||
/* Define to 1 if you have the `strtoull' function. */
|
||||
#define HAVE_STRTOULL 1
|
||||
|
||||
/* Define to 1 if you have the `__strtoull' function. */
|
||||
/* #undef HAVE___STRTOULL */
|
||||
|
||||
/* Define to 1 if you have the `_strtoui64' function. */
|
||||
/* #undef HAVE__STRTOUI64 */
|
||||
|
||||
/* Define to 1 if you have the `glob' function. */
|
||||
#define HAVE_GLOB 1
|
||||
|
||||
/* Define to 1 if you have the `explicit_bzero' function. */
|
||||
/* #undef HAVE_EXPLICIT_BZERO 1 */
|
||||
|
||||
/* Define to 1 if you have the `memset_s' function. */
|
||||
/* #undef HAVE_MEMSET_S */
|
||||
|
||||
/* Define to 1 if you have the `SecureZeroMemory' function. */
|
||||
/* #undef HAVE_SECURE_ZERO_MEMORY */
|
||||
|
||||
/* Define to 1 if you have the `cmocka_set_test_filter' function. */
|
||||
/* #undef HAVE_CMOCKA_SET_TEST_FILTER */
|
||||
|
||||
/*************************** LIBRARIES ***************************/
|
||||
|
||||
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
|
||||
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
|
||||
/* #undef HAVE_LIBGCRYPT */
|
||||
|
||||
/* Define to 1 if you have the 'mbedTLS' library (-lmbedtls). */
|
||||
/* #undef HAVE_LIBMBEDCRYPTO */
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#define HAVE_PTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `cmocka' library (-lcmocka). */
|
||||
/* #undef HAVE_CMOCKA */
|
||||
|
||||
/**************************** OPTIONS ****************************/
|
||||
|
||||
#define HAVE_GCC_THREAD_LOCAL_STORAGE 1
|
||||
/* #undef HAVE_MSC_THREAD_LOCAL_STORAGE */
|
||||
|
||||
#define HAVE_FALLTHROUGH_ATTRIBUTE 1
|
||||
#define HAVE_UNUSED_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
||||
#define HAVE_DESTRUCTOR_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
|
||||
|
||||
#define HAVE_COMPILER__FUNC__ 1
|
||||
#define HAVE_COMPILER__FUNCTION__ 1
|
||||
|
||||
/* #undef HAVE_GCC_BOUNDED_ATTRIBUTE */
|
||||
|
||||
/* Define to 1 if you want to enable GSSAPI */
|
||||
/* #undef WITH_GSSAPI */
|
||||
|
||||
/* Define to 1 if you want to enable ZLIB */
|
||||
/* #undef WITH_ZLIB */
|
||||
|
||||
/* Define to 1 if you want to enable SFTP */
|
||||
/* #undef WITH_SFTP */
|
||||
|
||||
/* Define to 1 if you want to enable server support */
|
||||
#define WITH_SERVER 1
|
||||
|
||||
/* Define to 1 if you want to enable DH group exchange algorithms */
|
||||
/* #undef WITH_GEX */
|
||||
|
||||
/* Define to 1 if you want to enable blowfish cipher support */
|
||||
/* #undef WITH_BLOWFISH_CIPHER */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for crypto functions */
|
||||
/* #undef DEBUG_CRYPTO */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for packet functions */
|
||||
/* #undef DEBUG_PACKET */
|
||||
|
||||
/* Define to 1 if you want to enable pcap output support (experimental) */
|
||||
/* #undef WITH_PCAP */
|
||||
|
||||
/* Define to 1 if you want to enable calltrace debug output */
|
||||
/* #undef DEBUG_CALLTRACE */
|
||||
|
||||
/* Define to 1 if you want to enable NaCl support */
|
||||
/* #undef WITH_NACL */
|
||||
|
||||
/*************************** ENDIAN *****************************/
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
285
contrib/libssh-cmake/linux/riscv64/config.h
Normal file
285
contrib/libssh-cmake/linux/riscv64/config.h
Normal file
@ -0,0 +1,285 @@
|
||||
/* Name of package */
|
||||
#define PACKAGE "libssh"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.9.7"
|
||||
|
||||
#define SYSCONFDIR "etc"
|
||||
#define BINARYDIR "/home/ubuntu/workdir/ClickHouse/build/riscv64"
|
||||
#define SOURCEDIR "/home/ubuntu/workdir/ClickHouse"
|
||||
|
||||
/* Global bind configuration file path */
|
||||
#define GLOBAL_BIND_CONFIG "/etc/ssh/libssh_server_config"
|
||||
|
||||
/* Global client configuration file path */
|
||||
#define GLOBAL_CLIENT_CONFIG "/etc/ssh/ssh_config"
|
||||
|
||||
/************************** HEADER FILES *************************/
|
||||
|
||||
/* Define to 1 if you have the <argp.h> header file. */
|
||||
/* #undef HAVE_ARGP_H */
|
||||
|
||||
/* Define to 1 if you have the <aprpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <glob.h> header file. */
|
||||
#define HAVE_GLOB_H 1
|
||||
|
||||
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
|
||||
/* #undef HAVE_VALGRIND_VALGRIND_H */
|
||||
|
||||
/* Define to 1 if you have the <pty.h> header file. */
|
||||
/* #undef HAVE_PTY_H */
|
||||
|
||||
/* Define to 1 if you have the <utmp.h> header file. */
|
||||
/* #undef HAVE_UTMP_H */
|
||||
|
||||
/* Define to 1 if you have the <util.h> header file. */
|
||||
/* #undef HAVE_UTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <libutil.h> header file. */
|
||||
/* #undef HAVE_LIBUTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/aes.h> header file. */
|
||||
#define HAVE_OPENSSL_AES_H 1
|
||||
|
||||
/* Define to 1 if you have the <wspiapi.h> header file. */
|
||||
/* #undef HAVE_WSPIAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/blowfish.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_BLOWFISH_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/des.h> header file. */
|
||||
#define HAVE_OPENSSL_DES_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdh.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDH_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ec.h> header file. */
|
||||
#define HAVE_OPENSSL_EC_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdsa.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#define HAVE_PTHREAD_H 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in openssl */
|
||||
#define HAVE_OPENSSL_ECC 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in gcrypt */
|
||||
/* #undef HAVE_GCRYPT_ECC */
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography */
|
||||
#define HAVE_ECC 1
|
||||
|
||||
/* Define to 1 if you have DSA */
|
||||
/* #undef HAVE_DSA */
|
||||
|
||||
/* Define to 1 if you have gl_flags as a glob_t sturct member */
|
||||
#define HAVE_GLOB_GL_FLAGS_MEMBER 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with Ed25519 support */
|
||||
#define HAVE_OPENSSL_ED25519 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with X25519 support */
|
||||
#define HAVE_OPENSSL_X25519 1
|
||||
|
||||
/*************************** FUNCTIONS ***************************/
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CTR 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_cbc' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CBC 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_gcm' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_AES_GCM */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
|
||||
#define HAVE_OPENSSL_EVP_CIPHER_CTX_NEW 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_KDF_CTX_new_id' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID */
|
||||
|
||||
/* Define to 1 if you have the `FIPS_mode' function. */
|
||||
/* #undef HAVE_OPENSSL_FIPS_MODE */
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestSign' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTSIGN 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestVerify' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTVERIFY 1
|
||||
|
||||
/* Define to 1 if you have the `OPENSSL_ia32cap_loc' function. */
|
||||
/* #undef HAVE_OPENSSL_IA32CAP_LOC */
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_snprintf' function. */
|
||||
/* #undef HAVE__SNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_snprintf_s' function. */
|
||||
/* #undef HAVE__SNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf' function. */
|
||||
/* #undef HAVE__VSNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf_s' function. */
|
||||
/* #undef HAVE__VSNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `isblank' function. */
|
||||
#define HAVE_ISBLANK 1
|
||||
|
||||
/* Define to 1 if you have the `strncpy' function. */
|
||||
#define HAVE_STRNCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strndup' function. */
|
||||
#define HAVE_STRNDUP 1
|
||||
|
||||
/* Define to 1 if you have the `cfmakeraw' function. */
|
||||
/* #undef HAVE_CFMAKERAW */
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
/* #undef HAVE_CLOCK_GETTIME */
|
||||
|
||||
/* Define to 1 if you have the `ntohll' function. */
|
||||
/* #undef HAVE_NTOHLL */
|
||||
|
||||
/* Define to 1 if you have the `htonll' function. */
|
||||
/* #undef HAVE_HTONLL */
|
||||
|
||||
/* Define to 1 if you have the `strtoull' function. */
|
||||
#define HAVE_STRTOULL 1
|
||||
|
||||
/* Define to 1 if you have the `__strtoull' function. */
|
||||
/* #undef HAVE___STRTOULL */
|
||||
|
||||
/* Define to 1 if you have the `_strtoui64' function. */
|
||||
/* #undef HAVE__STRTOUI64 */
|
||||
|
||||
/* Define to 1 if you have the `glob' function. */
|
||||
#define HAVE_GLOB 1
|
||||
|
||||
/* Define to 1 if you have the `explicit_bzero' function. */
|
||||
/* #undef HAVE_EXPLICIT_BZERO 1 */
|
||||
|
||||
/* Define to 1 if you have the `memset_s' function. */
|
||||
/* #undef HAVE_MEMSET_S */
|
||||
|
||||
/* Define to 1 if you have the `SecureZeroMemory' function. */
|
||||
/* #undef HAVE_SECURE_ZERO_MEMORY */
|
||||
|
||||
/* Define to 1 if you have the `cmocka_set_test_filter' function. */
|
||||
/* #undef HAVE_CMOCKA_SET_TEST_FILTER */
|
||||
|
||||
/*************************** LIBRARIES ***************************/
|
||||
|
||||
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
|
||||
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
|
||||
/* #undef HAVE_LIBGCRYPT */
|
||||
|
||||
/* Define to 1 if you have the 'mbedTLS' library (-lmbedtls). */
|
||||
/* #undef HAVE_LIBMBEDCRYPTO */
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#define HAVE_PTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `cmocka' library (-lcmocka). */
|
||||
/* #undef HAVE_CMOCKA */
|
||||
|
||||
/**************************** OPTIONS ****************************/
|
||||
|
||||
#define HAVE_GCC_THREAD_LOCAL_STORAGE 1
|
||||
/* #undef HAVE_MSC_THREAD_LOCAL_STORAGE */
|
||||
|
||||
#define HAVE_FALLTHROUGH_ATTRIBUTE 1
|
||||
#define HAVE_UNUSED_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
||||
#define HAVE_DESTRUCTOR_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
|
||||
|
||||
#define HAVE_COMPILER__FUNC__ 1
|
||||
#define HAVE_COMPILER__FUNCTION__ 1
|
||||
|
||||
/* #undef HAVE_GCC_BOUNDED_ATTRIBUTE */
|
||||
|
||||
/* Define to 1 if you want to enable GSSAPI */
|
||||
/* #undef WITH_GSSAPI */
|
||||
|
||||
/* Define to 1 if you want to enable ZLIB */
|
||||
/* #undef WITH_ZLIB */
|
||||
|
||||
/* Define to 1 if you want to enable SFTP */
|
||||
/* #undef WITH_SFTP */
|
||||
|
||||
/* Define to 1 if you want to enable server support */
|
||||
#define WITH_SERVER 1
|
||||
|
||||
/* Define to 1 if you want to enable DH group exchange algorithms */
|
||||
/* #undef WITH_GEX */
|
||||
|
||||
/* Define to 1 if you want to enable blowfish cipher support */
|
||||
/* #undef WITH_BLOWFISH_CIPHER */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for crypto functions */
|
||||
/* #undef DEBUG_CRYPTO */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for packet functions */
|
||||
/* #undef DEBUG_PACKET */
|
||||
|
||||
/* Define to 1 if you want to enable pcap output support (experimental) */
|
||||
/* #undef WITH_PCAP */
|
||||
|
||||
/* Define to 1 if you want to enable calltrace debug output */
|
||||
/* #undef DEBUG_CALLTRACE */
|
||||
|
||||
/* Define to 1 if you want to enable NaCl support */
|
||||
/* #undef WITH_NACL */
|
||||
|
||||
/*************************** ENDIAN *****************************/
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
285
contrib/libssh-cmake/linux/s390x/config.h
Normal file
285
contrib/libssh-cmake/linux/s390x/config.h
Normal file
@ -0,0 +1,285 @@
|
||||
/* Name of package */
|
||||
#define PACKAGE "libssh"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.9.7"
|
||||
|
||||
#define SYSCONFDIR "etc"
|
||||
#define BINARYDIR "/home/ubuntu/workdir/ClickHouse/build/ppc64le"
|
||||
#define SOURCEDIR "/home/ubuntu/workdir/ClickHouse"
|
||||
|
||||
/* Global bind configuration file path */
|
||||
#define GLOBAL_BIND_CONFIG "/etc/ssh/libssh_server_config"
|
||||
|
||||
/* Global client configuration file path */
|
||||
#define GLOBAL_CLIENT_CONFIG "/etc/ssh/ssh_config"
|
||||
|
||||
/************************** HEADER FILES *************************/
|
||||
|
||||
/* Define to 1 if you have the <argp.h> header file. */
|
||||
/* #undef HAVE_ARGP_H */
|
||||
|
||||
/* Define to 1 if you have the <aprpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <glob.h> header file. */
|
||||
#define HAVE_GLOB_H 1
|
||||
|
||||
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
|
||||
/* #undef HAVE_VALGRIND_VALGRIND_H */
|
||||
|
||||
/* Define to 1 if you have the <pty.h> header file. */
|
||||
/* #undef HAVE_PTY_H */
|
||||
|
||||
/* Define to 1 if you have the <utmp.h> header file. */
|
||||
/* #undef HAVE_UTMP_H */
|
||||
|
||||
/* Define to 1 if you have the <util.h> header file. */
|
||||
/* #undef HAVE_UTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <libutil.h> header file. */
|
||||
/* #undef HAVE_LIBUTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/aes.h> header file. */
|
||||
#define HAVE_OPENSSL_AES_H 1
|
||||
|
||||
/* Define to 1 if you have the <wspiapi.h> header file. */
|
||||
/* #undef HAVE_WSPIAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/blowfish.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_BLOWFISH_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/des.h> header file. */
|
||||
#define HAVE_OPENSSL_DES_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdh.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDH_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ec.h> header file. */
|
||||
#define HAVE_OPENSSL_EC_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdsa.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#define HAVE_PTHREAD_H 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in openssl */
|
||||
#define HAVE_OPENSSL_ECC 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in gcrypt */
|
||||
/* #undef HAVE_GCRYPT_ECC */
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography */
|
||||
#define HAVE_ECC 1
|
||||
|
||||
/* Define to 1 if you have DSA */
|
||||
/* #undef HAVE_DSA */
|
||||
|
||||
/* Define to 1 if you have gl_flags as a glob_t sturct member */
|
||||
#define HAVE_GLOB_GL_FLAGS_MEMBER 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with Ed25519 support */
|
||||
#define HAVE_OPENSSL_ED25519 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with X25519 support */
|
||||
#define HAVE_OPENSSL_X25519 1
|
||||
|
||||
/*************************** FUNCTIONS ***************************/
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CTR 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_cbc' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CBC 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_gcm' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_AES_GCM */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
|
||||
#define HAVE_OPENSSL_EVP_CIPHER_CTX_NEW 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_KDF_CTX_new_id' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID */
|
||||
|
||||
/* Define to 1 if you have the `FIPS_mode' function. */
|
||||
/* #undef HAVE_OPENSSL_FIPS_MODE */
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestSign' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTSIGN 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestVerify' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTVERIFY 1
|
||||
|
||||
/* Define to 1 if you have the `OPENSSL_ia32cap_loc' function. */
|
||||
/* #undef HAVE_OPENSSL_IA32CAP_LOC */
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_snprintf' function. */
|
||||
/* #undef HAVE__SNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_snprintf_s' function. */
|
||||
/* #undef HAVE__SNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf' function. */
|
||||
/* #undef HAVE__VSNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf_s' function. */
|
||||
/* #undef HAVE__VSNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `isblank' function. */
|
||||
#define HAVE_ISBLANK 1
|
||||
|
||||
/* Define to 1 if you have the `strncpy' function. */
|
||||
#define HAVE_STRNCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strndup' function. */
|
||||
#define HAVE_STRNDUP 1
|
||||
|
||||
/* Define to 1 if you have the `cfmakeraw' function. */
|
||||
/* #undef HAVE_CFMAKERAW */
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
/* #undef HAVE_CLOCK_GETTIME */
|
||||
|
||||
/* Define to 1 if you have the `ntohll' function. */
|
||||
/* #undef HAVE_NTOHLL */
|
||||
|
||||
/* Define to 1 if you have the `htonll' function. */
|
||||
/* #undef HAVE_HTONLL */
|
||||
|
||||
/* Define to 1 if you have the `strtoull' function. */
|
||||
#define HAVE_STRTOULL 1
|
||||
|
||||
/* Define to 1 if you have the `__strtoull' function. */
|
||||
/* #undef HAVE___STRTOULL */
|
||||
|
||||
/* Define to 1 if you have the `_strtoui64' function. */
|
||||
/* #undef HAVE__STRTOUI64 */
|
||||
|
||||
/* Define to 1 if you have the `glob' function. */
|
||||
#define HAVE_GLOB 1
|
||||
|
||||
/* Define to 1 if you have the `explicit_bzero' function. */
|
||||
/* #undef HAVE_EXPLICIT_BZERO 1 */
|
||||
|
||||
/* Define to 1 if you have the `memset_s' function. */
|
||||
/* #undef HAVE_MEMSET_S */
|
||||
|
||||
/* Define to 1 if you have the `SecureZeroMemory' function. */
|
||||
/* #undef HAVE_SECURE_ZERO_MEMORY */
|
||||
|
||||
/* Define to 1 if you have the `cmocka_set_test_filter' function. */
|
||||
/* #undef HAVE_CMOCKA_SET_TEST_FILTER */
|
||||
|
||||
/*************************** LIBRARIES ***************************/
|
||||
|
||||
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
|
||||
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
|
||||
/* #undef HAVE_LIBGCRYPT */
|
||||
|
||||
/* Define to 1 if you have the 'mbedTLS' library (-lmbedtls). */
|
||||
/* #undef HAVE_LIBMBEDCRYPTO */
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#define HAVE_PTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `cmocka' library (-lcmocka). */
|
||||
/* #undef HAVE_CMOCKA */
|
||||
|
||||
/**************************** OPTIONS ****************************/
|
||||
|
||||
#define HAVE_GCC_THREAD_LOCAL_STORAGE 1
|
||||
/* #undef HAVE_MSC_THREAD_LOCAL_STORAGE */
|
||||
|
||||
#define HAVE_FALLTHROUGH_ATTRIBUTE 1
|
||||
#define HAVE_UNUSED_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
||||
#define HAVE_DESTRUCTOR_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
|
||||
|
||||
#define HAVE_COMPILER__FUNC__ 1
|
||||
#define HAVE_COMPILER__FUNCTION__ 1
|
||||
|
||||
/* #undef HAVE_GCC_BOUNDED_ATTRIBUTE */
|
||||
|
||||
/* Define to 1 if you want to enable GSSAPI */
|
||||
/* #undef WITH_GSSAPI */
|
||||
|
||||
/* Define to 1 if you want to enable ZLIB */
|
||||
/* #undef WITH_ZLIB */
|
||||
|
||||
/* Define to 1 if you want to enable SFTP */
|
||||
/* #undef WITH_SFTP */
|
||||
|
||||
/* Define to 1 if you want to enable server support */
|
||||
#define WITH_SERVER 1
|
||||
|
||||
/* Define to 1 if you want to enable DH group exchange algorithms */
|
||||
/* #undef WITH_GEX */
|
||||
|
||||
/* Define to 1 if you want to enable blowfish cipher support */
|
||||
/* #undef WITH_BLOWFISH_CIPHER */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for crypto functions */
|
||||
/* #undef DEBUG_CRYPTO */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for packet functions */
|
||||
/* #undef DEBUG_PACKET */
|
||||
|
||||
/* Define to 1 if you want to enable pcap output support (experimental) */
|
||||
/* #undef WITH_PCAP */
|
||||
|
||||
/* Define to 1 if you want to enable calltrace debug output */
|
||||
/* #undef DEBUG_CALLTRACE */
|
||||
|
||||
/* Define to 1 if you want to enable NaCl support */
|
||||
/* #undef WITH_NACL */
|
||||
|
||||
/*************************** ENDIAN *****************************/
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
285
contrib/libssh-cmake/linux/x86-64-musl/config.h
Normal file
285
contrib/libssh-cmake/linux/x86-64-musl/config.h
Normal file
@ -0,0 +1,285 @@
|
||||
/* Name of package */
|
||||
#define PACKAGE "libssh"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.9.7"
|
||||
|
||||
#define SYSCONFDIR "etc"
|
||||
#define BINARYDIR "/home/ubuntu/workdir/ClickHouse/build/musl"
|
||||
#define SOURCEDIR "/home/ubuntu/workdir/ClickHouse"
|
||||
|
||||
/* Global bind configuration file path */
|
||||
#define GLOBAL_BIND_CONFIG "/etc/ssh/libssh_server_config"
|
||||
|
||||
/* Global client configuration file path */
|
||||
#define GLOBAL_CLIENT_CONFIG "/etc/ssh/ssh_config"
|
||||
|
||||
/************************** HEADER FILES *************************/
|
||||
|
||||
/* Define to 1 if you have the <argp.h> header file. */
|
||||
/* #undef HAVE_ARGP_H */
|
||||
|
||||
/* Define to 1 if you have the <aprpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <glob.h> header file. */
|
||||
#define HAVE_GLOB_H 1
|
||||
|
||||
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
|
||||
/* #undef HAVE_VALGRIND_VALGRIND_H */
|
||||
|
||||
/* Define to 1 if you have the <pty.h> header file. */
|
||||
/* #undef HAVE_PTY_H */
|
||||
|
||||
/* Define to 1 if you have the <utmp.h> header file. */
|
||||
/* #undef HAVE_UTMP_H */
|
||||
|
||||
/* Define to 1 if you have the <util.h> header file. */
|
||||
/* #undef HAVE_UTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <libutil.h> header file. */
|
||||
/* #undef HAVE_LIBUTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/aes.h> header file. */
|
||||
#define HAVE_OPENSSL_AES_H 1
|
||||
|
||||
/* Define to 1 if you have the <wspiapi.h> header file. */
|
||||
/* #undef HAVE_WSPIAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/blowfish.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_BLOWFISH_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/des.h> header file. */
|
||||
#define HAVE_OPENSSL_DES_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdh.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDH_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ec.h> header file. */
|
||||
#define HAVE_OPENSSL_EC_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdsa.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#define HAVE_PTHREAD_H 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in openssl */
|
||||
#define HAVE_OPENSSL_ECC 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in gcrypt */
|
||||
/* #undef HAVE_GCRYPT_ECC */
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography */
|
||||
#define HAVE_ECC 1
|
||||
|
||||
/* Define to 1 if you have DSA */
|
||||
/* #undef HAVE_DSA */
|
||||
|
||||
/* Define to 1 if you have gl_flags as a glob_t sturct member */
|
||||
/* #undef HAVE_GLOB_GL_FLAGS_MEMBER
|
||||
|
||||
/* Define to 1 if you have OpenSSL with Ed25519 support */
|
||||
#define HAVE_OPENSSL_ED25519 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with X25519 support */
|
||||
#define HAVE_OPENSSL_X25519 1
|
||||
|
||||
/*************************** FUNCTIONS ***************************/
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CTR 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_cbc' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CBC 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_gcm' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_AES_GCM */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
|
||||
#define HAVE_OPENSSL_EVP_CIPHER_CTX_NEW 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_KDF_CTX_new_id' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID */
|
||||
|
||||
/* Define to 1 if you have the `FIPS_mode' function. */
|
||||
#define HAVE_OPENSSL_FIPS_MODE 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestSign' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTSIGN 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestVerify' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTVERIFY 1
|
||||
|
||||
/* Define to 1 if you have the `OPENSSL_ia32cap_loc' function. */
|
||||
/* #undef HAVE_OPENSSL_IA32CAP_LOC */
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_snprintf' function. */
|
||||
/* #undef HAVE__SNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_snprintf_s' function. */
|
||||
/* #undef HAVE__SNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf' function. */
|
||||
/* #undef HAVE__VSNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf_s' function. */
|
||||
/* #undef HAVE__VSNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `isblank' function. */
|
||||
#define HAVE_ISBLANK 1
|
||||
|
||||
/* Define to 1 if you have the `strncpy' function. */
|
||||
#define HAVE_STRNCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strndup' function. */
|
||||
#define HAVE_STRNDUP 1
|
||||
|
||||
/* Define to 1 if you have the `cfmakeraw' function. */
|
||||
/* #undef HAVE_CFMAKERAW */
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
/* #undef HAVE_CLOCK_GETTIME */
|
||||
|
||||
/* Define to 1 if you have the `ntohll' function. */
|
||||
/* #undef HAVE_NTOHLL */
|
||||
|
||||
/* Define to 1 if you have the `htonll' function. */
|
||||
/* #undef HAVE_HTONLL */
|
||||
|
||||
/* Define to 1 if you have the `strtoull' function. */
|
||||
#define HAVE_STRTOULL 1
|
||||
|
||||
/* Define to 1 if you have the `__strtoull' function. */
|
||||
/* #undef HAVE___STRTOULL */
|
||||
|
||||
/* Define to 1 if you have the `_strtoui64' function. */
|
||||
/* #undef HAVE__STRTOUI64 */
|
||||
|
||||
/* Define to 1 if you have the `glob' function. */
|
||||
#define HAVE_GLOB 1
|
||||
|
||||
/* Define to 1 if you have the `explicit_bzero' function. */
|
||||
#define HAVE_EXPLICIT_BZERO 1
|
||||
|
||||
/* Define to 1 if you have the `memset_s' function. */
|
||||
/* #undef HAVE_MEMSET_S */
|
||||
|
||||
/* Define to 1 if you have the `SecureZeroMemory' function. */
|
||||
/* #undef HAVE_SECURE_ZERO_MEMORY */
|
||||
|
||||
/* Define to 1 if you have the `cmocka_set_test_filter' function. */
|
||||
/* #undef HAVE_CMOCKA_SET_TEST_FILTER */
|
||||
|
||||
/*************************** LIBRARIES ***************************/
|
||||
|
||||
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
|
||||
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
|
||||
/* #undef HAVE_LIBGCRYPT */
|
||||
|
||||
/* Define to 1 if you have the 'mbedTLS' library (-lmbedtls). */
|
||||
/* #undef HAVE_LIBMBEDCRYPTO */
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#define HAVE_PTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `cmocka' library (-lcmocka). */
|
||||
/* #undef HAVE_CMOCKA */
|
||||
|
||||
/**************************** OPTIONS ****************************/
|
||||
|
||||
#define HAVE_GCC_THREAD_LOCAL_STORAGE 1
|
||||
/* #undef HAVE_MSC_THREAD_LOCAL_STORAGE */
|
||||
|
||||
#define HAVE_FALLTHROUGH_ATTRIBUTE 1
|
||||
#define HAVE_UNUSED_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
||||
#define HAVE_DESTRUCTOR_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
|
||||
|
||||
#define HAVE_COMPILER__FUNC__ 1
|
||||
#define HAVE_COMPILER__FUNCTION__ 1
|
||||
|
||||
/* #undef HAVE_GCC_BOUNDED_ATTRIBUTE */
|
||||
|
||||
/* Define to 1 if you want to enable GSSAPI */
|
||||
/* #undef WITH_GSSAPI */
|
||||
|
||||
/* Define to 1 if you want to enable ZLIB */
|
||||
/* #undef WITH_ZLIB */
|
||||
|
||||
/* Define to 1 if you want to enable SFTP */
|
||||
/* #undef WITH_SFTP */
|
||||
|
||||
/* Define to 1 if you want to enable server support */
|
||||
#define WITH_SERVER 1
|
||||
|
||||
/* Define to 1 if you want to enable DH group exchange algorithms */
|
||||
/* #undef WITH_GEX */
|
||||
|
||||
/* Define to 1 if you want to enable blowfish cipher support */
|
||||
/* #undef WITH_BLOWFISH_CIPHER */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for crypto functions */
|
||||
/* #undef DEBUG_CRYPTO */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for packet functions */
|
||||
/* #undef DEBUG_PACKET */
|
||||
|
||||
/* Define to 1 if you want to enable pcap output support (experimental) */
|
||||
/* #undef WITH_PCAP */
|
||||
|
||||
/* Define to 1 if you want to enable calltrace debug output */
|
||||
/* #undef DEBUG_CALLTRACE */
|
||||
|
||||
/* Define to 1 if you want to enable NaCl support */
|
||||
/* #undef WITH_NACL */
|
||||
|
||||
/*************************** ENDIAN *****************************/
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
285
contrib/libssh-cmake/linux/x86-64/config.h
Normal file
285
contrib/libssh-cmake/linux/x86-64/config.h
Normal file
@ -0,0 +1,285 @@
|
||||
/* Name of package */
|
||||
#define PACKAGE "libssh"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.9.7"
|
||||
|
||||
#define SYSCONFDIR "etc"
|
||||
#define BINARYDIR "/home/ubuntu/workdir/ClickHouse/build/Debug"
|
||||
#define SOURCEDIR "/home/ubuntu/workdir/ClickHouse"
|
||||
|
||||
/* Global bind configuration file path */
|
||||
#define GLOBAL_BIND_CONFIG "/etc/ssh/libssh_server_config"
|
||||
|
||||
/* Global client configuration file path */
|
||||
#define GLOBAL_CLIENT_CONFIG "/etc/ssh/ssh_config"
|
||||
|
||||
/************************** HEADER FILES *************************/
|
||||
|
||||
/* Define to 1 if you have the <argp.h> header file. */
|
||||
/* #undef HAVE_ARGP_H */
|
||||
|
||||
/* Define to 1 if you have the <aprpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <glob.h> header file. */
|
||||
#define HAVE_GLOB_H 1
|
||||
|
||||
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
|
||||
/* #undef HAVE_VALGRIND_VALGRIND_H */
|
||||
|
||||
/* Define to 1 if you have the <pty.h> header file. */
|
||||
/* #undef HAVE_PTY_H */
|
||||
|
||||
/* Define to 1 if you have the <utmp.h> header file. */
|
||||
/* #undef HAVE_UTMP_H */
|
||||
|
||||
/* Define to 1 if you have the <util.h> header file. */
|
||||
/* #undef HAVE_UTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <libutil.h> header file. */
|
||||
/* #undef HAVE_LIBUTIL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/aes.h> header file. */
|
||||
#define HAVE_OPENSSL_AES_H 1
|
||||
|
||||
/* Define to 1 if you have the <wspiapi.h> header file. */
|
||||
/* #undef HAVE_WSPIAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/blowfish.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_BLOWFISH_H */
|
||||
|
||||
/* Define to 1 if you have the <openssl/des.h> header file. */
|
||||
#define HAVE_OPENSSL_DES_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdh.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDH_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ec.h> header file. */
|
||||
#define HAVE_OPENSSL_EC_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ecdsa.h> header file. */
|
||||
#define HAVE_OPENSSL_ECDSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#define HAVE_PTHREAD_H 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in openssl */
|
||||
#define HAVE_OPENSSL_ECC 1
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography in gcrypt */
|
||||
/* #undef HAVE_GCRYPT_ECC */
|
||||
|
||||
/* Define to 1 if you have eliptic curve cryptography */
|
||||
#define HAVE_ECC 1
|
||||
|
||||
/* Define to 1 if you have DSA */
|
||||
/* #undef HAVE_DSA */
|
||||
|
||||
/* Define to 1 if you have gl_flags as a glob_t sturct member */
|
||||
#define HAVE_GLOB_GL_FLAGS_MEMBER 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with Ed25519 support */
|
||||
#define HAVE_OPENSSL_ED25519 1
|
||||
|
||||
/* Define to 1 if you have OpenSSL with X25519 support */
|
||||
#define HAVE_OPENSSL_X25519 1
|
||||
|
||||
/*************************** FUNCTIONS ***************************/
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_ctr' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CTR 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_cbc' function. */
|
||||
#define HAVE_OPENSSL_EVP_AES_CBC 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_aes128_gcm' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_AES_GCM */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_ctr128_encrypt' function. */
|
||||
#define HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
|
||||
#define HAVE_OPENSSL_EVP_CIPHER_CTX_NEW 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_KDF_CTX_new_id' function. */
|
||||
/* #undef HAVE_OPENSSL_EVP_KDF_CTX_NEW_ID */
|
||||
|
||||
/* Define to 1 if you have the `FIPS_mode' function. */
|
||||
#define HAVE_OPENSSL_FIPS_MODE 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestSign' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTSIGN 1
|
||||
|
||||
/* Define to 1 if you have the `EVP_DigestVerify' function. */
|
||||
#define HAVE_OPENSSL_EVP_DIGESTVERIFY 1
|
||||
|
||||
/* Define to 1 if you have the `OPENSSL_ia32cap_loc' function. */
|
||||
/* #undef HAVE_OPENSSL_IA32CAP_LOC */
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_snprintf' function. */
|
||||
/* #undef HAVE__SNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_snprintf_s' function. */
|
||||
/* #undef HAVE__SNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf' function. */
|
||||
/* #undef HAVE__VSNPRINTF */
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf_s' function. */
|
||||
/* #undef HAVE__VSNPRINTF_S */
|
||||
|
||||
/* Define to 1 if you have the `isblank' function. */
|
||||
#define HAVE_ISBLANK 1
|
||||
|
||||
/* Define to 1 if you have the `strncpy' function. */
|
||||
#define HAVE_STRNCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strndup' function. */
|
||||
#define HAVE_STRNDUP 1
|
||||
|
||||
/* Define to 1 if you have the `cfmakeraw' function. */
|
||||
/* #undef HAVE_CFMAKERAW */
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
/* #undef HAVE_CLOCK_GETTIME */
|
||||
|
||||
/* Define to 1 if you have the `ntohll' function. */
|
||||
/* #undef HAVE_NTOHLL */
|
||||
|
||||
/* Define to 1 if you have the `htonll' function. */
|
||||
/* #undef HAVE_HTONLL */
|
||||
|
||||
/* Define to 1 if you have the `strtoull' function. */
|
||||
#define HAVE_STRTOULL 1
|
||||
|
||||
/* Define to 1 if you have the `__strtoull' function. */
|
||||
/* #undef HAVE___STRTOULL */
|
||||
|
||||
/* Define to 1 if you have the `_strtoui64' function. */
|
||||
/* #undef HAVE__STRTOUI64 */
|
||||
|
||||
/* Define to 1 if you have the `glob' function. */
|
||||
#define HAVE_GLOB 1
|
||||
|
||||
/* Define to 1 if you have the `explicit_bzero' function. */
|
||||
#define HAVE_EXPLICIT_BZERO 1
|
||||
|
||||
/* Define to 1 if you have the `memset_s' function. */
|
||||
#define HAVE_MEMSET_S 1
|
||||
|
||||
/* Define to 1 if you have the `SecureZeroMemory' function. */
|
||||
/* #undef HAVE_SECURE_ZERO_MEMORY */
|
||||
|
||||
/* Define to 1 if you have the `cmocka_set_test_filter' function. */
|
||||
/* #undef HAVE_CMOCKA_SET_TEST_FILTER */
|
||||
|
||||
/*************************** LIBRARIES ***************************/
|
||||
|
||||
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
|
||||
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
|
||||
/* #undef HAVE_LIBGCRYPT */
|
||||
|
||||
/* Define to 1 if you have the 'mbedTLS' library (-lmbedtls). */
|
||||
/* #undef HAVE_LIBMBEDCRYPTO */
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#define HAVE_PTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `cmocka' library (-lcmocka). */
|
||||
/* #undef HAVE_CMOCKA */
|
||||
|
||||
/**************************** OPTIONS ****************************/
|
||||
|
||||
#define HAVE_GCC_THREAD_LOCAL_STORAGE 1
|
||||
/* #undef HAVE_MSC_THREAD_LOCAL_STORAGE */
|
||||
|
||||
#define HAVE_FALLTHROUGH_ATTRIBUTE 1
|
||||
#define HAVE_UNUSED_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
||||
#define HAVE_DESTRUCTOR_ATTRIBUTE 1
|
||||
|
||||
#define HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
|
||||
|
||||
#define HAVE_COMPILER__FUNC__ 1
|
||||
#define HAVE_COMPILER__FUNCTION__ 1
|
||||
|
||||
/* #undef HAVE_GCC_BOUNDED_ATTRIBUTE */
|
||||
|
||||
/* Define to 1 if you want to enable GSSAPI */
|
||||
/* #undef WITH_GSSAPI */
|
||||
|
||||
/* Define to 1 if you want to enable ZLIB */
|
||||
/* #undef WITH_ZLIB */
|
||||
|
||||
/* Define to 1 if you want to enable SFTP */
|
||||
/* #undef WITH_SFTP */
|
||||
|
||||
/* Define to 1 if you want to enable server support */
|
||||
#define WITH_SERVER 1
|
||||
|
||||
/* Define to 1 if you want to enable DH group exchange algorithms */
|
||||
/* #undef WITH_GEX */
|
||||
|
||||
/* Define to 1 if you want to enable blowfish cipher support */
|
||||
/* #undef WITH_BLOWFISH_CIPHER */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for crypto functions */
|
||||
/* #undef DEBUG_CRYPTO */
|
||||
|
||||
/* Define to 1 if you want to enable debug output for packet functions */
|
||||
/* #undef DEBUG_PACKET */
|
||||
|
||||
/* Define to 1 if you want to enable pcap output support (experimental) */
|
||||
/* #undef WITH_PCAP */
|
||||
|
||||
/* Define to 1 if you want to enable calltrace debug output */
|
||||
/* #undef DEBUG_CALLTRACE */
|
||||
|
||||
/* Define to 1 if you want to enable NaCl support */
|
||||
/* #undef WITH_NACL */
|
||||
|
||||
/*************************** ENDIAN *****************************/
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
@ -54,8 +54,10 @@ namespace pdqsort_detail {
|
||||
block_size = 64,
|
||||
|
||||
// Cacheline size, assumes power of two.
|
||||
cacheline_size = 64
|
||||
cacheline_size = 64,
|
||||
|
||||
/// Try sort allowed iterations
|
||||
try_sort_iterations = 3,
|
||||
};
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
@ -501,6 +503,167 @@ namespace pdqsort_detail {
|
||||
leftmost = false;
|
||||
}
|
||||
}
|
||||
|
||||
template<class Iter, class Compare, bool Branchless>
|
||||
inline bool pdqsort_try_sort_loop(Iter begin,
|
||||
Iter end,
|
||||
Compare comp,
|
||||
size_t bad_allowed,
|
||||
size_t iterations_allowed,
|
||||
bool force_sort = false,
|
||||
bool leftmost = true) {
|
||||
typedef typename std::iterator_traits<Iter>::difference_type diff_t;
|
||||
|
||||
// Use a while loop for tail recursion elimination.
|
||||
while (true) {
|
||||
if (!force_sort && iterations_allowed == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
diff_t size = end - begin;
|
||||
|
||||
// Insertion sort is faster for small arrays.
|
||||
if (size < insertion_sort_threshold) {
|
||||
if (leftmost) insertion_sort(begin, end, comp);
|
||||
else unguarded_insertion_sort(begin, end, comp);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Choose pivot as median of 3 or pseudomedian of 9.
|
||||
diff_t s2 = size / 2;
|
||||
if (size > ninther_threshold) {
|
||||
sort3(begin, begin + s2, end - 1, comp);
|
||||
sort3(begin + 1, begin + (s2 - 1), end - 2, comp);
|
||||
sort3(begin + 2, begin + (s2 + 1), end - 3, comp);
|
||||
sort3(begin + (s2 - 1), begin + s2, begin + (s2 + 1), comp);
|
||||
std::iter_swap(begin, begin + s2);
|
||||
} else sort3(begin + s2, begin, end - 1, comp);
|
||||
|
||||
// If *(begin - 1) is the end of the right partition of a previous partition operation
|
||||
// there is no element in [begin, end) that is smaller than *(begin - 1). Then if our
|
||||
// pivot compares equal to *(begin - 1) we change strategy, putting equal elements in
|
||||
// the left partition, greater elements in the right partition. We do not have to
|
||||
// recurse on the left partition, since it's sorted (all equal).
|
||||
if (!leftmost && !comp(*(begin - 1), *begin)) {
|
||||
begin = partition_left(begin, end, comp) + 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Partition and get results.
|
||||
std::pair<Iter, bool> part_result =
|
||||
Branchless ? partition_right_branchless(begin, end, comp)
|
||||
: partition_right(begin, end, comp);
|
||||
Iter pivot_pos = part_result.first;
|
||||
bool already_partitioned = part_result.second;
|
||||
|
||||
// Check for a highly unbalanced partition.
|
||||
diff_t l_size = pivot_pos - begin;
|
||||
diff_t r_size = end - (pivot_pos + 1);
|
||||
bool highly_unbalanced = l_size < size / 8 || r_size < size / 8;
|
||||
|
||||
// If we got a highly unbalanced partition we shuffle elements to break many patterns.
|
||||
if (highly_unbalanced) {
|
||||
if (!force_sort) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If we had too many bad partitions, switch to heapsort to guarantee O(n log n).
|
||||
if (--bad_allowed == 0) {
|
||||
std::make_heap(begin, end, comp);
|
||||
std::sort_heap(begin, end, comp);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (l_size >= insertion_sort_threshold) {
|
||||
std::iter_swap(begin, begin + l_size / 4);
|
||||
std::iter_swap(pivot_pos - 1, pivot_pos - l_size / 4);
|
||||
|
||||
if (l_size > ninther_threshold) {
|
||||
std::iter_swap(begin + 1, begin + (l_size / 4 + 1));
|
||||
std::iter_swap(begin + 2, begin + (l_size / 4 + 2));
|
||||
std::iter_swap(pivot_pos - 2, pivot_pos - (l_size / 4 + 1));
|
||||
std::iter_swap(pivot_pos - 3, pivot_pos - (l_size / 4 + 2));
|
||||
}
|
||||
}
|
||||
|
||||
if (r_size >= insertion_sort_threshold) {
|
||||
std::iter_swap(pivot_pos + 1, pivot_pos + (1 + r_size / 4));
|
||||
std::iter_swap(end - 1, end - r_size / 4);
|
||||
|
||||
if (r_size > ninther_threshold) {
|
||||
std::iter_swap(pivot_pos + 2, pivot_pos + (2 + r_size / 4));
|
||||
std::iter_swap(pivot_pos + 3, pivot_pos + (3 + r_size / 4));
|
||||
std::iter_swap(end - 2, end - (1 + r_size / 4));
|
||||
std::iter_swap(end - 3, end - (2 + r_size / 4));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If we were decently balanced and we tried to sort an already partitioned
|
||||
// sequence try to use insertion sort.
|
||||
if (already_partitioned && partial_insertion_sort(begin, pivot_pos, comp)
|
||||
&& partial_insertion_sort(pivot_pos + 1, end, comp)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Sort the left partition first using recursion and do tail recursion elimination for
|
||||
// the right-hand partition.
|
||||
if (pdqsort_try_sort_loop<Iter, Compare, Branchless>(begin,
|
||||
pivot_pos,
|
||||
comp,
|
||||
bad_allowed,
|
||||
iterations_allowed - 1,
|
||||
force_sort,
|
||||
leftmost)) {
|
||||
force_sort = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
--iterations_allowed;
|
||||
begin = pivot_pos + 1;
|
||||
leftmost = false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template<class Iter, class Compare, bool Branchless>
|
||||
inline bool pdqsort_try_sort_impl(Iter begin, Iter end, Compare comp, size_t bad_allowed)
|
||||
{
|
||||
typedef typename std::iterator_traits<Iter>::difference_type diff_t;
|
||||
|
||||
static constexpr size_t iterations_allowed = pdqsort_detail::try_sort_iterations;
|
||||
static constexpr size_t num_to_try = 16;
|
||||
|
||||
diff_t size = end - begin;
|
||||
|
||||
if (size > num_to_try * 10)
|
||||
{
|
||||
size_t out_of_order_elements = 0;
|
||||
|
||||
for (size_t i = 1; i < num_to_try; ++i)
|
||||
{
|
||||
diff_t offset = size / num_to_try;
|
||||
|
||||
diff_t prev_position = offset * (i - 1);
|
||||
diff_t curr_position = offset * i;
|
||||
diff_t next_position = offset * (i + 1) - 1;
|
||||
|
||||
bool prev_less_than_curr = comp(*(begin + prev_position), *(begin + curr_position));
|
||||
bool curr_less_than_next = comp(*(begin + curr_position), *(begin + next_position));
|
||||
if ((prev_less_than_curr && curr_less_than_next) || (!prev_less_than_curr && !curr_less_than_next))
|
||||
continue;
|
||||
|
||||
++out_of_order_elements;
|
||||
if (out_of_order_elements > iterations_allowed)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return pdqsort_try_sort_loop<Iter, Compare, Branchless>(begin, end, comp, bad_allowed, iterations_allowed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -538,6 +701,41 @@ inline void pdqsort_branchless(Iter begin, Iter end) {
|
||||
pdqsort_branchless(begin, end, std::less<T>());
|
||||
}
|
||||
|
||||
template<class Iter, class Compare>
|
||||
inline bool pdqsort_try_sort(Iter begin, Iter end, Compare comp) {
|
||||
if (begin == end) return true;
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
return pdqsort_detail::pdqsort_try_sort_impl<Iter, Compare,
|
||||
pdqsort_detail::is_default_compare<typename std::decay<Compare>::type>::value &&
|
||||
std::is_arithmetic<typename std::iterator_traits<Iter>::value_type>::value>(
|
||||
begin, end, comp, pdqsort_detail::log2(end - begin));
|
||||
#else
|
||||
return pdqsort_detail::pdqsort_try_sort_impl<Iter, Compare, false>(
|
||||
begin, end, comp, pdqsort_detail::log2(end - begin));
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class Iter>
|
||||
inline bool pdqsort_try_sort(Iter begin, Iter end) {
|
||||
typedef typename std::iterator_traits<Iter>::value_type T;
|
||||
return pdqsort_try_sort(begin, end, std::less<T>());
|
||||
}
|
||||
|
||||
template<class Iter, class Compare>
|
||||
inline bool pdqsort_try_sort_branchless(Iter begin, Iter end, Compare comp) {
|
||||
if (begin == end) return true;
|
||||
|
||||
return pdqsort_detail::pdqsort_try_sort_impl<Iter, Compare, true>(
|
||||
begin, end, comp, pdqsort_detail::log2(end - begin));
|
||||
}
|
||||
|
||||
template<class Iter>
|
||||
inline bool pdqsort_try_sort_branchless(Iter begin, Iter end) {
|
||||
typedef typename std::iterator_traits<Iter>::value_type T;
|
||||
return pdqsort_try_sort_branchless(begin, end, std::less<T>());
|
||||
}
|
||||
|
||||
|
||||
#undef PDQSORT_PREFER_MOVE
|
||||
|
||||
|
@ -55,6 +55,17 @@ ccache_status
|
||||
# clear cache stats
|
||||
ccache --zero-stats ||:
|
||||
|
||||
# Check whether the directory with pre-build scripts exists and not empty.
|
||||
if [ ! -d "/build/packages/pre-build" ] || [ -n "$(ls -A /build/packages/pre-build)" ]; then
|
||||
echo "There are no subcommands to execute :)"
|
||||
else
|
||||
# Execute all commands
|
||||
for file in /build/packages/pre-build/*.sh ;
|
||||
do
|
||||
bash "$file"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$BUILD_MUSL_KEEPER" == "1" ]
|
||||
then
|
||||
# build keeper with musl separately
|
||||
@ -73,13 +84,13 @@ then
|
||||
fi
|
||||
rm -f CMakeCache.txt
|
||||
|
||||
# Build the rest of binaries
|
||||
cmake --debug-trycompile -DBUILD_STANDALONE_KEEPER=0 -DCREATE_KEEPER_SYMLINK=0 -DCMAKE_VERBOSE_MAKEFILE=1 -LA "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DSANITIZE=$SANITIZER" -DENABLE_CHECK_HEAVY_BUILDS=1 "${CMAKE_FLAGS[@]}" ..
|
||||
else
|
||||
# Build everything
|
||||
cmake --debug-trycompile -DCMAKE_VERBOSE_MAKEFILE=1 -LA "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DSANITIZE=$SANITIZER" -DENABLE_CHECK_HEAVY_BUILDS=1 "${CMAKE_FLAGS[@]}" ..
|
||||
# Modify CMake flags, so we won't overwrite standalone keeper with symlinks
|
||||
CMAKE_FLAGS+=(-DBUILD_STANDALONE_KEEPER=0 -DCREATE_KEEPER_SYMLINK=0)
|
||||
fi
|
||||
|
||||
# Build everything
|
||||
cmake --debug-trycompile -DCMAKE_VERBOSE_MAKEFILE=1 -LA "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DSANITIZE=$SANITIZER" -DENABLE_CHECK_HEAVY_BUILDS=1 "${CMAKE_FLAGS[@]}" ..
|
||||
|
||||
# No quotes because I want it to expand to nothing if empty.
|
||||
# shellcheck disable=SC2086 # No quotes because I want it to expand to nothing if empty.
|
||||
ninja $NINJA_FLAGS $BUILD_TARGET
|
||||
|
@ -52,6 +52,21 @@ function configure()
|
||||
| sed "s|<snapshot_distance>100000</snapshot_distance>|<snapshot_distance>10000</snapshot_distance>|" \
|
||||
> /etc/clickhouse-server/config.d/keeper_port.xml.tmp
|
||||
sudo mv /etc/clickhouse-server/config.d/keeper_port.xml.tmp /etc/clickhouse-server/config.d/keeper_port.xml
|
||||
|
||||
function randomize_config_boolean_value {
|
||||
value=$(($RANDOM % 2))
|
||||
sudo cat /etc/clickhouse-server/config.d/keeper_port.xml \
|
||||
| sed "s|<$1>[01]</$1>|<$1>$value</$1>|" \
|
||||
> /etc/clickhouse-server/config.d/keeper_port.xml.tmp
|
||||
sudo mv /etc/clickhouse-server/config.d/keeper_port.xml.tmp /etc/clickhouse-server/config.d/keeper_port.xml
|
||||
}
|
||||
|
||||
# Randomize all Keeper feature flags
|
||||
randomize_config_boolean_value filtered_list
|
||||
randomize_config_boolean_value multi_read
|
||||
randomize_config_boolean_value check_not_exists
|
||||
randomize_config_boolean_value create_if_not_exists
|
||||
|
||||
sudo chown clickhouse /etc/clickhouse-server/config.d/keeper_port.xml
|
||||
sudo chgrp clickhouse /etc/clickhouse-server/config.d/keeper_port.xml
|
||||
|
||||
|
@ -60,11 +60,19 @@ install_packages previous_release_package_folder
|
||||
# available for dump via clickhouse-local
|
||||
configure
|
||||
|
||||
function remove_keeper_config()
|
||||
{
|
||||
sudo cat /etc/clickhouse-server/config.d/keeper_port.xml \
|
||||
| sed "/<$1>$2<\/$1>/d" \
|
||||
> /etc/clickhouse-server/config.d/keeper_port.xml.tmp
|
||||
sudo mv /etc/clickhouse-server/config.d/keeper_port.xml.tmp /etc/clickhouse-server/config.d/keeper_port.xml
|
||||
}
|
||||
|
||||
# async_replication setting doesn't exist on some older versions
|
||||
sudo cat /etc/clickhouse-server/config.d/keeper_port.xml \
|
||||
| sed "/<async_replication>1<\/async_replication>/d" \
|
||||
> /etc/clickhouse-server/config.d/keeper_port.xml.tmp
|
||||
sudo mv /etc/clickhouse-server/config.d/keeper_port.xml.tmp /etc/clickhouse-server/config.d/keeper_port.xml
|
||||
remove_keeper_config "async_replication" "1"
|
||||
|
||||
# create_if_not_exists feature flag doesn't exist on some older versions
|
||||
remove_keeper_config "create_if_not_exists" "[01]"
|
||||
|
||||
# it contains some new settings, but we can safely remove it
|
||||
rm /etc/clickhouse-server/config.d/merge_tree.xml
|
||||
@ -89,10 +97,10 @@ sudo cat /etc/clickhouse-server/config.d/keeper_port.xml \
|
||||
sudo mv /etc/clickhouse-server/config.d/keeper_port.xml.tmp /etc/clickhouse-server/config.d/keeper_port.xml
|
||||
|
||||
# async_replication setting doesn't exist on some older versions
|
||||
sudo cat /etc/clickhouse-server/config.d/keeper_port.xml \
|
||||
| sed "/<async_replication>1<\/async_replication>/d" \
|
||||
> /etc/clickhouse-server/config.d/keeper_port.xml.tmp
|
||||
sudo mv /etc/clickhouse-server/config.d/keeper_port.xml.tmp /etc/clickhouse-server/config.d/keeper_port.xml
|
||||
remove_keeper_config "async_replication" "1"
|
||||
|
||||
# create_if_not_exists feature flag doesn't exist on some older versions
|
||||
remove_keeper_config "create_if_not_exists" "[01]"
|
||||
|
||||
# But we still need default disk because some tables loaded only into it
|
||||
sudo cat /etc/clickhouse-server/config.d/s3_storage_policy_by_default.xml \
|
||||
|
@ -720,3 +720,84 @@ $ curl -vv -H 'XXX:xxx' 'http://localhost:8123/get_relative_path_static_handler'
|
||||
<html><body>Relative Path File</body></html>
|
||||
* Connection #0 to host localhost left intact
|
||||
```
|
||||
|
||||
## Valid JSON/XML response on exception during HTTP streaming {valid-output-on-exception-http-streaming}
|
||||
|
||||
While query execution over HTTP an exception can happen when part of the data has already been sent. Usually an exception is sent to the client in plain text
|
||||
even if some specific data format was used to output data and the output may become invalid in terms of specified data format.
|
||||
To prevent it, you can use setting `http_write_exception_in_output_format` (enabled by default) that will tell ClickHouse to write an exception in specified format (currently supported for XML and JSON* formats).
|
||||
|
||||
Examples:
|
||||
|
||||
```bash
|
||||
$ curl 'http://localhost:8123/?query=SELECT+number,+throwIf(number>3)+from+system.numbers+format+JSON+settings+max_block_size=1&http_write_exception_in_output_format=1'
|
||||
{
|
||||
"meta":
|
||||
[
|
||||
{
|
||||
"name": "number",
|
||||
"type": "UInt64"
|
||||
},
|
||||
{
|
||||
"name": "throwIf(greater(number, 2))",
|
||||
"type": "UInt8"
|
||||
}
|
||||
],
|
||||
|
||||
"data":
|
||||
[
|
||||
{
|
||||
"number": "0",
|
||||
"throwIf(greater(number, 2))": 0
|
||||
},
|
||||
{
|
||||
"number": "1",
|
||||
"throwIf(greater(number, 2))": 0
|
||||
},
|
||||
{
|
||||
"number": "2",
|
||||
"throwIf(greater(number, 2))": 0
|
||||
}
|
||||
],
|
||||
|
||||
"rows": 3,
|
||||
|
||||
"exception": "Code: 395. DB::Exception: Value passed to 'throwIf' function is non-zero: while executing 'FUNCTION throwIf(greater(number, 2) :: 2) -> throwIf(greater(number, 2)) UInt8 : 1'. (FUNCTION_THROW_IF_VALUE_IS_NON_ZERO) (version 23.8.1.1)"
|
||||
}
|
||||
```
|
||||
|
||||
```bash
|
||||
$ curl 'http://localhost:8123/?query=SELECT+number,+throwIf(number>2)+from+system.numbers+format+XML+settings+max_block_size=1&http_write_exception_in_output_format=1'
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<result>
|
||||
<meta>
|
||||
<columns>
|
||||
<column>
|
||||
<name>number</name>
|
||||
<type>UInt64</type>
|
||||
</column>
|
||||
<column>
|
||||
<name>throwIf(greater(number, 2))</name>
|
||||
<type>UInt8</type>
|
||||
</column>
|
||||
</columns>
|
||||
</meta>
|
||||
<data>
|
||||
<row>
|
||||
<number>0</number>
|
||||
<field>0</field>
|
||||
</row>
|
||||
<row>
|
||||
<number>1</number>
|
||||
<field>0</field>
|
||||
</row>
|
||||
<row>
|
||||
<number>2</number>
|
||||
<field>0</field>
|
||||
</row>
|
||||
</data>
|
||||
<rows>3</rows>
|
||||
<exception>Code: 395. DB::Exception: Value passed to 'throwIf' function is non-zero: while executing 'FUNCTION throwIf(greater(number, 2) :: 2) -> throwIf(greater(number, 2)) UInt8 : 1'. (FUNCTION_THROW_IF_VALUE_IS_NON_ZERO) (version 23.8.1.1)</exception>
|
||||
</result>
|
||||
```
|
||||
|
||||
|
@ -555,7 +555,7 @@ Merge reads rows from parts in blocks of `merge_max_block_size` rows, then merge
|
||||
|
||||
## number_of_free_entries_in_pool_to_lower_max_size_of_merge {#number-of-free-entries-in-pool-to-lower-max-size-of-merge}
|
||||
|
||||
When there is less than specified number of free entries in pool (or replicated queue), start to lower maximum size of merge to process (or to put in queue).
|
||||
When there is less than specified number of free entries in pool (or replicated queue), start to lower maximum size of merge to process (or to put in queue).
|
||||
This is to allow small merges to process - not filling the pool with long running merges.
|
||||
|
||||
Possible values:
|
||||
@ -566,7 +566,7 @@ Default value: 8
|
||||
|
||||
## number_of_free_entries_in_pool_to_execute_mutation {#number-of-free-entries-in-pool-to-execute-mutation}
|
||||
|
||||
When there is less than specified number of free entries in pool, do not execute part mutations.
|
||||
When there is less than specified number of free entries in pool, do not execute part mutations.
|
||||
This is to leave free threads for regular merges and avoid "Too many parts".
|
||||
|
||||
Possible values:
|
||||
@ -845,6 +845,13 @@ You can see which parts of `s` were stored using the sparse serialization:
|
||||
└────────┴────────────────────┘
|
||||
```
|
||||
|
||||
## replace_long_file_name_to_hash {#replace_long_file_name_to_hash}
|
||||
If the file name for column is too long (more than `max_file_name_length` bytes) replace it to SipHash128. Default value: `false`.
|
||||
|
||||
## max_file_name_length {#max_file_name_length}
|
||||
|
||||
The maximal length of the file name to keep it as is without hashing. Takes effect only if setting `replace_long_file_name_to_hash` is enabled. The value of this setting does not include the length of file extension. So, it is recommended to set it below the maximum filename length (usually 255 bytes) with some gap to avoid filesystem errors. Default value: 127.
|
||||
|
||||
## clean_deleted_rows
|
||||
|
||||
Enable/disable automatic deletion of rows flagged as `is_deleted` when perform `OPTIMIZE ... FINAL` on a table using the ReplacingMergeTree engine. When disabled, the `CLEANUP` keyword has to be added to the `OPTIMIZE ... FINAL` to have the same behaviour.
|
||||
|
@ -17,7 +17,7 @@ Columns:
|
||||
- `0` — Current user can change the setting.
|
||||
- `1` — Current user can’t change the setting.
|
||||
- `type` ([String](../../sql-reference/data-types/string.md)) — Setting type (implementation specific string value).
|
||||
- `is_obsolete` ([UInt8](../../sql-reference/data-types/int-uint.md#uint-ranges)) _ Shows whether a setting is obsolete.
|
||||
- `is_obsolete` ([UInt8](../../sql-reference/data-types/int-uint.md#uint-ranges)) - Shows whether a setting is obsolete.
|
||||
|
||||
**Example**
|
||||
```sql
|
||||
|
@ -14,7 +14,7 @@ Columns:
|
||||
- `changed` ([UInt8](../../sql-reference/data-types/int-uint.md#uint-ranges)) — Shows whether a setting was specified in `config.xml`
|
||||
- `description` ([String](../../sql-reference/data-types/string.md)) — Short server setting description.
|
||||
- `type` ([String](../../sql-reference/data-types/string.md)) — Server setting value type.
|
||||
- `is_obsolete` ([UInt8](../../sql-reference/data-types/int-uint.md#uint-ranges)) _ Shows whether a setting is obsolete.
|
||||
- `is_obsolete` ([UInt8](../../sql-reference/data-types/int-uint.md#uint-ranges)) - Shows whether a setting is obsolete.
|
||||
|
||||
**Example**
|
||||
|
||||
|
@ -17,7 +17,7 @@ Columns:
|
||||
- `0` — Current user can change the setting.
|
||||
- `1` — Current user can’t change the setting.
|
||||
- `default` ([String](../../sql-reference/data-types/string.md)) — Setting default value.
|
||||
- `is_obsolete` ([UInt8](../../sql-reference/data-types/int-uint.md#uint-ranges)) _ Shows whether a setting is obsolete.
|
||||
- `is_obsolete` ([UInt8](../../sql-reference/data-types/int-uint.md#uint-ranges)) - Shows whether a setting is obsolete.
|
||||
|
||||
**Example**
|
||||
|
||||
|
@ -12,7 +12,7 @@ Syntax:
|
||||
``` sql
|
||||
CREATE USER [IF NOT EXISTS | OR REPLACE] name1 [ON CLUSTER cluster_name1]
|
||||
[, name2 [ON CLUSTER cluster_name2] ...]
|
||||
[NOT IDENTIFIED | IDENTIFIED {[WITH {no_password | plaintext_password | sha256_password | sha256_hash | double_sha1_password | double_sha1_hash}] BY {'password' | 'hash'}} | {WITH ldap SERVER 'server_name'} | {WITH kerberos [REALM 'realm']} | {WITH ssl_certificate CN 'common_name'}]
|
||||
[NOT IDENTIFIED | IDENTIFIED {[WITH {no_password | plaintext_password | sha256_password | sha256_hash | double_sha1_password | double_sha1_hash}] BY {'password' | 'hash'}} | {WITH ldap SERVER 'server_name'} | {WITH kerberos [REALM 'realm']} | {WITH ssl_certificate CN 'common_name'} | {WITH ssh_key BY KEY 'public_key' TYPE 'ssh-rsa|...'}]
|
||||
[HOST {LOCAL | NAME 'name' | REGEXP 'name_regexp' | IP 'address' | LIKE 'pattern'} [,...] | ANY | NONE]
|
||||
[VALID UNTIL datetime]
|
||||
[IN access_storage_type]
|
||||
@ -39,6 +39,7 @@ There are multiple ways of user identification:
|
||||
- `IDENTIFIED WITH ldap SERVER 'server_name'`
|
||||
- `IDENTIFIED WITH kerberos` or `IDENTIFIED WITH kerberos REALM 'realm'`
|
||||
- `IDENTIFIED WITH ssl_certificate CN 'mysite.com:user'`
|
||||
- `IDENTIFIED WITH ssh_key BY KEY 'public_key' TYPE 'ssh-rsa', KEY 'another_public_key' TYPE 'ssh-ed25519'`
|
||||
- `IDENTIFIED BY 'qwerty'`
|
||||
|
||||
Password complexity requirements can be edited in [config.xml](/docs/en/operations/configuration-files). Below is an example configuration that requires passwords to be at least 12 characters long and contain 1 number. Each password complexity rule requires a regex to match against passwords and a description of the rule.
|
||||
|
@ -13,7 +13,7 @@ sidebar_label: "Пользователь"
|
||||
``` sql
|
||||
CREATE USER [IF NOT EXISTS | OR REPLACE] name1 [ON CLUSTER cluster_name1]
|
||||
[, name2 [ON CLUSTER cluster_name2] ...]
|
||||
[NOT IDENTIFIED | IDENTIFIED {[WITH {no_password | plaintext_password | sha256_password | sha256_hash | double_sha1_password | double_sha1_hash}] BY {'password' | 'hash'}} | {WITH ldap SERVER 'server_name'} | {WITH kerberos [REALM 'realm']}]
|
||||
[NOT IDENTIFIED | IDENTIFIED {[WITH {no_password | plaintext_password | sha256_password | sha256_hash | double_sha1_password | double_sha1_hash}] BY {'password' | 'hash'}} | {WITH ldap SERVER 'server_name'} | {WITH kerberos [REALM 'realm']} | {WITH ssl_certificate CN 'common_name'} | {WITH ssh_key BY KEY 'public_key' TYPE 'ssh-rsa|...'}]
|
||||
[HOST {LOCAL | NAME 'name' | REGEXP 'name_regexp' | IP 'address' | LIKE 'pattern'} [,...] | ANY | NONE]
|
||||
[DEFAULT ROLE role [,...]]
|
||||
[DEFAULT DATABASE database | NONE]
|
||||
@ -27,14 +27,19 @@ CREATE USER [IF NOT EXISTS | OR REPLACE] name1 [ON CLUSTER cluster_name1]
|
||||
|
||||
Существует несколько способов идентификации пользователя:
|
||||
|
||||
- `IDENTIFIED WITH no_password`
|
||||
- `IDENTIFIED WITH plaintext_password BY 'qwerty'`
|
||||
- `IDENTIFIED WITH sha256_password BY 'qwerty'` or `IDENTIFIED BY 'password'`
|
||||
- `IDENTIFIED WITH sha256_hash BY 'hash'` or `IDENTIFIED WITH sha256_hash BY 'hash' SALT 'salt'`
|
||||
- `IDENTIFIED WITH double_sha1_password BY 'qwerty'`
|
||||
- `IDENTIFIED WITH double_sha1_hash BY 'hash'`
|
||||
- `IDENTIFIED WITH ldap SERVER 'server_name'`
|
||||
- `IDENTIFIED WITH kerberos` or `IDENTIFIED WITH kerberos REALM 'realm'`
|
||||
- `IDENTIFIED WITH no_password`
|
||||
- `IDENTIFIED WITH plaintext_password BY 'qwerty'`
|
||||
- `IDENTIFIED WITH sha256_password BY 'qwerty'` or `IDENTIFIED BY 'password'`
|
||||
- `IDENTIFIED WITH sha256_hash BY 'hash'` or `IDENTIFIED WITH sha256_hash BY 'hash' SALT 'salt'`
|
||||
- `IDENTIFIED WITH double_sha1_password BY 'qwerty'`
|
||||
- `IDENTIFIED WITH double_sha1_hash BY 'hash'`
|
||||
- `IDENTIFIED WITH bcrypt_password BY 'qwerty'`
|
||||
- `IDENTIFIED WITH bcrypt_hash BY 'hash'`
|
||||
- `IDENTIFIED WITH ldap SERVER 'server_name'`
|
||||
- `IDENTIFIED WITH kerberos` or `IDENTIFIED WITH kerberos REALM 'realm'`
|
||||
- `IDENTIFIED WITH ssl_certificate CN 'mysite.com:user'`
|
||||
- `IDENTIFIED WITH ssh_key BY KEY 'public_key' TYPE 'ssh-rsa', KEY 'another_public_key' TYPE 'ssh-ed25519'`
|
||||
- `IDENTIFIED BY 'qwerty'`
|
||||
|
||||
Для идентификации с sha256_hash используя `SALT` - хэш должен быть вычислен от конкатенации 'password' и 'salt'.
|
||||
|
||||
|
1
packages/.gitignore
vendored
1
packages/.gitignore
vendored
@ -1 +1,2 @@
|
||||
*/
|
||||
!pre-build/
|
||||
|
3
packages/pre-build/example.sh
Executable file
3
packages/pre-build/example.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "This is an example pre-build script!"
|
@ -994,6 +994,8 @@ void Client::addOptions(OptionsDescription & options_description)
|
||||
("user,u", po::value<std::string>()->default_value("default"), "user")
|
||||
("password", po::value<std::string>(), "password")
|
||||
("ask-password", "ask-password")
|
||||
("ssh-key-file", po::value<std::string>(), "File containing ssh private key needed for authentication. If not set does password authentication.")
|
||||
("ssh-key-passphrase", po::value<std::string>(), "Passphrase for imported ssh key.")
|
||||
("quota_key", po::value<std::string>(), "A string to differentiate quotas when the user have keyed quotas configured on server")
|
||||
|
||||
("max_client_network_bandwidth", po::value<int>(), "the maximum speed of data exchange over the network for the client in bytes per second.")
|
||||
@ -1136,6 +1138,10 @@ void Client::processOptions(const OptionsDescription & options_description,
|
||||
config().setString("password", options["password"].as<std::string>());
|
||||
if (options.count("ask-password"))
|
||||
config().setBool("ask-password", true);
|
||||
if (options.count("ssh-key-file"))
|
||||
config().setString("ssh-key-file", options["ssh-key-file"].as<std::string>());
|
||||
if (options.count("ssh-key-passphrase"))
|
||||
config().setString("ssh-key-passphrase", options["ssh-key-passphrase"].as<std::string>());
|
||||
if (options.count("quota_key"))
|
||||
config().setString("quota_key", options["quota_key"].as<std::string>());
|
||||
if (options.count("max_client_network_bandwidth"))
|
||||
|
@ -2025,7 +2025,7 @@ UInt64 ClusterCopier::executeQueryOnCluster(
|
||||
{
|
||||
connections.emplace_back(std::make_shared<Connection>(
|
||||
node.host_name, node.port, node.default_database,
|
||||
node.user, node.password, node.quota_key, node.cluster, node.cluster_secret,
|
||||
node.user, node.password, ssh::SSHKey(), node.quota_key, node.cluster, node.cluster_secret,
|
||||
"ClusterCopier", node.compression, node.secure
|
||||
));
|
||||
|
||||
|
@ -760,27 +760,6 @@
|
||||
</graphite>
|
||||
-->
|
||||
|
||||
<!-- Serve endpoint for Prometheus monitoring. -->
|
||||
<!--
|
||||
endpoint - mertics path (relative to root, statring with "/")
|
||||
port - port to setup server. If not defined or 0 than http_port used
|
||||
metrics - send data from table system.metrics
|
||||
events - send data from table system.events
|
||||
asynchronous_metrics - send data from table system.asynchronous_metrics
|
||||
status_info - send data from different component from CH, ex: Dictionaries status
|
||||
-->
|
||||
<!--
|
||||
<prometheus>
|
||||
<endpoint>/metrics</endpoint>
|
||||
<port>9363</port>
|
||||
|
||||
<metrics>true</metrics>
|
||||
<events>true</events>
|
||||
<asynchronous_metrics>true</asynchronous_metrics>
|
||||
<status_info>true</status_info>
|
||||
</prometheus>
|
||||
-->
|
||||
|
||||
<!-- Query log. Used only for queries with setting log_queries = 1. -->
|
||||
<query_log>
|
||||
<!-- What table to insert data. If table is not exist, it will be created.
|
||||
|
@ -638,7 +638,6 @@ default_session_timeout: 60
|
||||
# metrics - send data from table system.metrics
|
||||
# events - send data from table system.events
|
||||
# asynchronous_metrics - send data from table system.asynchronous_metrics
|
||||
# status_info - send data from different component from CH, ex: Dictionaries status
|
||||
|
||||
# prometheus:
|
||||
# endpoint: /metrics
|
||||
@ -647,7 +646,6 @@ default_session_timeout: 60
|
||||
# metrics: true
|
||||
# events: true
|
||||
# asynchronous_metrics: true
|
||||
# status_info: true
|
||||
|
||||
# Query log. Used only for queries with setting log_queries = 1.
|
||||
query_log:
|
||||
|
@ -760,27 +760,6 @@
|
||||
</graphite>
|
||||
-->
|
||||
|
||||
<!-- Serve endpoint for Prometheus monitoring. -->
|
||||
<!--
|
||||
endpoint - mertics path (relative to root, statring with "/")
|
||||
port - port to setup server. If not defined or 0 than http_port used
|
||||
metrics - send data from table system.metrics
|
||||
events - send data from table system.events
|
||||
asynchronous_metrics - send data from table system.asynchronous_metrics
|
||||
status_info - send data from different component from CH, ex: Dictionaries status
|
||||
-->
|
||||
<!--
|
||||
<prometheus>
|
||||
<endpoint>/metrics</endpoint>
|
||||
<port>9363</port>
|
||||
|
||||
<metrics>true</metrics>
|
||||
<events>true</events>
|
||||
<asynchronous_metrics>true</asynchronous_metrics>
|
||||
<status_info>true</status_info>
|
||||
</prometheus>
|
||||
-->
|
||||
|
||||
<!-- Query log. Used only for queries with setting log_queries = 1. -->
|
||||
<query_log>
|
||||
<!-- What table to insert data. If table is not exist, it will be created.
|
||||
|
@ -969,7 +969,6 @@
|
||||
metrics - send data from table system.metrics
|
||||
events - send data from table system.events
|
||||
asynchronous_metrics - send data from table system.asynchronous_metrics
|
||||
status_info - send data from different component from CH, ex: Dictionaries status
|
||||
-->
|
||||
<!--
|
||||
<prometheus>
|
||||
@ -979,7 +978,6 @@
|
||||
<metrics>true</metrics>
|
||||
<events>true</events>
|
||||
<asynchronous_metrics>true</asynchronous_metrics>
|
||||
<status_info>true</status_info>
|
||||
</prometheus>
|
||||
-->
|
||||
|
||||
|
@ -639,7 +639,6 @@ default_session_timeout: 60
|
||||
# metrics - send data from table system.metrics
|
||||
# events - send data from table system.events
|
||||
# asynchronous_metrics - send data from table system.asynchronous_metrics
|
||||
# status_info - send data from different component from CH, ex: Dictionaries status
|
||||
|
||||
# prometheus:
|
||||
# endpoint: /metrics
|
||||
@ -648,7 +647,6 @@ default_session_timeout: 60
|
||||
# metrics: true
|
||||
# events: true
|
||||
# asynchronous_metrics: true
|
||||
# status_info: true
|
||||
|
||||
# Query log. Used only for queries with setting log_queries = 1.
|
||||
query_log:
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <Common/Exception.h>
|
||||
#include <Poco/SHA1Engine.h>
|
||||
#include <Common/typeid_cast.h>
|
||||
#include <Common/SSH/Wrappers.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
@ -14,6 +15,7 @@ namespace DB
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int NOT_IMPLEMENTED;
|
||||
extern const int SUPPORT_IS_DISABLED;
|
||||
}
|
||||
|
||||
namespace
|
||||
@ -70,6 +72,16 @@ namespace
|
||||
{
|
||||
return checkPasswordDoubleSHA1MySQL(scramble, scrambled_password, Util::encodeDoubleSHA1(password_plaintext));
|
||||
}
|
||||
|
||||
#if USE_SSL
|
||||
bool checkSshSignature(const std::vector<ssh::SSHKey> & keys, std::string_view signature, std::string_view original)
|
||||
{
|
||||
for (const auto & key: keys)
|
||||
if (key.isPublic() && key.verifySignature(signature, original))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -96,6 +108,9 @@ bool Authentication::areCredentialsValid(const Credentials & credentials, const
|
||||
case AuthenticationType::SSL_CERTIFICATE:
|
||||
throw Authentication::Require<BasicCredentials>("ClickHouse X.509 Authentication");
|
||||
|
||||
case AuthenticationType::SSH_KEY:
|
||||
throw Authentication::Require<SshCredentials>("Ssh Keys Authentication");
|
||||
|
||||
case AuthenticationType::MAX:
|
||||
break;
|
||||
}
|
||||
@ -123,6 +138,9 @@ bool Authentication::areCredentialsValid(const Credentials & credentials, const
|
||||
case AuthenticationType::SSL_CERTIFICATE:
|
||||
throw Authentication::Require<BasicCredentials>("ClickHouse X.509 Authentication");
|
||||
|
||||
case AuthenticationType::SSH_KEY:
|
||||
throw Authentication::Require<SshCredentials>("Ssh Keys Authentication");
|
||||
|
||||
case AuthenticationType::MAX:
|
||||
break;
|
||||
}
|
||||
@ -153,6 +171,9 @@ bool Authentication::areCredentialsValid(const Credentials & credentials, const
|
||||
case AuthenticationType::SSL_CERTIFICATE:
|
||||
throw Authentication::Require<BasicCredentials>("ClickHouse X.509 Authentication");
|
||||
|
||||
case AuthenticationType::SSH_KEY:
|
||||
throw Authentication::Require<SshCredentials>("Ssh Keys Authentication");
|
||||
|
||||
case AuthenticationType::BCRYPT_PASSWORD:
|
||||
return checkPasswordBcrypt(basic_credentials->getPassword(), auth_data.getPasswordHashBinary());
|
||||
|
||||
@ -179,6 +200,38 @@ bool Authentication::areCredentialsValid(const Credentials & credentials, const
|
||||
case AuthenticationType::SSL_CERTIFICATE:
|
||||
return auth_data.getSSLCertificateCommonNames().contains(ssl_certificate_credentials->getCommonName());
|
||||
|
||||
case AuthenticationType::SSH_KEY:
|
||||
throw Authentication::Require<SshCredentials>("Ssh Keys Authentication");
|
||||
|
||||
case AuthenticationType::MAX:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (const auto * ssh_credentials = typeid_cast<const SshCredentials *>(&credentials))
|
||||
{
|
||||
switch (auth_data.getType())
|
||||
{
|
||||
case AuthenticationType::NO_PASSWORD:
|
||||
case AuthenticationType::PLAINTEXT_PASSWORD:
|
||||
case AuthenticationType::SHA256_PASSWORD:
|
||||
case AuthenticationType::DOUBLE_SHA1_PASSWORD:
|
||||
case AuthenticationType::BCRYPT_PASSWORD:
|
||||
case AuthenticationType::LDAP:
|
||||
throw Authentication::Require<BasicCredentials>("ClickHouse Basic Authentication");
|
||||
|
||||
case AuthenticationType::KERBEROS:
|
||||
throw Authentication::Require<GSSAcceptorContext>(auth_data.getKerberosRealm());
|
||||
|
||||
case AuthenticationType::SSL_CERTIFICATE:
|
||||
throw Authentication::Require<SSLCertificateCredentials>("ClickHouse X.509 Authentication");
|
||||
|
||||
case AuthenticationType::SSH_KEY:
|
||||
#if USE_SSL
|
||||
return checkSshSignature(auth_data.getSSHKeys(), ssh_credentials->getSignature(), ssh_credentials->getOriginal());
|
||||
#else
|
||||
throw Exception(ErrorCodes::SUPPORT_IS_DISABLED, "SSH is disabled, because ClickHouse is built without OpenSSL");
|
||||
#endif
|
||||
case AuthenticationType::MAX:
|
||||
break;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <Interpreters/evaluateConstantExpression.h>
|
||||
#include <Parsers/ASTExpressionList.h>
|
||||
#include <Parsers/ASTLiteral.h>
|
||||
#include <Parsers/Access/ASTPublicSSHKey.h>
|
||||
#include <Storages/checkAndGetLiteralArgument.h>
|
||||
|
||||
#include <Common/OpenSSLHelpers.h>
|
||||
@ -103,7 +104,8 @@ bool operator ==(const AuthenticationData & lhs, const AuthenticationData & rhs)
|
||||
{
|
||||
return (lhs.type == rhs.type) && (lhs.password_hash == rhs.password_hash)
|
||||
&& (lhs.ldap_server_name == rhs.ldap_server_name) && (lhs.kerberos_realm == rhs.kerberos_realm)
|
||||
&& (lhs.ssl_certificate_common_names == rhs.ssl_certificate_common_names);
|
||||
&& (lhs.ssl_certificate_common_names == rhs.ssl_certificate_common_names)
|
||||
&& (lhs.ssh_keys == rhs.ssh_keys);
|
||||
}
|
||||
|
||||
|
||||
@ -125,6 +127,7 @@ void AuthenticationData::setPassword(const String & password_)
|
||||
case AuthenticationType::LDAP:
|
||||
case AuthenticationType::KERBEROS:
|
||||
case AuthenticationType::SSL_CERTIFICATE:
|
||||
case AuthenticationType::SSH_KEY:
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot specify password for authentication type {}", toString(type));
|
||||
|
||||
case AuthenticationType::MAX:
|
||||
@ -228,6 +231,7 @@ void AuthenticationData::setPasswordHashBinary(const Digest & hash)
|
||||
case AuthenticationType::LDAP:
|
||||
case AuthenticationType::KERBEROS:
|
||||
case AuthenticationType::SSL_CERTIFICATE:
|
||||
case AuthenticationType::SSH_KEY:
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot specify password binary hash for authentication type {}", toString(type));
|
||||
|
||||
case AuthenticationType::MAX:
|
||||
@ -311,6 +315,17 @@ std::shared_ptr<ASTAuthenticationData> AuthenticationData::toAST() const
|
||||
|
||||
break;
|
||||
}
|
||||
case AuthenticationType::SSH_KEY:
|
||||
{
|
||||
#if USE_SSL
|
||||
for (const auto & key : getSSHKeys())
|
||||
node->children.push_back(std::make_shared<ASTPublicSSHKey>(key.getBase64(), key.getKeyType()));
|
||||
|
||||
break;
|
||||
#else
|
||||
throw Exception(ErrorCodes::SUPPORT_IS_DISABLED, "SSH is disabled, because ClickHouse is built without OpenSSL");
|
||||
#endif
|
||||
}
|
||||
|
||||
case AuthenticationType::NO_PASSWORD: [[fallthrough]];
|
||||
case AuthenticationType::MAX:
|
||||
@ -326,6 +341,37 @@ AuthenticationData AuthenticationData::fromAST(const ASTAuthenticationData & que
|
||||
if (query.type && query.type == AuthenticationType::NO_PASSWORD)
|
||||
return AuthenticationData();
|
||||
|
||||
/// For this type of authentication we have ASTPublicSSHKey as children for ASTAuthenticationData
|
||||
if (query.type && query.type == AuthenticationType::SSH_KEY)
|
||||
{
|
||||
#if USE_SSL
|
||||
AuthenticationData auth_data(*query.type);
|
||||
std::vector<ssh::SSHKey> keys;
|
||||
|
||||
size_t args_size = query.children.size();
|
||||
for (size_t i = 0; i < args_size; ++i)
|
||||
{
|
||||
const auto & ssh_key = query.children[i]->as<ASTPublicSSHKey &>();
|
||||
const auto & key_base64 = ssh_key.key_base64;
|
||||
const auto & type = ssh_key.type;
|
||||
|
||||
try
|
||||
{
|
||||
keys.emplace_back(ssh::SSHKeyFactory::makePublicFromBase64(key_base64, type));
|
||||
}
|
||||
catch (const std::invalid_argument &)
|
||||
{
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Bad SSH key in entry: {} with type {}", key_base64, type);
|
||||
}
|
||||
}
|
||||
|
||||
auth_data.setSSHKeys(std::move(keys));
|
||||
return auth_data;
|
||||
#else
|
||||
throw Exception(ErrorCodes::SUPPORT_IS_DISABLED, "SSH is disabled, because ClickHouse is built without OpenSSL");
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t args_size = query.children.size();
|
||||
ASTs args(args_size);
|
||||
for (size_t i = 0; i < args_size; ++i)
|
||||
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <Access/Common/AuthenticationType.h>
|
||||
#include <Common/SSH/Wrappers.h>
|
||||
#include <Parsers/Access/ASTAuthenticationData.h>
|
||||
#include <Interpreters/Context_fwd.h>
|
||||
|
||||
@ -57,6 +58,9 @@ public:
|
||||
const boost::container::flat_set<String> & getSSLCertificateCommonNames() const { return ssl_certificate_common_names; }
|
||||
void setSSLCertificateCommonNames(boost::container::flat_set<String> common_names_);
|
||||
|
||||
const std::vector<ssh::SSHKey> & getSSHKeys() const { return ssh_keys; }
|
||||
void setSSHKeys(std::vector<ssh::SSHKey> && ssh_keys_) { ssh_keys = std::forward<std::vector<ssh::SSHKey>>(ssh_keys_); }
|
||||
|
||||
friend bool operator ==(const AuthenticationData & lhs, const AuthenticationData & rhs);
|
||||
friend bool operator !=(const AuthenticationData & lhs, const AuthenticationData & rhs) { return !(lhs == rhs); }
|
||||
|
||||
@ -83,6 +87,7 @@ private:
|
||||
String kerberos_realm;
|
||||
boost::container::flat_set<String> ssl_certificate_common_names;
|
||||
String salt;
|
||||
std::vector<ssh::SSHKey> ssh_keys;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -62,6 +62,11 @@ const AuthenticationTypeInfo & AuthenticationTypeInfo::get(AuthenticationType ty
|
||||
static const auto info = make_info("BCRYPT_PASSWORD", true);
|
||||
return info;
|
||||
}
|
||||
case AuthenticationType::SSH_KEY:
|
||||
{
|
||||
static const auto info = make_info("SSH_KEY");
|
||||
return info;
|
||||
}
|
||||
case AuthenticationType::MAX:
|
||||
break;
|
||||
}
|
||||
|
@ -33,6 +33,10 @@ enum class AuthenticationType
|
||||
/// Password is encrypted in bcrypt hash.
|
||||
BCRYPT_PASSWORD,
|
||||
|
||||
/// Server sends a random string named `challenge` which client needs to encrypt with private key.
|
||||
/// The check is performed on server side by decrypting the data and comparing with the original string.
|
||||
SSH_KEY,
|
||||
|
||||
MAX,
|
||||
};
|
||||
|
||||
|
@ -86,4 +86,36 @@ class MySQLNative41Credentials : public CredentialsWithScramble
|
||||
using CredentialsWithScramble::CredentialsWithScramble;
|
||||
};
|
||||
|
||||
class SshCredentials : public Credentials
|
||||
{
|
||||
public:
|
||||
explicit SshCredentials(const String& user_name_, const String& signature_, const String& original_)
|
||||
: Credentials(user_name_), signature(signature_), original(original_)
|
||||
{
|
||||
is_ready = true;
|
||||
}
|
||||
|
||||
const String & getSignature() const
|
||||
{
|
||||
if (!isReady())
|
||||
{
|
||||
throwNotReady();
|
||||
}
|
||||
return signature;
|
||||
}
|
||||
|
||||
const String & getOriginal() const
|
||||
{
|
||||
if (!isReady())
|
||||
{
|
||||
throwNotReady();
|
||||
}
|
||||
return original;
|
||||
}
|
||||
|
||||
private:
|
||||
String signature;
|
||||
String original;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -28,8 +28,10 @@ void User::setName(const String & name_)
|
||||
/// Also it was possible to create a user with empty name for some reason.
|
||||
if (name_.empty())
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "User name is empty");
|
||||
if (name_ == USER_INTERSERVER_MARKER)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "User name '{}' is reserved", USER_INTERSERVER_MARKER);
|
||||
if (name_ == EncodedUserInfo::USER_INTERSERVER_MARKER)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "User name '{}' is reserved", name_);
|
||||
if (startsWith(name_, EncodedUserInfo::SSH_KEY_AUTHENTICAION_MARKER))
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "User name '{}' is reserved", name_);
|
||||
name = name_;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <Access/UsersConfigAccessStorage.h>
|
||||
#include <Access/Quota.h>
|
||||
#include <Common/SSH/Wrappers.h>
|
||||
#include <Access/RowPolicy.h>
|
||||
#include <Access/User.h>
|
||||
#include <Access/Role.h>
|
||||
@ -36,6 +37,7 @@ namespace ErrorCodes
|
||||
extern const int UNKNOWN_ADDRESS_PATTERN_TYPE;
|
||||
extern const int THERE_IS_NO_PROFILE;
|
||||
extern const int NOT_IMPLEMENTED;
|
||||
extern const int SUPPORT_IS_DISABLED;
|
||||
}
|
||||
|
||||
namespace
|
||||
@ -130,18 +132,21 @@ namespace
|
||||
const auto certificates_config = user_config + ".ssl_certificates";
|
||||
bool has_certificates = config.has(certificates_config);
|
||||
|
||||
size_t num_password_fields = has_no_password + has_password_plaintext + has_password_sha256_hex + has_password_double_sha1_hex + has_ldap + has_kerberos + has_certificates;
|
||||
const auto ssh_keys_config = user_config + ".ssh_keys";
|
||||
bool has_ssh_keys = config.has(ssh_keys_config);
|
||||
|
||||
size_t num_password_fields = has_no_password + has_password_plaintext + has_password_sha256_hex + has_password_double_sha1_hex + has_ldap + has_kerberos + has_certificates + has_ssh_keys;
|
||||
|
||||
if (num_password_fields > 1)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "More than one field of 'password', 'password_sha256_hex', "
|
||||
"'password_double_sha1_hex', 'no_password', 'ldap', 'kerberos', 'ssl_certificates' "
|
||||
"'password_double_sha1_hex', 'no_password', 'ldap', 'kerberos', 'ssl_certificates', 'ssh_keys' "
|
||||
"are used to specify authentication info for user {}. "
|
||||
"Must be only one of them.", user_name);
|
||||
|
||||
if (num_password_fields < 1)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Either 'password' or 'password_sha256_hex' "
|
||||
"or 'password_double_sha1_hex' or 'no_password' or 'ldap' or 'kerberos' "
|
||||
"or 'ssl_certificates' must be specified for user {}.", user_name);
|
||||
"or 'password_double_sha1_hex' or 'no_password' or 'ldap' or 'kerberos "
|
||||
"or 'ssl_certificates' or 'ssh_keys' must be specified for user {}.", user_name);
|
||||
|
||||
if (has_password_plaintext)
|
||||
{
|
||||
@ -198,6 +203,51 @@ namespace
|
||||
}
|
||||
user->auth_data.setSSLCertificateCommonNames(std::move(common_names));
|
||||
}
|
||||
else if (has_ssh_keys)
|
||||
{
|
||||
#if USE_SSL
|
||||
user->auth_data = AuthenticationData{AuthenticationType::SSH_KEY};
|
||||
|
||||
Poco::Util::AbstractConfiguration::Keys entries;
|
||||
config.keys(ssh_keys_config, entries);
|
||||
std::vector<ssh::SSHKey> keys;
|
||||
for (const String& entry : entries)
|
||||
{
|
||||
const auto conf_pref = ssh_keys_config + "." + entry + ".";
|
||||
if (entry.starts_with("ssh_key"))
|
||||
{
|
||||
String type, base64_key;
|
||||
if (config.has(conf_pref + "type"))
|
||||
{
|
||||
type = config.getString(conf_pref + "type");
|
||||
}
|
||||
else
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Expected type field in {} entry", entry);
|
||||
if (config.has(conf_pref + "base64_key"))
|
||||
{
|
||||
base64_key = config.getString(conf_pref + "base64_key");
|
||||
}
|
||||
else
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Expected base64_key field in {} entry", entry);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
keys.emplace_back(ssh::SSHKeyFactory::makePublicFromBase64(base64_key, type));
|
||||
}
|
||||
catch (const std::invalid_argument &)
|
||||
{
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Bad SSH key in entry: {}", entry);
|
||||
}
|
||||
}
|
||||
else
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Unknown ssh_key entry pattern type: {}", entry);
|
||||
}
|
||||
user->auth_data.setSSHKeys(std::move(keys));
|
||||
#else
|
||||
throw Exception(ErrorCodes::SUPPORT_IS_DISABLED, "SSH is disabled, because ClickHouse is built without OpenSSL");
|
||||
#endif
|
||||
}
|
||||
|
||||
auto auth_type = user->auth_data.getType();
|
||||
if (((auth_type == AuthenticationType::NO_PASSWORD) && !allow_no_password) ||
|
||||
|
@ -32,11 +32,13 @@ namespace ErrorCodes
|
||||
|
||||
namespace
|
||||
{
|
||||
std::shared_ptr<S3::Client>
|
||||
makeS3Client(const S3::URI & s3_uri, const String & access_key_id, const String & secret_access_key, const ContextPtr & context)
|
||||
std::shared_ptr<S3::Client> makeS3Client(
|
||||
const S3::URI & s3_uri,
|
||||
const String & access_key_id,
|
||||
const String & secret_access_key,
|
||||
const S3Settings & settings,
|
||||
const ContextPtr & context)
|
||||
{
|
||||
auto settings = context->getStorageS3Settings().getSettings(s3_uri.uri.toString());
|
||||
|
||||
Aws::Auth::AWSCredentials credentials(access_key_id, secret_access_key);
|
||||
HTTPHeaderEntries headers;
|
||||
if (access_key_id.empty())
|
||||
@ -45,13 +47,15 @@ namespace
|
||||
headers = settings.auth_settings.headers;
|
||||
}
|
||||
|
||||
const auto & request_settings = settings.request_settings;
|
||||
|
||||
S3::PocoHTTPClientConfiguration client_configuration = S3::ClientFactory::instance().createClientConfiguration(
|
||||
settings.auth_settings.region,
|
||||
context->getRemoteHostFilter(),
|
||||
static_cast<unsigned>(context->getGlobalContext()->getSettingsRef().s3_max_redirects),
|
||||
static_cast<unsigned>(context->getGlobalContext()->getSettingsRef().s3_retry_attempts),
|
||||
context->getGlobalContext()->getSettingsRef().enable_s3_requests_logging,
|
||||
/* for_disk_s3 = */ false, settings.request_settings.get_request_throttler, settings.request_settings.put_request_throttler,
|
||||
/* for_disk_s3 = */ false, request_settings.get_request_throttler, request_settings.put_request_throttler,
|
||||
s3_uri.uri.getScheme());
|
||||
|
||||
client_configuration.endpointOverride = s3_uri.endpoint;
|
||||
@ -60,6 +64,7 @@ namespace
|
||||
client_configuration.connectTimeoutMs = 10 * 1000;
|
||||
/// Requests in backups can be extremely long, set to one hour
|
||||
client_configuration.requestTimeoutMs = 60 * 60 * 1000;
|
||||
client_configuration.retryStrategy = std::make_shared<Aws::Client::DefaultRetryStrategy>(request_settings.retry_attempts);
|
||||
|
||||
return S3::ClientFactory::instance().create(
|
||||
client_configuration,
|
||||
@ -112,13 +117,14 @@ BackupReaderS3::BackupReaderS3(
|
||||
const ContextPtr & context_)
|
||||
: BackupReaderDefault(read_settings_, write_settings_, &Poco::Logger::get("BackupReaderS3"))
|
||||
, s3_uri(s3_uri_)
|
||||
, client(makeS3Client(s3_uri_, access_key_id_, secret_access_key_, context_))
|
||||
, request_settings(context_->getStorageS3Settings().getSettings(s3_uri.uri.toString()).request_settings)
|
||||
, data_source_description{DataSourceType::S3, s3_uri.endpoint, false, false}
|
||||
, s3_settings(context_->getStorageS3Settings().getSettings(s3_uri.uri.toString()))
|
||||
{
|
||||
auto & request_settings = s3_settings.request_settings;
|
||||
request_settings.updateFromSettings(context_->getSettingsRef());
|
||||
request_settings.max_single_read_retries = context_->getSettingsRef().s3_max_single_read_retries; // FIXME: Avoid taking value for endpoint
|
||||
request_settings.allow_native_copy = allow_s3_native_copy;
|
||||
client = makeS3Client(s3_uri_, access_key_id_, secret_access_key_, s3_settings, context_);
|
||||
}
|
||||
|
||||
BackupReaderS3::~BackupReaderS3() = default;
|
||||
@ -139,7 +145,7 @@ UInt64 BackupReaderS3::getFileSize(const String & file_name)
|
||||
std::unique_ptr<SeekableReadBuffer> BackupReaderS3::readFile(const String & file_name)
|
||||
{
|
||||
return std::make_unique<ReadBufferFromS3>(
|
||||
client, s3_uri.bucket, fs::path(s3_uri.key) / file_name, s3_uri.version_id, request_settings, read_settings);
|
||||
client, s3_uri.bucket, fs::path(s3_uri.key) / file_name, s3_uri.version_id, s3_settings.request_settings, read_settings);
|
||||
}
|
||||
|
||||
void BackupReaderS3::copyFileToDisk(const String & path_in_backup, size_t file_size, bool encrypted_in_backup,
|
||||
@ -169,7 +175,7 @@ void BackupReaderS3::copyFileToDisk(const String & path_in_backup, size_t file_s
|
||||
file_size,
|
||||
/* dest_bucket= */ blob_path[1],
|
||||
/* dest_key= */ blob_path[0],
|
||||
request_settings,
|
||||
s3_settings.request_settings,
|
||||
read_settings,
|
||||
object_attributes,
|
||||
threadPoolCallbackRunner<void>(getBackupsIOThreadPool().get(), "BackupReaderS3"),
|
||||
@ -198,14 +204,15 @@ BackupWriterS3::BackupWriterS3(
|
||||
const ContextPtr & context_)
|
||||
: BackupWriterDefault(read_settings_, write_settings_, &Poco::Logger::get("BackupWriterS3"))
|
||||
, s3_uri(s3_uri_)
|
||||
, client(makeS3Client(s3_uri_, access_key_id_, secret_access_key_, context_))
|
||||
, request_settings(context_->getStorageS3Settings().getSettings(s3_uri.uri.toString()).request_settings)
|
||||
, data_source_description{DataSourceType::S3, s3_uri.endpoint, false, false}
|
||||
, s3_settings(context_->getStorageS3Settings().getSettings(s3_uri.uri.toString()))
|
||||
{
|
||||
auto & request_settings = s3_settings.request_settings;
|
||||
request_settings.updateFromSettings(context_->getSettingsRef());
|
||||
request_settings.max_single_read_retries = context_->getSettingsRef().s3_max_single_read_retries; // FIXME: Avoid taking value for endpoint
|
||||
request_settings.allow_native_copy = allow_s3_native_copy;
|
||||
request_settings.setStorageClassName(storage_class_name);
|
||||
client = makeS3Client(s3_uri_, access_key_id_, secret_access_key_, s3_settings, context_);
|
||||
}
|
||||
|
||||
void BackupWriterS3::copyFileFromDisk(const String & path_in_backup, DiskPtr src_disk, const String & src_path,
|
||||
@ -230,7 +237,7 @@ void BackupWriterS3::copyFileFromDisk(const String & path_in_backup, DiskPtr src
|
||||
length,
|
||||
s3_uri.bucket,
|
||||
fs::path(s3_uri.key) / path_in_backup,
|
||||
request_settings,
|
||||
s3_settings.request_settings,
|
||||
read_settings,
|
||||
{},
|
||||
threadPoolCallbackRunner<void>(getBackupsIOThreadPool().get(), "BackupWriterS3"));
|
||||
@ -244,7 +251,7 @@ void BackupWriterS3::copyFileFromDisk(const String & path_in_backup, DiskPtr src
|
||||
|
||||
void BackupWriterS3::copyDataToFile(const String & path_in_backup, const CreateReadBufferFunction & create_read_buffer, UInt64 start_pos, UInt64 length)
|
||||
{
|
||||
copyDataToS3File(create_read_buffer, start_pos, length, client, client, s3_uri.bucket, fs::path(s3_uri.key) / path_in_backup, request_settings, {},
|
||||
copyDataToS3File(create_read_buffer, start_pos, length, client, client, s3_uri.bucket, fs::path(s3_uri.key) / path_in_backup, s3_settings.request_settings, {},
|
||||
threadPoolCallbackRunner<void>(getBackupsIOThreadPool().get(), "BackupWriterS3"));
|
||||
}
|
||||
|
||||
@ -266,7 +273,7 @@ UInt64 BackupWriterS3::getFileSize(const String & file_name)
|
||||
std::unique_ptr<ReadBuffer> BackupWriterS3::readFile(const String & file_name, size_t expected_file_size)
|
||||
{
|
||||
return std::make_unique<ReadBufferFromS3>(
|
||||
client, s3_uri.bucket, fs::path(s3_uri.key) / file_name, s3_uri.version_id, request_settings, read_settings,
|
||||
client, s3_uri.bucket, fs::path(s3_uri.key) / file_name, s3_uri.version_id, s3_settings.request_settings, read_settings,
|
||||
false, 0, 0, false, expected_file_size);
|
||||
}
|
||||
|
||||
@ -278,7 +285,7 @@ std::unique_ptr<WriteBuffer> BackupWriterS3::writeFile(const String & file_name)
|
||||
s3_uri.bucket,
|
||||
fs::path(s3_uri.key) / file_name,
|
||||
DBMS_DEFAULT_BUFFER_SIZE,
|
||||
request_settings,
|
||||
s3_settings.request_settings,
|
||||
std::nullopt,
|
||||
threadPoolCallbackRunner<void>(getBackupsIOThreadPool().get(), "BackupWriterS3"),
|
||||
write_settings);
|
||||
|
@ -29,9 +29,9 @@ public:
|
||||
|
||||
private:
|
||||
const S3::URI s3_uri;
|
||||
const std::shared_ptr<S3::Client> client;
|
||||
S3Settings::RequestSettings request_settings;
|
||||
const DataSourceDescription data_source_description;
|
||||
S3Settings s3_settings;
|
||||
std::shared_ptr<S3::Client> client;
|
||||
};
|
||||
|
||||
|
||||
@ -57,10 +57,10 @@ private:
|
||||
void removeFilesBatch(const Strings & file_names);
|
||||
|
||||
const S3::URI s3_uri;
|
||||
const std::shared_ptr<S3::Client> client;
|
||||
S3Settings::RequestSettings request_settings;
|
||||
std::optional<bool> supports_batch_delete;
|
||||
const DataSourceDescription data_source_description;
|
||||
S3Settings s3_settings;
|
||||
std::shared_ptr<S3::Client> client;
|
||||
std::optional<bool> supports_batch_delete;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ add_subdirectory (Formats)
|
||||
|
||||
add_headers_and_sources(clickhouse_common_io Common)
|
||||
add_headers_and_sources(clickhouse_common_io Common/HashTable)
|
||||
add_headers_and_sources(clickhouse_common_io Common/SSH)
|
||||
add_headers_and_sources(clickhouse_common_io IO)
|
||||
add_headers_and_sources(clickhouse_common_io IO/Archives)
|
||||
add_headers_and_sources(clickhouse_common_io IO/Resource)
|
||||
@ -337,6 +338,10 @@ if (TARGET ch_contrib::crc32-vpmsum)
|
||||
target_link_libraries(clickhouse_common_io PUBLIC ch_contrib::crc32-vpmsum)
|
||||
endif()
|
||||
|
||||
if (TARGET ch_contrib::ssh)
|
||||
target_link_libraries(clickhouse_common_io PUBLIC ch_contrib::ssh)
|
||||
endif()
|
||||
|
||||
dbms_target_link_libraries(PUBLIC ch_contrib::abseil_swiss_tables)
|
||||
target_link_libraries (clickhouse_common_io PUBLIC ch_contrib::abseil_swiss_tables)
|
||||
|
||||
|
@ -67,6 +67,7 @@ Connection::~Connection() = default;
|
||||
Connection::Connection(const String & host_, UInt16 port_,
|
||||
const String & default_database_,
|
||||
const String & user_, const String & password_,
|
||||
const ssh::SSHKey & ssh_private_key_,
|
||||
const String & quota_key_,
|
||||
const String & cluster_,
|
||||
const String & cluster_secret_,
|
||||
@ -74,7 +75,9 @@ Connection::Connection(const String & host_, UInt16 port_,
|
||||
Protocol::Compression compression_,
|
||||
Protocol::Secure secure_)
|
||||
: host(host_), port(port_), default_database(default_database_)
|
||||
, user(user_), password(password_), quota_key(quota_key_)
|
||||
, user(user_), password(password_)
|
||||
, ssh_private_key(ssh_private_key_)
|
||||
, quota_key(quota_key_)
|
||||
, cluster(cluster_)
|
||||
, cluster_secret(cluster_secret_)
|
||||
, client_name(client_name_)
|
||||
@ -189,6 +192,7 @@ void Connection::connect(const ConnectionTimeouts & timeouts)
|
||||
|
||||
sendHello();
|
||||
receiveHello(timeouts.handshake_timeout);
|
||||
|
||||
if (server_revision >= DBMS_MIN_PROTOCOL_VERSION_WITH_ADDENDUM)
|
||||
sendAddendum();
|
||||
|
||||
@ -255,6 +259,17 @@ void Connection::disconnect()
|
||||
}
|
||||
|
||||
|
||||
String Connection::packStringForSshSign(String challenge)
|
||||
{
|
||||
String message;
|
||||
message.append(std::to_string(DBMS_TCP_PROTOCOL_VERSION));
|
||||
message.append(default_database);
|
||||
message.append(user);
|
||||
message.append(challenge);
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
void Connection::sendHello()
|
||||
{
|
||||
/** Disallow control characters in user controlled parameters
|
||||
@ -291,7 +306,7 @@ void Connection::sendHello()
|
||||
/// (NOTE we do not check for DBMS_MIN_REVISION_WITH_INTERSERVER_SECRET, since we cannot ignore inter-server secret if it was requested)
|
||||
if (!cluster_secret.empty())
|
||||
{
|
||||
writeStringBinary(USER_INTERSERVER_MARKER, *out);
|
||||
writeStringBinary(EncodedUserInfo::USER_INTERSERVER_MARKER, *out);
|
||||
writeStringBinary("" /* password */, *out);
|
||||
|
||||
#if USE_SSL
|
||||
@ -301,6 +316,16 @@ void Connection::sendHello()
|
||||
"Inter-server secret support is disabled, because ClickHouse was built without SSL library");
|
||||
#endif
|
||||
}
|
||||
#if USE_SSL
|
||||
/// Just inform server that we will authenticate using SSH keys.
|
||||
else if (!ssh_private_key.isEmpty())
|
||||
{
|
||||
writeStringBinary(fmt::format("{}{}", EncodedUserInfo::SSH_KEY_AUTHENTICAION_MARKER, user), *out);
|
||||
writeStringBinary(password, *out);
|
||||
|
||||
performHandshakeForSSHAuth();
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
writeStringBinary(user, *out);
|
||||
@ -319,6 +344,41 @@ void Connection::sendAddendum()
|
||||
}
|
||||
|
||||
|
||||
void Connection::performHandshakeForSSHAuth()
|
||||
{
|
||||
#if USE_SSL
|
||||
String challenge;
|
||||
{
|
||||
writeVarUInt(Protocol::Client::SSHChallengeRequest, *out);
|
||||
out->next();
|
||||
UInt64 packet_type = 0;
|
||||
if (in->eof())
|
||||
throw Poco::Net::NetException("Connection reset by peer");
|
||||
|
||||
readVarUInt(packet_type, *in);
|
||||
if (packet_type == Protocol::Server::SSHChallenge)
|
||||
{
|
||||
readStringBinary(challenge, *in);
|
||||
}
|
||||
else if (packet_type == Protocol::Server::Exception)
|
||||
receiveException()->rethrow();
|
||||
else
|
||||
{
|
||||
/// Close connection, to not stay in unsynchronised state.
|
||||
disconnect();
|
||||
throwUnexpectedPacket(packet_type, "SSHChallenge or Exception");
|
||||
}
|
||||
}
|
||||
|
||||
writeVarUInt(Protocol::Client::SSHChallengeResponse, *out);
|
||||
String to_sign = packStringForSshSign(challenge);
|
||||
String signature = ssh_private_key.signString(to_sign);
|
||||
writeStringBinary(signature, *out);
|
||||
out->next();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void Connection::receiveHello(const Poco::Timespan & handshake_timeout)
|
||||
{
|
||||
TimeoutSetter timeout_setter(*socket, socket->getSendTimeout(), handshake_timeout);
|
||||
@ -1202,6 +1262,7 @@ ServerConnectionPtr Connection::createConnection(const ConnectionParameters & pa
|
||||
parameters.default_database,
|
||||
parameters.user,
|
||||
parameters.password,
|
||||
parameters.ssh_private_key,
|
||||
parameters.quota_key,
|
||||
"", /* cluster */
|
||||
"", /* cluster_secret */
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <Poco/Net/StreamSocket.h>
|
||||
|
||||
#include "config.h"
|
||||
#include <Common/SSH/Wrappers.h>
|
||||
#include <Client/IServerConnection.h>
|
||||
#include <Core/Defines.h>
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
#include <atomic>
|
||||
#include <optional>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
@ -51,6 +53,7 @@ public:
|
||||
Connection(const String & host_, UInt16 port_,
|
||||
const String & default_database_,
|
||||
const String & user_, const String & password_,
|
||||
const ssh::SSHKey & ssh_private_key_,
|
||||
const String & quota_key_,
|
||||
const String & cluster_,
|
||||
const String & cluster_secret_,
|
||||
@ -167,6 +170,7 @@ private:
|
||||
String default_database;
|
||||
String user;
|
||||
String password;
|
||||
ssh::SSHKey ssh_private_key;
|
||||
String quota_key;
|
||||
|
||||
/// For inter-server authorization
|
||||
@ -259,6 +263,10 @@ private:
|
||||
|
||||
void connect(const ConnectionTimeouts & timeouts);
|
||||
void sendHello();
|
||||
String packStringForSshSign(String challenge);
|
||||
|
||||
void performHandshakeForSSHAuth();
|
||||
|
||||
void sendAddendum();
|
||||
void receiveHello(const Poco::Timespan & handshake_timeout);
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <Core/Types.h>
|
||||
#include <IO/ConnectionTimeouts.h>
|
||||
#include <Poco/Util/AbstractConfiguration.h>
|
||||
#include <Common/SSH/Wrappers.h>
|
||||
#include <Common/Exception.h>
|
||||
#include <Common/isLocalAddress.h>
|
||||
#include <Common/DNSResolver.h>
|
||||
@ -19,6 +20,7 @@ namespace DB
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int BAD_ARGUMENTS;
|
||||
extern const int SUPPORT_IS_DISABLED;
|
||||
}
|
||||
|
||||
ConnectionParameters::ConnectionParameters(const Poco::Util::AbstractConfiguration & config,
|
||||
@ -35,26 +37,57 @@ ConnectionParameters::ConnectionParameters(const Poco::Util::AbstractConfigurati
|
||||
/// changed the default value to "default" to fix the issue when the user in the prompt is blank
|
||||
user = config.getString("user", "default");
|
||||
|
||||
bool password_prompt = false;
|
||||
if (config.getBool("ask-password", false))
|
||||
if (!config.has("ssh-key-file"))
|
||||
{
|
||||
if (config.has("password"))
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Specified both --password and --ask-password. Remove one of them");
|
||||
password_prompt = true;
|
||||
bool password_prompt = false;
|
||||
if (config.getBool("ask-password", false))
|
||||
{
|
||||
if (config.has("password"))
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Specified both --password and --ask-password. Remove one of them");
|
||||
password_prompt = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
password = config.getString("password", "");
|
||||
/// if the value of --password is omitted, the password will be set implicitly to "\n"
|
||||
if (password == ASK_PASSWORD)
|
||||
password_prompt = true;
|
||||
}
|
||||
if (password_prompt)
|
||||
{
|
||||
std::string prompt{"Password for user (" + user + "): "};
|
||||
char buf[1000] = {};
|
||||
if (auto * result = readpassphrase(prompt.c_str(), buf, sizeof(buf), 0))
|
||||
password = result;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
password = config.getString("password", "");
|
||||
if (password == ASK_PASSWORD)
|
||||
password_prompt = true;
|
||||
}
|
||||
if (password_prompt)
|
||||
{
|
||||
std::string prompt{"Password for user (" + user + "): "};
|
||||
char buf[1000] = {};
|
||||
if (auto * result = readpassphrase(prompt.c_str(), buf, sizeof(buf), 0))
|
||||
password = result;
|
||||
#if USE_SSL
|
||||
std::string filename = config.getString("ssh-key-file");
|
||||
std::string passphrase;
|
||||
if (config.has("ssh-key-passphrase"))
|
||||
{
|
||||
passphrase = config.getString("ssh-key-passphrase");
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string prompt{"Enter your private key passphrase (leave empty for no passphrase): "};
|
||||
char buf[1000] = {};
|
||||
if (auto * result = readpassphrase(prompt.c_str(), buf, sizeof(buf), 0))
|
||||
passphrase = result;
|
||||
}
|
||||
|
||||
ssh::SSHKey key = ssh::SSHKeyFactory::makePrivateFromFile(filename, passphrase);
|
||||
if (!key.isPrivate())
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Found public key in file: {} but expected private", filename);
|
||||
|
||||
ssh_private_key = std::move(key);
|
||||
#else
|
||||
throw Exception(ErrorCodes::SUPPORT_IS_DISABLED, "SSH is disabled, because ClickHouse is built without OpenSSL");
|
||||
#endif
|
||||
}
|
||||
|
||||
quota_key = config.getString("quota_key", "");
|
||||
|
||||
/// By default compression is disabled if address looks like localhost.
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <string>
|
||||
#include <Core/Protocol.h>
|
||||
#include <IO/ConnectionTimeouts.h>
|
||||
#include <Common/SSH/Wrappers.h>
|
||||
|
||||
namespace Poco::Util
|
||||
{
|
||||
@ -19,6 +20,7 @@ struct ConnectionParameters
|
||||
std::string user;
|
||||
std::string password;
|
||||
std::string quota_key;
|
||||
ssh::SSHKey ssh_private_key;
|
||||
Protocol::Secure security = Protocol::Secure::Disable;
|
||||
Protocol::Compression compression = Protocol::Compression::Enable;
|
||||
ConnectionTimeouts timeouts;
|
||||
|
@ -115,7 +115,7 @@ protected:
|
||||
{
|
||||
return std::make_shared<Connection>(
|
||||
host, port,
|
||||
default_database, user, password, quota_key,
|
||||
default_database, user, password, ssh::SSHKey(), quota_key,
|
||||
cluster, cluster_secret,
|
||||
client_name, compression, secure);
|
||||
}
|
||||
|
@ -1,10 +1,13 @@
|
||||
#include <Client/MultiplexedConnections.h>
|
||||
|
||||
#include <Common/thread_local_rng.h>
|
||||
#include <Common/logger_useful.h>
|
||||
#include <Core/Protocol.h>
|
||||
#include <IO/ConnectionTimeouts.h>
|
||||
#include <IO/Operators.h>
|
||||
#include <Interpreters/ClientInfo.h>
|
||||
#include <base/getThreadId.h>
|
||||
#include <base/hex.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -19,6 +22,13 @@ namespace ErrorCodes
|
||||
}
|
||||
|
||||
|
||||
#define MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION \
|
||||
mutex_last_locked_by.store((getThreadId() << 32) | __LINE__); \
|
||||
memcpy(mutex_memory_dump.data(), &cancel_mutex, mutex_memory_dump.size()); \
|
||||
mutex_locked += 1; \
|
||||
SCOPE_EXIT({ mutex_locked -= 1; });
|
||||
|
||||
|
||||
MultiplexedConnections::MultiplexedConnections(Connection & connection, const Settings & settings_, const ThrottlerPtr & throttler)
|
||||
: settings(settings_)
|
||||
{
|
||||
@ -73,6 +83,7 @@ MultiplexedConnections::MultiplexedConnections(
|
||||
void MultiplexedConnections::sendScalarsData(Scalars & data)
|
||||
{
|
||||
std::lock_guard lock(cancel_mutex);
|
||||
MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION
|
||||
|
||||
if (!sent_query)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot send scalars data: query not yet sent.");
|
||||
@ -88,6 +99,7 @@ void MultiplexedConnections::sendScalarsData(Scalars & data)
|
||||
void MultiplexedConnections::sendExternalTablesData(std::vector<ExternalTablesData> & data)
|
||||
{
|
||||
std::lock_guard lock(cancel_mutex);
|
||||
MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION
|
||||
|
||||
if (!sent_query)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot send external tables data: query not yet sent.");
|
||||
@ -116,6 +128,7 @@ void MultiplexedConnections::sendQuery(
|
||||
bool with_pending_data)
|
||||
{
|
||||
std::lock_guard lock(cancel_mutex);
|
||||
MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION
|
||||
|
||||
if (sent_query)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Query already sent.");
|
||||
@ -173,6 +186,7 @@ void MultiplexedConnections::sendQuery(
|
||||
void MultiplexedConnections::sendIgnoredPartUUIDs(const std::vector<UUID> & uuids)
|
||||
{
|
||||
std::lock_guard lock(cancel_mutex);
|
||||
MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION
|
||||
|
||||
if (sent_query)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot send uuids after query is sent.");
|
||||
@ -189,6 +203,7 @@ void MultiplexedConnections::sendIgnoredPartUUIDs(const std::vector<UUID> & uuid
|
||||
void MultiplexedConnections::sendReadTaskResponse(const String & response)
|
||||
{
|
||||
std::lock_guard lock(cancel_mutex);
|
||||
MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION
|
||||
if (cancelled)
|
||||
return;
|
||||
current_connection->sendReadTaskResponse(response);
|
||||
@ -198,6 +213,7 @@ void MultiplexedConnections::sendReadTaskResponse(const String & response)
|
||||
void MultiplexedConnections::sendMergeTreeReadTaskResponse(const ParallelReadResponse & response)
|
||||
{
|
||||
std::lock_guard lock(cancel_mutex);
|
||||
MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION
|
||||
if (cancelled)
|
||||
return;
|
||||
current_connection->sendMergeTreeReadTaskResponse(response);
|
||||
@ -207,13 +223,29 @@ void MultiplexedConnections::sendMergeTreeReadTaskResponse(const ParallelReadRes
|
||||
Packet MultiplexedConnections::receivePacket()
|
||||
{
|
||||
std::lock_guard lock(cancel_mutex);
|
||||
MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION
|
||||
Packet packet = receivePacketUnlocked({});
|
||||
return packet;
|
||||
}
|
||||
|
||||
void MultiplexedConnections::disconnect()
|
||||
{
|
||||
std::lock_guard lock(cancel_mutex);
|
||||
/// We've seen this lock mysteriously get stuck forever, without any other thread seeming to
|
||||
/// hold the mutex. This is temporary code to print some extra information next time it happens.
|
||||
/// std::lock_guard lock(cancel_mutex);
|
||||
if (!cancel_mutex.try_lock_for(std::chrono::hours(1)))
|
||||
{
|
||||
UInt64 last_locked = mutex_last_locked_by.load();
|
||||
std::array<UInt8, sizeof(std::timed_mutex)> new_memory_dump;
|
||||
memcpy(new_memory_dump.data(), &cancel_mutex, new_memory_dump.size());
|
||||
LOG_ERROR(&Poco::Logger::get("MultiplexedConnections"), "Deadlock in MultiplexedConnections::disconnect()! Mutex was last (instrumentedly) locked by thread {} on line {}, lock balance: {}, mutex memory when last locked: {}, mutex memory now: {}", last_locked >> 32, last_locked & 0xffffffff, mutex_locked.load(), hexString(mutex_memory_dump.data(), mutex_memory_dump.size()), hexString(new_memory_dump.data(), new_memory_dump.size()));
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Deadlock in MultiplexedConnections::disconnect()");
|
||||
}
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wthread-safety-analysis"
|
||||
std::lock_guard lock(cancel_mutex, std::adopt_lock);
|
||||
#pragma clang diagnostic pop
|
||||
MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION
|
||||
|
||||
for (ReplicaState & state : replica_states)
|
||||
{
|
||||
@ -229,6 +261,7 @@ void MultiplexedConnections::disconnect()
|
||||
void MultiplexedConnections::sendCancel()
|
||||
{
|
||||
std::lock_guard lock(cancel_mutex);
|
||||
MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION
|
||||
|
||||
if (!sent_query || cancelled)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot cancel. Either no query sent or already cancelled.");
|
||||
@ -246,6 +279,7 @@ void MultiplexedConnections::sendCancel()
|
||||
Packet MultiplexedConnections::drain()
|
||||
{
|
||||
std::lock_guard lock(cancel_mutex);
|
||||
MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION
|
||||
|
||||
if (!cancelled)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot drain connections: cancel first.");
|
||||
@ -286,6 +320,7 @@ Packet MultiplexedConnections::drain()
|
||||
std::string MultiplexedConnections::dumpAddresses() const
|
||||
{
|
||||
std::lock_guard lock(cancel_mutex);
|
||||
MUTEX_LOCK_TEMPORARY_DEBUG_INSTRUMENTATION
|
||||
return dumpAddressesUnlocked();
|
||||
}
|
||||
|
||||
|
@ -105,9 +105,15 @@ private:
|
||||
/// std::nullopt if parallel reading from replicas is not used
|
||||
std::optional<ReplicaInfo> replica_info;
|
||||
|
||||
/// A mutex for the sendCancel function to execute safely
|
||||
/// in separate thread.
|
||||
mutable std::mutex cancel_mutex;
|
||||
/// A mutex for the sendCancel function to execute safely in separate thread.
|
||||
mutable std::timed_mutex cancel_mutex;
|
||||
|
||||
/// Temporary instrumentation to debug a weird deadlock on cancel_mutex.
|
||||
/// TODO: Once the investigation is done, get rid of these, and of INSTRUMENTED_LOCK_MUTEX, and
|
||||
/// change cancel_mutex to std::mutex.
|
||||
mutable std::atomic<UInt64> mutex_last_locked_by{0};
|
||||
mutable std::atomic<Int64> mutex_locked{0};
|
||||
mutable std::array<UInt8, sizeof(std::timed_mutex)> mutex_memory_dump;
|
||||
|
||||
friend struct RemoteQueryExecutorRoutine;
|
||||
};
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <Common/assert_cast.h>
|
||||
#include <Common/WeakHash.h>
|
||||
#include <Common/HashTable/Hash.h>
|
||||
#include <Common/RadixSort.h>
|
||||
|
||||
#include <base/unaligned.h>
|
||||
#include <base/sort.h>
|
||||
@ -15,6 +16,7 @@
|
||||
#include <Columns/ColumnDecimal.h>
|
||||
#include <Columns/ColumnCompressed.h>
|
||||
#include <Columns/MaskOperations.h>
|
||||
#include <Columns/RadixSortHelper.h>
|
||||
#include <Processors/Transforms/ColumnGathererTransform.h>
|
||||
|
||||
|
||||
@ -159,6 +161,59 @@ void ColumnDecimal<T>::getPermutation(IColumn::PermutationSortDirection directio
|
||||
return data[lhs] > data[rhs];
|
||||
};
|
||||
|
||||
size_t data_size = data.size();
|
||||
res.resize(data_size);
|
||||
|
||||
if (limit >= data_size)
|
||||
limit = 0;
|
||||
|
||||
for (size_t i = 0; i < data_size; ++i)
|
||||
res[i] = i;
|
||||
|
||||
if constexpr (is_arithmetic_v<NativeT> && !is_big_int_v<NativeT>)
|
||||
{
|
||||
if (!limit)
|
||||
{
|
||||
/// A case for radix sort
|
||||
/// LSD RadixSort is stable
|
||||
|
||||
bool reverse = direction == IColumn::PermutationSortDirection::Descending;
|
||||
bool ascending = direction == IColumn::PermutationSortDirection::Ascending;
|
||||
bool sort_is_stable = stability == IColumn::PermutationSortStability::Stable;
|
||||
|
||||
/// TODO: LSD RadixSort is currently not stable if direction is descending
|
||||
bool use_radix_sort = (sort_is_stable && ascending) || !sort_is_stable;
|
||||
|
||||
/// Thresholds on size. Lower threshold is arbitrary. Upper threshold is chosen by the type for histogram counters.
|
||||
if (data_size >= 256 && data_size <= std::numeric_limits<UInt32>::max() && use_radix_sort)
|
||||
{
|
||||
for (size_t i = 0; i < data_size; ++i)
|
||||
res[i] = i;
|
||||
|
||||
bool try_sort = false;
|
||||
|
||||
if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
try_sort = trySort(res.begin(), res.end(), comparator_ascending);
|
||||
else if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Stable)
|
||||
try_sort = trySort(res.begin(), res.end(), comparator_ascending_stable);
|
||||
else if (direction == IColumn::PermutationSortDirection::Descending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
try_sort = trySort(res.begin(), res.end(), comparator_descending);
|
||||
else
|
||||
try_sort = trySort(res.begin(), res.end(), comparator_descending_stable);
|
||||
|
||||
if (try_sort)
|
||||
return;
|
||||
|
||||
PaddedPODArray<ValueWithIndex<NativeT>> pairs(data_size);
|
||||
for (UInt32 i = 0; i < static_cast<UInt32>(data_size); ++i)
|
||||
pairs[i] = {data[i].value, i};
|
||||
|
||||
RadixSort<RadixSortTraits<NativeT>>::executeLSD(pairs.data(), data_size, reverse, res.data());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
this->getPermutationImpl(limit, res, comparator_ascending, DefaultSort(), DefaultPartialSort());
|
||||
else if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Stable)
|
||||
@ -191,7 +246,37 @@ void ColumnDecimal<T>::updatePermutation(IColumn::PermutationSortDirection direc
|
||||
return data[lhs] < data[rhs];
|
||||
};
|
||||
auto equals_comparator = [this](size_t lhs, size_t rhs) { return data[lhs] == data[rhs]; };
|
||||
auto sort = [](auto begin, auto end, auto pred) { ::sort(begin, end, pred); };
|
||||
auto sort = [&](auto begin, auto end, auto pred)
|
||||
{
|
||||
bool reverse = direction == IColumn::PermutationSortDirection::Descending;
|
||||
bool ascending = direction == IColumn::PermutationSortDirection::Ascending;
|
||||
bool sort_is_stable = stability == IColumn::PermutationSortStability::Stable;
|
||||
|
||||
/// TODO: LSD RadixSort is currently not stable if direction is descending
|
||||
bool use_radix_sort = (sort_is_stable && ascending) || !sort_is_stable;
|
||||
size_t size = end - begin;
|
||||
|
||||
if (size >= 256 && size <= std::numeric_limits<UInt32>::max() && use_radix_sort)
|
||||
{
|
||||
bool try_sort = trySort(begin, end, pred);
|
||||
if (try_sort)
|
||||
return;
|
||||
|
||||
PaddedPODArray<ValueWithIndex<NativeT>> pairs(size);
|
||||
size_t index = 0;
|
||||
|
||||
for (auto * it = begin; it != end; ++it)
|
||||
{
|
||||
pairs[index] = {data[*it].value, static_cast<UInt32>(*it)};
|
||||
++index;
|
||||
}
|
||||
|
||||
RadixSort<RadixSortTraits<NativeT>>::executeLSD(pairs.data(), size, reverse, res.data());
|
||||
return;
|
||||
}
|
||||
|
||||
::sort(begin, end, pred);
|
||||
};
|
||||
auto partial_sort = [](auto begin, auto mid, auto end, auto pred) { ::partial_sort(begin, mid, end, pred); };
|
||||
|
||||
if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <Columns/ColumnsCommon.h>
|
||||
#include <Columns/ColumnCompressed.h>
|
||||
#include <Columns/MaskOperations.h>
|
||||
#include <Columns/RadixSortHelper.h>
|
||||
#include <Processors/Transforms/ColumnGathererTransform.h>
|
||||
#include <IO/WriteHelpers.h>
|
||||
#include <Common/Arena.h>
|
||||
@ -192,26 +193,6 @@ struct ColumnVector<T>::equals
|
||||
bool operator()(size_t lhs, size_t rhs) const { return CompareHelper<T>::equals(parent.data[lhs], parent.data[rhs], nan_direction_hint); }
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
template <typename T>
|
||||
struct ValueWithIndex
|
||||
{
|
||||
T value;
|
||||
UInt32 index;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct RadixSortTraits : RadixSortNumTraits<T>
|
||||
{
|
||||
using Element = ValueWithIndex<T>;
|
||||
using Result = size_t;
|
||||
|
||||
static T & extractKey(Element & elem) { return elem.value; }
|
||||
static size_t extractResult(Element & elem) { return elem.index; }
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_EMBEDDED_COMPILER
|
||||
|
||||
template <typename T>
|
||||
@ -254,35 +235,25 @@ template <typename T>
|
||||
void ColumnVector<T>::getPermutation(IColumn::PermutationSortDirection direction, IColumn::PermutationSortStability stability,
|
||||
size_t limit, int nan_direction_hint, IColumn::Permutation & res) const
|
||||
{
|
||||
size_t s = data.size();
|
||||
res.resize(s);
|
||||
size_t data_size = data.size();
|
||||
res.resize(data_size);
|
||||
|
||||
if (s == 0)
|
||||
if (data_size == 0)
|
||||
return;
|
||||
|
||||
if (limit >= s)
|
||||
if (limit >= data_size)
|
||||
limit = 0;
|
||||
|
||||
if (limit)
|
||||
{
|
||||
for (size_t i = 0; i < s; ++i)
|
||||
res[i] = i;
|
||||
for (size_t i = 0; i < data_size; ++i)
|
||||
res[i] = i;
|
||||
|
||||
if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
::partial_sort(res.begin(), res.begin() + limit, res.end(), less(*this, nan_direction_hint));
|
||||
else if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Stable)
|
||||
::partial_sort(res.begin(), res.begin() + limit, res.end(), less_stable(*this, nan_direction_hint));
|
||||
else if (direction == IColumn::PermutationSortDirection::Descending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
::partial_sort(res.begin(), res.begin() + limit, res.end(), greater(*this, nan_direction_hint));
|
||||
else if (direction == IColumn::PermutationSortDirection::Descending && stability == IColumn::PermutationSortStability::Stable)
|
||||
::partial_sort(res.begin(), res.begin() + limit, res.end(), greater_stable(*this, nan_direction_hint));
|
||||
}
|
||||
else
|
||||
if constexpr (is_arithmetic_v<T> && !is_big_int_v<T>)
|
||||
{
|
||||
/// A case for radix sort
|
||||
/// LSD RadixSort is stable
|
||||
if constexpr (is_arithmetic_v<T> && !is_big_int_v<T>)
|
||||
if (!limit)
|
||||
{
|
||||
/// A case for radix sort
|
||||
/// LSD RadixSort is stable
|
||||
|
||||
bool reverse = direction == IColumn::PermutationSortDirection::Descending;
|
||||
bool ascending = direction == IColumn::PermutationSortDirection::Ascending;
|
||||
bool sort_is_stable = stability == IColumn::PermutationSortStability::Stable;
|
||||
@ -291,13 +262,27 @@ void ColumnVector<T>::getPermutation(IColumn::PermutationSortDirection direction
|
||||
bool use_radix_sort = (sort_is_stable && ascending && !std::is_floating_point_v<T>) || !sort_is_stable;
|
||||
|
||||
/// Thresholds on size. Lower threshold is arbitrary. Upper threshold is chosen by the type for histogram counters.
|
||||
if (s >= 256 && s <= std::numeric_limits<UInt32>::max() && use_radix_sort)
|
||||
if (data_size >= 256 && data_size <= std::numeric_limits<UInt32>::max() && use_radix_sort)
|
||||
{
|
||||
PaddedPODArray<ValueWithIndex<T>> pairs(s);
|
||||
for (UInt32 i = 0; i < static_cast<UInt32>(s); ++i)
|
||||
bool try_sort = false;
|
||||
|
||||
if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
try_sort = trySort(res.begin(), res.end(), less(*this, nan_direction_hint));
|
||||
else if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Stable)
|
||||
try_sort = trySort(res.begin(), res.end(), less_stable(*this, nan_direction_hint));
|
||||
else if (direction == IColumn::PermutationSortDirection::Descending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
try_sort = trySort(res.begin(), res.end(), greater(*this, nan_direction_hint));
|
||||
else
|
||||
try_sort = trySort(res.begin(), res.end(), greater_stable(*this, nan_direction_hint));
|
||||
|
||||
if (try_sort)
|
||||
return;
|
||||
|
||||
PaddedPODArray<ValueWithIndex<T>> pairs(data_size);
|
||||
for (UInt32 i = 0; i < static_cast<UInt32>(data_size); ++i)
|
||||
pairs[i] = {data[i], i};
|
||||
|
||||
RadixSort<RadixSortTraits<T>>::executeLSD(pairs.data(), s, reverse, res.data());
|
||||
RadixSort<RadixSortTraits<T>>::executeLSD(pairs.data(), data_size, reverse, res.data());
|
||||
|
||||
/// Radix sort treats all NaNs to be greater than all numbers.
|
||||
/// If the user needs the opposite, we must move them accordingly.
|
||||
@ -305,9 +290,9 @@ void ColumnVector<T>::getPermutation(IColumn::PermutationSortDirection direction
|
||||
{
|
||||
size_t nans_to_move = 0;
|
||||
|
||||
for (size_t i = 0; i < s; ++i)
|
||||
for (size_t i = 0; i < data_size; ++i)
|
||||
{
|
||||
if (isNaN(data[res[reverse ? i : s - 1 - i]]))
|
||||
if (isNaN(data[res[reverse ? i : data_size - 1 - i]]))
|
||||
++nans_to_move;
|
||||
else
|
||||
break;
|
||||
@ -315,38 +300,35 @@ void ColumnVector<T>::getPermutation(IColumn::PermutationSortDirection direction
|
||||
|
||||
if (nans_to_move)
|
||||
{
|
||||
std::rotate(std::begin(res), std::begin(res) + (reverse ? nans_to_move : s - nans_to_move), std::end(res));
|
||||
std::rotate(std::begin(res), std::begin(res) + (reverse ? nans_to_move : data_size - nans_to_move), std::end(res));
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/// Default sorting algorithm.
|
||||
for (size_t i = 0; i < s; ++i)
|
||||
res[i] = i;
|
||||
|
||||
if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
::sort(res.begin(), res.end(), less(*this, nan_direction_hint));
|
||||
else if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Stable)
|
||||
::sort(res.begin(), res.end(), less_stable(*this, nan_direction_hint));
|
||||
else if (direction == IColumn::PermutationSortDirection::Descending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
::sort(res.begin(), res.end(), greater(*this, nan_direction_hint));
|
||||
else if (direction == IColumn::PermutationSortDirection::Descending && stability == IColumn::PermutationSortStability::Stable)
|
||||
::sort(res.begin(), res.end(), greater_stable(*this, nan_direction_hint));
|
||||
}
|
||||
|
||||
if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
this->getPermutationImpl(limit, res, less(*this, nan_direction_hint), DefaultSort(), DefaultPartialSort());
|
||||
else if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Stable)
|
||||
this->getPermutationImpl(limit, res, less_stable(*this, nan_direction_hint), DefaultSort(), DefaultPartialSort());
|
||||
else if (direction == IColumn::PermutationSortDirection::Descending && stability == IColumn::PermutationSortStability::Unstable)
|
||||
this->getPermutationImpl(limit, res, greater(*this, nan_direction_hint), DefaultSort(), DefaultPartialSort());
|
||||
else
|
||||
this->getPermutationImpl(limit, res, greater_stable(*this, nan_direction_hint), DefaultSort(), DefaultPartialSort());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void ColumnVector<T>::updatePermutation(IColumn::PermutationSortDirection direction, IColumn::PermutationSortStability stability,
|
||||
size_t limit, int nan_direction_hint, IColumn::Permutation & res, EqualRanges & equal_ranges) const
|
||||
{
|
||||
bool reverse = direction == IColumn::PermutationSortDirection::Descending;
|
||||
bool ascending = direction == IColumn::PermutationSortDirection::Ascending;
|
||||
bool sort_is_stable = stability == IColumn::PermutationSortStability::Stable;
|
||||
|
||||
auto sort = [&](auto begin, auto end, auto pred)
|
||||
{
|
||||
bool reverse = direction == IColumn::PermutationSortDirection::Descending;
|
||||
bool ascending = direction == IColumn::PermutationSortDirection::Ascending;
|
||||
bool sort_is_stable = stability == IColumn::PermutationSortStability::Stable;
|
||||
|
||||
/// A case for radix sort
|
||||
if constexpr (is_arithmetic_v<T> && !is_big_int_v<T>)
|
||||
{
|
||||
@ -357,6 +339,10 @@ void ColumnVector<T>::updatePermutation(IColumn::PermutationSortDirection direct
|
||||
/// Thresholds on size. Lower threshold is arbitrary. Upper threshold is chosen by the type for histogram counters.
|
||||
if (size >= 256 && size <= std::numeric_limits<UInt32>::max() && use_radix_sort)
|
||||
{
|
||||
bool try_sort = trySort(begin, end, pred);
|
||||
if (try_sort)
|
||||
return;
|
||||
|
||||
PaddedPODArray<ValueWithIndex<T>> pairs(size);
|
||||
size_t index = 0;
|
||||
|
||||
|
25
src/Columns/RadixSortHelper.h
Normal file
25
src/Columns/RadixSortHelper.h
Normal file
@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <Common/RadixSort.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
template <typename T>
|
||||
struct ValueWithIndex
|
||||
{
|
||||
T value;
|
||||
UInt32 index;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct RadixSortTraits : RadixSortNumTraits<T>
|
||||
{
|
||||
using Element = ValueWithIndex<T>;
|
||||
using Result = size_t;
|
||||
|
||||
static T & extractKey(Element & elem) { return elem.value; }
|
||||
static size_t extractResult(Element & elem) { return elem.index; }
|
||||
};
|
||||
|
||||
}
|
@ -588,6 +588,7 @@
|
||||
M(703, INVALID_IDENTIFIER) \
|
||||
M(704, CANNOT_USE_QUERY_CACHE_WITH_NONDETERMINISTIC_FUNCTIONS) \
|
||||
M(705, TABLE_NOT_EMPTY) \
|
||||
M(706, LIBSSH_ERROR) \
|
||||
M(999, KEEPER_EXCEPTION) \
|
||||
M(1000, POCO_EXCEPTION) \
|
||||
M(1001, STD_EXCEPTION) \
|
||||
|
@ -211,6 +211,7 @@
|
||||
\
|
||||
M(RegexpCreated, "Compiled regular expressions. Identical regular expressions compiled just once and cached forever.") \
|
||||
M(ContextLock, "Number of times the lock of Context was acquired or tried to acquire. This is global lock.") \
|
||||
M(ContextLockWaitMicroseconds, "Context lock wait time in microseconds") \
|
||||
\
|
||||
M(StorageBufferFlush, "Number of times a buffer in a 'Buffer' table was flushed.") \
|
||||
M(StorageBufferErrorOnFlush, "Number of times a buffer in the 'Buffer' table has not been able to flush due to error writing in the destination table.") \
|
||||
|
183
src/Common/SSH/Wrappers.cpp
Normal file
183
src/Common/SSH/Wrappers.cpp
Normal file
@ -0,0 +1,183 @@
|
||||
#include <Common/SSH/Wrappers.h>
|
||||
# if USE_SSL
|
||||
# include <stdexcept>
|
||||
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wreserved-macro-identifier"
|
||||
# pragma GCC diagnostic ignored "-Wreserved-identifier"
|
||||
|
||||
# include <libssh/libssh.h>
|
||||
|
||||
# pragma GCC diagnostic pop
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
class SSHString
|
||||
{
|
||||
public:
|
||||
explicit SSHString(std::string_view input)
|
||||
{
|
||||
string = ssh_string_new(input.size());
|
||||
ssh_string_fill(string, input.data(), input.size());
|
||||
}
|
||||
|
||||
explicit SSHString(ssh_string c_other) { string = c_other; }
|
||||
|
||||
ssh_string get() { return string; }
|
||||
|
||||
String toString()
|
||||
{
|
||||
return String(ssh_string_get_char(string), ssh_string_len(string));
|
||||
}
|
||||
|
||||
~SSHString()
|
||||
{
|
||||
ssh_string_free(string);
|
||||
}
|
||||
|
||||
private:
|
||||
ssh_string string;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int LIBSSH_ERROR;
|
||||
}
|
||||
|
||||
namespace ssh
|
||||
{
|
||||
|
||||
SSHKey SSHKeyFactory::makePrivateFromFile(String filename, String passphrase)
|
||||
{
|
||||
ssh_key key;
|
||||
int rc = ssh_pki_import_privkey_file(filename.c_str(), passphrase.c_str(), nullptr, nullptr, &key);
|
||||
if (rc != SSH_OK)
|
||||
{
|
||||
throw Exception(ErrorCodes::LIBSSH_ERROR, "Can't import SSH private key from file");
|
||||
}
|
||||
return SSHKey(key);
|
||||
}
|
||||
|
||||
SSHKey SSHKeyFactory::makePublicFromFile(String filename)
|
||||
{
|
||||
ssh_key key;
|
||||
int rc = ssh_pki_import_pubkey_file(filename.c_str(), &key);
|
||||
if (rc != SSH_OK)
|
||||
throw Exception(ErrorCodes::LIBSSH_ERROR, "Can't import SSH public key from file");
|
||||
|
||||
return SSHKey(key);
|
||||
}
|
||||
|
||||
SSHKey SSHKeyFactory::makePublicFromBase64(String base64_key, String type_name)
|
||||
{
|
||||
ssh_key key;
|
||||
auto key_type = ssh_key_type_from_name(type_name.c_str());
|
||||
int rc = ssh_pki_import_pubkey_base64(base64_key.c_str(), key_type, &key);
|
||||
if (rc != SSH_OK)
|
||||
throw Exception(ErrorCodes::LIBSSH_ERROR, "Bad SSH public key provided");
|
||||
|
||||
return SSHKey(key);
|
||||
}
|
||||
|
||||
SSHKey::SSHKey(const SSHKey & other)
|
||||
{
|
||||
key = ssh_key_dup(other.key);
|
||||
}
|
||||
|
||||
SSHKey & SSHKey::operator=(const SSHKey & other)
|
||||
{
|
||||
ssh_key_free(key);
|
||||
key = ssh_key_dup(other.key);
|
||||
return *this;
|
||||
}
|
||||
|
||||
SSHKey & SSHKey::operator=(SSHKey && other) noexcept
|
||||
{
|
||||
ssh_key_free(key);
|
||||
key = other.key;
|
||||
other.key = nullptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool SSHKey::operator==(const SSHKey & other) const
|
||||
{
|
||||
return isEqual(other);
|
||||
}
|
||||
|
||||
bool SSHKey::isEqual(const SSHKey & other) const
|
||||
{
|
||||
int rc = ssh_key_cmp(key, other.key, SSH_KEY_CMP_PUBLIC);
|
||||
return rc == 0;
|
||||
}
|
||||
|
||||
String SSHKey::signString(std::string_view input) const
|
||||
{
|
||||
SSHString input_str(input);
|
||||
ssh_string c_output = nullptr;
|
||||
int rc = pki_sign_string(key, input_str.get(), &c_output);
|
||||
if (rc != SSH_OK)
|
||||
throw Exception(ErrorCodes::LIBSSH_ERROR, "Error singing with ssh key");
|
||||
|
||||
SSHString output(c_output);
|
||||
return output.toString();
|
||||
}
|
||||
|
||||
bool SSHKey::verifySignature(std::string_view signature, std::string_view original) const
|
||||
{
|
||||
SSHString sig(signature), orig(original);
|
||||
int rc = pki_verify_string(key, sig.get(), orig.get());
|
||||
return rc == SSH_OK;
|
||||
}
|
||||
|
||||
bool SSHKey::isPrivate() const
|
||||
{
|
||||
return ssh_key_is_private(key);
|
||||
}
|
||||
|
||||
bool SSHKey::isPublic() const
|
||||
{
|
||||
return ssh_key_is_public(key);
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
struct CStringDeleter
|
||||
{
|
||||
[[maybe_unused]] void operator()(char * ptr) const { std::free(ptr); }
|
||||
};
|
||||
}
|
||||
|
||||
String SSHKey::getBase64() const
|
||||
{
|
||||
char * buf = nullptr;
|
||||
int rc = ssh_pki_export_pubkey_base64(key, &buf);
|
||||
|
||||
if (rc != SSH_OK)
|
||||
throw DB::Exception(DB::ErrorCodes::LIBSSH_ERROR, "Failed to export public key to base64");
|
||||
|
||||
/// Create a String from cstring, which makes a copy of the first one and requires freeing memory after it
|
||||
/// This is to safely manage buf memory
|
||||
std::unique_ptr<char, CStringDeleter> buf_ptr(buf);
|
||||
return String(buf_ptr.get());
|
||||
}
|
||||
|
||||
String SSHKey::getKeyType() const
|
||||
{
|
||||
return ssh_key_type_to_char(ssh_key_type(key));
|
||||
}
|
||||
|
||||
SSHKey::~SSHKey()
|
||||
{
|
||||
ssh_key_free(key); // it's safe free from libssh
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
78
src/Common/SSH/Wrappers.h
Normal file
78
src/Common/SSH/Wrappers.h
Normal file
@ -0,0 +1,78 @@
|
||||
#pragma once
|
||||
#include <Common/Exception.h>
|
||||
#include "config.h"
|
||||
#if USE_SSL
|
||||
# include <string_view>
|
||||
# include <base/types.h>
|
||||
|
||||
using ssh_key = struct ssh_key_struct *;
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ssh
|
||||
{
|
||||
|
||||
class SSHKeyFactory;
|
||||
|
||||
class SSHKey
|
||||
{
|
||||
public:
|
||||
SSHKey() = default;
|
||||
~SSHKey();
|
||||
|
||||
SSHKey(const SSHKey & other);
|
||||
SSHKey(SSHKey && other) noexcept
|
||||
{
|
||||
key = other.key;
|
||||
other.key = nullptr;
|
||||
}
|
||||
SSHKey & operator=(const SSHKey & other);
|
||||
SSHKey & operator=(SSHKey && other) noexcept;
|
||||
|
||||
bool operator==(const SSHKey &) const;
|
||||
bool isEqual(const SSHKey & other) const;
|
||||
|
||||
bool isEmpty() { return key == nullptr; }
|
||||
String signString(std::string_view input) const;
|
||||
bool verifySignature(std::string_view signature, std::string_view original) const;
|
||||
|
||||
bool isPublic() const;
|
||||
bool isPrivate() const;
|
||||
|
||||
String getBase64() const;
|
||||
String getKeyType() const;
|
||||
|
||||
friend SSHKeyFactory;
|
||||
private:
|
||||
explicit SSHKey(ssh_key key_) : key(key_) { }
|
||||
ssh_key key = nullptr;
|
||||
};
|
||||
|
||||
|
||||
class SSHKeyFactory
|
||||
{
|
||||
public:
|
||||
/// The check whether the path is allowed to read for ClickHouse has
|
||||
/// (e.g. a file is inside `user_files` directory)
|
||||
/// to be done outside of this functions.
|
||||
static SSHKey makePrivateFromFile(String filename, String passphrase);
|
||||
static SSHKey makePublicFromFile(String filename);
|
||||
static SSHKey makePublicFromBase64(String base64_key, String type_name);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
namespace ssh
|
||||
{
|
||||
class SSHKey
|
||||
{
|
||||
public:
|
||||
bool operator==(const SSHKey &) const = default;
|
||||
[[ noreturn ]] bool isEmpty() { std::terminate(); }
|
||||
[[ noreturn ]] String signString(std::string_view) const { std::terminate(); }
|
||||
};
|
||||
}
|
||||
#endif
|
@ -22,6 +22,7 @@
|
||||
#include <base/extended_types.h>
|
||||
#include <base/types.h>
|
||||
#include <base/unaligned.h>
|
||||
#include <base/hex.h>
|
||||
#include <Common/Exception.h>
|
||||
|
||||
#include <city.h>
|
||||
@ -257,6 +258,16 @@ inline UInt128 sipHash128(const char * data, const size_t size)
|
||||
return sipHash128Keyed(0, 0, data, size);
|
||||
}
|
||||
|
||||
inline String sipHash128String(const char * data, const size_t size)
|
||||
{
|
||||
return getHexUIntLowercase(sipHash128(data, size));
|
||||
}
|
||||
|
||||
inline String sipHash128String(const String & str)
|
||||
{
|
||||
return sipHash128String(str.data(), str.size());
|
||||
}
|
||||
|
||||
inline UInt128 sipHash128ReferenceKeyed(UInt64 key0, UInt64 key1, const char * data, const size_t size)
|
||||
{
|
||||
SipHash hash(key0, key1, true);
|
||||
|
@ -1,57 +0,0 @@
|
||||
#include <Common/StatusInfo.h>
|
||||
#include <Common/ExternalLoaderStatus.h>
|
||||
|
||||
/// Available status. Add something here as you wish.
|
||||
#define APPLY_FOR_STATUS(M) \
|
||||
M(DictionaryStatus, "Dictionary Status.", DB::getStatusEnumAllPossibleValues()) \
|
||||
|
||||
|
||||
namespace CurrentStatusInfo
|
||||
{
|
||||
#define M(NAME, DOCUMENTATION, ENUM) extern const Status NAME = Status(__COUNTER__);
|
||||
APPLY_FOR_STATUS(M)
|
||||
#undef M
|
||||
constexpr Status END = Status(__COUNTER__);
|
||||
|
||||
std::mutex locks[END] {};
|
||||
std::unordered_map<String, Int8> values[END] {};
|
||||
|
||||
const char * getName(Status event)
|
||||
{
|
||||
static const char * strings[] =
|
||||
{
|
||||
#define M(NAME, DOCUMENTATION, ENUM) #NAME,
|
||||
APPLY_FOR_STATUS(M)
|
||||
#undef M
|
||||
};
|
||||
|
||||
return strings[event];
|
||||
}
|
||||
|
||||
const char * getDocumentation(Status event)
|
||||
{
|
||||
static const char * strings[] =
|
||||
{
|
||||
#define M(NAME, DOCUMENTATION, ENUM) #DOCUMENTATION,
|
||||
APPLY_FOR_STATUS(M)
|
||||
#undef M
|
||||
};
|
||||
|
||||
return strings[event];
|
||||
}
|
||||
|
||||
const std::vector<std::pair<String, Int8>> & getAllPossibleValues(Status event)
|
||||
{
|
||||
static const std::vector<std::pair<String, Int8>> enum_values [] =
|
||||
{
|
||||
#define M(NAME, DOCUMENTATION, ENUM) ENUM,
|
||||
APPLY_FOR_STATUS(M)
|
||||
#undef M
|
||||
};
|
||||
return enum_values[event];
|
||||
}
|
||||
|
||||
Status end() { return END; }
|
||||
}
|
||||
|
||||
#undef APPLY_FOR_STATUS
|
@ -1,39 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
#include <atomic>
|
||||
#include <vector>
|
||||
#include <base/types.h>
|
||||
#include <base/strong_typedef.h>
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
namespace CurrentStatusInfo
|
||||
{
|
||||
using Status = StrongTypedef<size_t, struct StatusTag>;
|
||||
using Key = std::string;
|
||||
|
||||
const char * getName(Status event);
|
||||
const char * getDocumentation(Status event);
|
||||
const std::vector<std::pair<String, Int8>> & getAllPossibleValues(Status event);
|
||||
|
||||
extern std::unordered_map<String, Int8> values[];
|
||||
extern std::mutex locks[];
|
||||
|
||||
Status end();
|
||||
|
||||
inline void set(Status status, Key key, Int8 value)
|
||||
{
|
||||
std::lock_guard lock(locks[status]);
|
||||
values[status][key] = value;
|
||||
}
|
||||
|
||||
inline void unset(Status status, Key key)
|
||||
{
|
||||
std::lock_guard lock(locks[status]);
|
||||
values[status].erase(key);
|
||||
}
|
||||
}
|
@ -212,6 +212,9 @@ struct CreateRequest : virtual Request
|
||||
bool is_sequential = false;
|
||||
ACLs acls;
|
||||
|
||||
/// should it succeed if node already exists
|
||||
bool not_exists = false;
|
||||
|
||||
void addRootPath(const String & root_path) override;
|
||||
String getPath() const override { return path; }
|
||||
|
||||
|
@ -29,7 +29,7 @@ using EventPtr = std::shared_ptr<Poco::Event>;
|
||||
template <typename R>
|
||||
using AsyncResponses = std::vector<std::pair<std::string, std::future<R>>>;
|
||||
|
||||
Coordination::RequestPtr makeCreateRequest(const std::string & path, const std::string & data, int create_mode);
|
||||
Coordination::RequestPtr makeCreateRequest(const std::string & path, const std::string & data, int create_mode, bool ignore_if_exists = false);
|
||||
Coordination::RequestPtr makeRemoveRequest(const std::string & path, int version);
|
||||
Coordination::RequestPtr makeSetRequest(const std::string & path, const std::string & data, int version);
|
||||
Coordination::RequestPtr makeCheckRequest(const std::string & path, int version);
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include "ZooKeeper.h"
|
||||
#include "Coordination/KeeperConstants.h"
|
||||
#include "Coordination/KeeperFeatureFlags.h"
|
||||
#include "ZooKeeperImpl.h"
|
||||
#include "KeeperException.h"
|
||||
#include "TestKeeper.h"
|
||||
@ -353,6 +355,33 @@ void ZooKeeper::createIfNotExists(const std::string & path, const std::string &
|
||||
|
||||
void ZooKeeper::createAncestors(const std::string & path)
|
||||
{
|
||||
size_t pos = 1;
|
||||
|
||||
if (isFeatureEnabled(DB::KeeperFeatureFlag::CREATE_IF_NOT_EXISTS))
|
||||
{
|
||||
Coordination::Requests create_ops;
|
||||
|
||||
while (true)
|
||||
{
|
||||
pos = path.find('/', pos);
|
||||
if (pos == std::string::npos)
|
||||
break;
|
||||
|
||||
auto request = makeCreateRequest(path.substr(0, pos), "", CreateMode::Persistent, true);
|
||||
create_ops.emplace_back(request);
|
||||
|
||||
++pos;
|
||||
}
|
||||
|
||||
Coordination::Responses responses;
|
||||
Coordination::Error code = multiImpl(create_ops, responses);
|
||||
|
||||
if (code == Coordination::Error::ZOK)
|
||||
return;
|
||||
|
||||
throw KeeperException::fromPath(code, path);
|
||||
}
|
||||
|
||||
std::string data;
|
||||
std::string path_created; // Ignored
|
||||
std::vector<std::string> pending_nodes;
|
||||
@ -1333,13 +1362,14 @@ void KeeperMultiException::check(
|
||||
}
|
||||
|
||||
|
||||
Coordination::RequestPtr makeCreateRequest(const std::string & path, const std::string & data, int create_mode)
|
||||
Coordination::RequestPtr makeCreateRequest(const std::string & path, const std::string & data, int create_mode, bool ignore_if_exists)
|
||||
{
|
||||
auto request = std::make_shared<Coordination::CreateRequest>();
|
||||
request->path = path;
|
||||
request->data = data;
|
||||
request->is_ephemeral = create_mode == CreateMode::Ephemeral || create_mode == CreateMode::EphemeralSequential;
|
||||
request->is_sequential = create_mode == CreateMode::PersistentSequential || create_mode == CreateMode::EphemeralSequential;
|
||||
request->not_exists = ignore_if_exists;
|
||||
return request;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "Common/ZooKeeper/IKeeper.h"
|
||||
#include "Common/ZooKeeper/ZooKeeperConstants.h"
|
||||
#include <Common/ZooKeeper/ZooKeeperCommon.h>
|
||||
#include <Common/ZooKeeper/ZooKeeperIO.h>
|
||||
#include <Common/Stopwatch.h>
|
||||
@ -695,7 +696,6 @@ void ZooKeeperMultiResponse::writeImpl(WriteBuffer & out) const
|
||||
ZooKeeperResponsePtr ZooKeeperHeartbeatRequest::makeResponse() const { return setTime(std::make_shared<ZooKeeperHeartbeatResponse>()); }
|
||||
ZooKeeperResponsePtr ZooKeeperSyncRequest::makeResponse() const { return setTime(std::make_shared<ZooKeeperSyncResponse>()); }
|
||||
ZooKeeperResponsePtr ZooKeeperAuthRequest::makeResponse() const { return setTime(std::make_shared<ZooKeeperAuthResponse>()); }
|
||||
ZooKeeperResponsePtr ZooKeeperCreateRequest::makeResponse() const { return setTime(std::make_shared<ZooKeeperCreateResponse>()); }
|
||||
ZooKeeperResponsePtr ZooKeeperRemoveRequest::makeResponse() const { return setTime(std::make_shared<ZooKeeperRemoveResponse>()); }
|
||||
ZooKeeperResponsePtr ZooKeeperExistsRequest::makeResponse() const { return setTime(std::make_shared<ZooKeeperExistsResponse>()); }
|
||||
ZooKeeperResponsePtr ZooKeeperGetRequest::makeResponse() const { return setTime(std::make_shared<ZooKeeperGetResponse>()); }
|
||||
@ -704,6 +704,13 @@ ZooKeeperResponsePtr ZooKeeperReconfigRequest::makeResponse() const { return set
|
||||
ZooKeeperResponsePtr ZooKeeperListRequest::makeResponse() const { return setTime(std::make_shared<ZooKeeperListResponse>()); }
|
||||
ZooKeeperResponsePtr ZooKeeperSimpleListRequest::makeResponse() const { return setTime(std::make_shared<ZooKeeperSimpleListResponse>()); }
|
||||
|
||||
ZooKeeperResponsePtr ZooKeeperCreateRequest::makeResponse() const
|
||||
{
|
||||
if (not_exists)
|
||||
return setTime(std::make_shared<ZooKeeperCreateIfNotExistsResponse>());
|
||||
return setTime(std::make_shared<ZooKeeperCreateResponse>());
|
||||
}
|
||||
|
||||
ZooKeeperResponsePtr ZooKeeperCheckRequest::makeResponse() const
|
||||
{
|
||||
if (not_exists)
|
||||
@ -977,7 +984,7 @@ void registerZooKeeperRequest(ZooKeeperRequestFactory & factory)
|
||||
res->operation_type = ZooKeeperMultiRequest::OperationType::Read;
|
||||
else if constexpr (num == OpNum::Multi)
|
||||
res->operation_type = ZooKeeperMultiRequest::OperationType::Write;
|
||||
else if constexpr (num == OpNum::CheckNotExists)
|
||||
else if constexpr (num == OpNum::CheckNotExists || num == OpNum::CreateIfNotExists)
|
||||
res->not_exists = true;
|
||||
|
||||
return res;
|
||||
@ -1001,6 +1008,7 @@ ZooKeeperRequestFactory::ZooKeeperRequestFactory()
|
||||
registerZooKeeperRequest<OpNum::Reconfig, ZooKeeperReconfigRequest>(*this);
|
||||
registerZooKeeperRequest<OpNum::Multi, ZooKeeperMultiRequest>(*this);
|
||||
registerZooKeeperRequest<OpNum::MultiRead, ZooKeeperMultiRequest>(*this);
|
||||
registerZooKeeperRequest<OpNum::CreateIfNotExists, ZooKeeperCreateRequest>(*this);
|
||||
registerZooKeeperRequest<OpNum::SessionID, ZooKeeperSessionIDRequest>(*this);
|
||||
registerZooKeeperRequest<OpNum::GetACL, ZooKeeperGetACLRequest>(*this);
|
||||
registerZooKeeperRequest<OpNum::SetACL, ZooKeeperSetACLRequest>(*this);
|
||||
|
@ -230,7 +230,7 @@ struct ZooKeeperCreateRequest final : public CreateRequest, ZooKeeperRequest
|
||||
ZooKeeperCreateRequest() = default;
|
||||
explicit ZooKeeperCreateRequest(const CreateRequest & base) : CreateRequest(base) {}
|
||||
|
||||
OpNum getOpNum() const override { return OpNum::Create; }
|
||||
OpNum getOpNum() const override { return not_exists ? OpNum::CreateIfNotExists : OpNum::Create; }
|
||||
void writeImpl(WriteBuffer & out) const override;
|
||||
void readImpl(ReadBuffer & in) override;
|
||||
std::string toStringImpl() const override;
|
||||
@ -243,7 +243,7 @@ struct ZooKeeperCreateRequest final : public CreateRequest, ZooKeeperRequest
|
||||
void createLogElements(LogElements & elems) const override;
|
||||
};
|
||||
|
||||
struct ZooKeeperCreateResponse final : CreateResponse, ZooKeeperResponse
|
||||
struct ZooKeeperCreateResponse : CreateResponse, ZooKeeperResponse
|
||||
{
|
||||
void readImpl(ReadBuffer & in) override;
|
||||
|
||||
@ -256,6 +256,12 @@ struct ZooKeeperCreateResponse final : CreateResponse, ZooKeeperResponse
|
||||
void fillLogElements(LogElements & elems, size_t idx) const override;
|
||||
};
|
||||
|
||||
struct ZooKeeperCreateIfNotExistsResponse : ZooKeeperCreateResponse
|
||||
{
|
||||
OpNum getOpNum() const override { return OpNum::CreateIfNotExists; }
|
||||
using ZooKeeperCreateResponse::ZooKeeperCreateResponse;
|
||||
};
|
||||
|
||||
struct ZooKeeperRemoveRequest final : RemoveRequest, ZooKeeperRequest
|
||||
{
|
||||
ZooKeeperRemoveRequest() = default;
|
||||
|
@ -22,6 +22,7 @@ static const std::unordered_set<int32_t> VALID_OPERATIONS =
|
||||
static_cast<int32_t>(OpNum::Reconfig),
|
||||
static_cast<int32_t>(OpNum::Multi),
|
||||
static_cast<int32_t>(OpNum::MultiRead),
|
||||
static_cast<int32_t>(OpNum::CreateIfNotExists),
|
||||
static_cast<int32_t>(OpNum::Auth),
|
||||
static_cast<int32_t>(OpNum::SessionID),
|
||||
static_cast<int32_t>(OpNum::SetACL),
|
||||
|
@ -38,6 +38,7 @@ enum class OpNum : int32_t
|
||||
// CH Keeper specific operations
|
||||
FilteredList = 500,
|
||||
CheckNotExists = 501,
|
||||
CreateIfNotExists = 502,
|
||||
|
||||
SessionID = 997, /// Special internal request
|
||||
};
|
||||
|
@ -17,4 +17,5 @@ const String keeper_system_path = "/keeper";
|
||||
const String keeper_api_version_path = keeper_system_path + "/api_version";
|
||||
const String keeper_api_feature_flags_path = keeper_system_path + "/feature_flags";
|
||||
const String keeper_config_path = keeper_system_path + "/config";
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ enum class KeeperFeatureFlag : size_t
|
||||
FILTERED_LIST = 0,
|
||||
MULTI_READ,
|
||||
CHECK_NOT_EXISTS,
|
||||
CREATE_IF_NOT_EXISTS,
|
||||
};
|
||||
|
||||
class KeeperFeatureFlags
|
||||
|
@ -956,6 +956,9 @@ struct KeeperStorageCreateRequestProcessor final : public KeeperStorageRequestPr
|
||||
std::string path_created = request.path;
|
||||
if (request.is_sequential)
|
||||
{
|
||||
if (request.not_exists)
|
||||
return {KeeperStorage::Delta{zxid, Coordination::Error::ZBADARGUMENTS}};
|
||||
|
||||
auto seq_num = parent_node->seq_num;
|
||||
|
||||
std::stringstream seq_num_str; // STYLE_CHECK_ALLOW_STD_STRING_STREAM
|
||||
@ -974,7 +977,12 @@ struct KeeperStorageCreateRequestProcessor final : public KeeperStorageRequestPr
|
||||
}
|
||||
|
||||
if (storage.uncommitted_state.getNode(path_created))
|
||||
{
|
||||
if (zk_request->getOpNum() == Coordination::OpNum::CreateIfNotExists)
|
||||
return new_deltas;
|
||||
|
||||
return {KeeperStorage::Delta{zxid, Coordination::Error::ZNODEEXISTS}};
|
||||
}
|
||||
|
||||
if (getBaseNodeName(path_created).size == 0)
|
||||
return {KeeperStorage::Delta{zxid, Coordination::Error::ZBADARGUMENTS}};
|
||||
@ -1031,6 +1039,13 @@ struct KeeperStorageCreateRequestProcessor final : public KeeperStorageRequestPr
|
||||
Coordination::ZooKeeperResponsePtr response_ptr = zk_request->makeResponse();
|
||||
Coordination::ZooKeeperCreateResponse & response = dynamic_cast<Coordination::ZooKeeperCreateResponse &>(*response_ptr);
|
||||
|
||||
if (storage.uncommitted_state.deltas.begin()->zxid != zxid)
|
||||
{
|
||||
response.path_created = zk_request->getPath();
|
||||
response.error = Coordination::Error::ZOK;
|
||||
return response_ptr;
|
||||
}
|
||||
|
||||
if (const auto result = storage.commit(zxid); result != Coordination::Error::ZOK)
|
||||
{
|
||||
response.error = result;
|
||||
@ -1764,6 +1779,7 @@ struct KeeperStorageMultiRequestProcessor final : public KeeperStorageRequestPro
|
||||
switch (sub_zk_request->getOpNum())
|
||||
{
|
||||
case Coordination::OpNum::Create:
|
||||
case Coordination::OpNum::CreateIfNotExists:
|
||||
check_operation_type(OperationType::Write);
|
||||
concrete_requests.push_back(std::make_shared<KeeperStorageCreateRequestProcessor>(sub_zk_request));
|
||||
break;
|
||||
@ -2030,6 +2046,7 @@ KeeperStorageRequestProcessorsFactory::KeeperStorageRequestProcessorsFactory()
|
||||
registerKeeperRequestProcessor<Coordination::OpNum::Check, KeeperStorageCheckRequestProcessor>(*this);
|
||||
registerKeeperRequestProcessor<Coordination::OpNum::Multi, KeeperStorageMultiRequestProcessor>(*this);
|
||||
registerKeeperRequestProcessor<Coordination::OpNum::MultiRead, KeeperStorageMultiRequestProcessor>(*this);
|
||||
registerKeeperRequestProcessor<Coordination::OpNum::CreateIfNotExists, KeeperStorageCreateRequestProcessor>(*this);
|
||||
registerKeeperRequestProcessor<Coordination::OpNum::SetACL, KeeperStorageSetACLRequestProcessor>(*this);
|
||||
registerKeeperRequestProcessor<Coordination::OpNum::GetACL, KeeperStorageGetACLRequestProcessor>(*this);
|
||||
registerKeeperRequestProcessor<Coordination::OpNum::CheckNotExists, KeeperStorageCheckRequestProcessor>(*this);
|
||||
|
@ -53,9 +53,16 @@ namespace DB
|
||||
/// Using this block the client can initialize the output formatter and display the prefix of resulting table
|
||||
/// beforehand.
|
||||
|
||||
namespace EncodedUserInfo
|
||||
{
|
||||
|
||||
/// Marker of the inter-server secret (passed in the user name)
|
||||
/// (anyway user cannot be started with a whitespace)
|
||||
const char USER_INTERSERVER_MARKER[] = " INTERSERVER SECRET ";
|
||||
/// Marker of the SSH keys based authentication (passed in the user name)
|
||||
const char SSH_KEY_AUTHENTICAION_MARKER[] = " SSH KEY AUTHENTICATION ";
|
||||
|
||||
};
|
||||
|
||||
namespace Protocol
|
||||
{
|
||||
@ -84,7 +91,8 @@ namespace Protocol
|
||||
MergeTreeAllRangesAnnouncement = 15,
|
||||
MergeTreeReadTaskRequest = 16, /// Request from a MergeTree replica to a coordinator
|
||||
TimezoneUpdate = 17, /// Receive server's (session-wide) default timezone
|
||||
MAX = TimezoneUpdate,
|
||||
SSHChallenge = 18, /// Return challenge for SSH signature signing
|
||||
MAX = SSHChallenge,
|
||||
|
||||
};
|
||||
|
||||
@ -113,6 +121,7 @@ namespace Protocol
|
||||
"MergeTreeAllRangesAnnouncement",
|
||||
"MergeTreeReadTaskRequest",
|
||||
"TimezoneUpdate",
|
||||
"SSHChallenge",
|
||||
};
|
||||
return packet <= MAX
|
||||
? data[packet]
|
||||
@ -150,7 +159,10 @@ namespace Protocol
|
||||
IgnoredPartUUIDs = 8, /// List of unique parts ids to exclude from query processing
|
||||
ReadTaskResponse = 9, /// A filename to read from s3 (used in s3Cluster)
|
||||
MergeTreeReadTaskResponse = 10, /// Coordinator's decision with a modified set of mark ranges allowed to read
|
||||
MAX = MergeTreeReadTaskResponse,
|
||||
|
||||
SSHChallengeRequest = 11, /// Request for SSH signature challenge
|
||||
SSHChallengeResponse = 12, /// Request for SSH signature challenge
|
||||
MAX = SSHChallengeResponse,
|
||||
};
|
||||
|
||||
inline const char * toString(UInt64 packet)
|
||||
@ -166,7 +178,9 @@ namespace Protocol
|
||||
"Scalar",
|
||||
"IgnoredPartUUIDs",
|
||||
"ReadTaskResponse",
|
||||
"MergeTreeReadTaskResponse"
|
||||
"MergeTreeReadTaskResponse",
|
||||
"SSHChallengeRequest",
|
||||
"SSHChallengeResponse"
|
||||
};
|
||||
return packet <= MAX
|
||||
? data[packet]
|
||||
|
@ -71,6 +71,8 @@
|
||||
|
||||
#define DBMS_MIN_REVISION_WITH_SPARSE_SERIALIZATION 54465
|
||||
|
||||
#define DBMS_MIN_REVISION_WITH_SSH_AUTHENTICATION 54466
|
||||
|
||||
/// Version of ClickHouse TCP protocol.
|
||||
///
|
||||
/// Should be incremented manually on protocol changes.
|
||||
@ -78,4 +80,4 @@
|
||||
/// NOTE: DBMS_TCP_PROTOCOL_VERSION has nothing common with VERSION_REVISION,
|
||||
/// later is just a number for server version (one number instead of commit SHA)
|
||||
/// for simplicity (sometimes it may be more convenient in some use cases).
|
||||
#define DBMS_TCP_PROTOCOL_VERSION 54465
|
||||
#define DBMS_TCP_PROTOCOL_VERSION 54466
|
||||
|
@ -149,7 +149,7 @@ class IColumn;
|
||||
M(Bool, allow_suspicious_indices, false, "Reject primary/secondary indexes and sorting keys with identical expressions", 0) \
|
||||
M(Bool, compile_expressions, false, "Compile some scalar functions and operators to native code.", 0) \
|
||||
M(UInt64, min_count_to_compile_expression, 3, "The number of identical expressions before they are JIT-compiled", 0) \
|
||||
M(Bool, compile_aggregate_expressions, true, "Compile aggregate functions to native code. This feature has a bug and should not be used.", 0) \
|
||||
M(Bool, compile_aggregate_expressions, true, "Compile aggregate functions to native code.", 0) \
|
||||
M(UInt64, min_count_to_compile_aggregate_expression, 3, "The number of identical aggregate expressions before they are JIT-compiled", 0) \
|
||||
M(Bool, compile_sort_description, true, "Compile sort description to native code.", 0) \
|
||||
M(UInt64, min_count_to_compile_sort_description, 3, "The number of identical sort descriptions before they are JIT-compiled", 0) \
|
||||
@ -280,6 +280,7 @@ class IColumn;
|
||||
\
|
||||
M(UInt64, http_headers_progress_interval_ms, 100, "Do not send HTTP headers X-ClickHouse-Progress more frequently than at each specified interval.", 0) \
|
||||
M(Bool, http_wait_end_of_query, false, "Enable HTTP response buffering on the server-side.", 0) \
|
||||
M(Bool, http_write_exception_in_output_format, true, "Write exception in output format to produce valid output. Works with JSON and XML formats.", 0) \
|
||||
M(UInt64, http_response_buffer_size, 0, "The number of bytes to buffer in the server memory before sending a HTTP response to the client or flushing to disk (when http_wait_end_of_query is enabled).", 0) \
|
||||
\
|
||||
M(Bool, fsync_metadata, true, "Do fsync after changing metadata for tables and databases (.sql files). Could be disabled in case of poor latency on server with high load of DDL queries and high load of disk subsystem.", 0) \
|
||||
@ -804,8 +805,8 @@ class IColumn;
|
||||
M(Bool, keeper_map_strict_mode, false, "Enforce additional checks during operations on KeeperMap. E.g. throw an exception on an insert for already existing key", 0) \
|
||||
M(UInt64, extract_kvp_max_pairs_per_row, 1000, "Max number pairs that can be produced by extractKeyValuePairs function. Used to safeguard against consuming too much memory.", 0) \
|
||||
M(Timezone, session_timezone, "", "This setting can be removed in the future due to potential caveats. It is experimental and is not suitable for production usage. The default timezone for current session or query. The server default timezone if empty.", 0) \
|
||||
M(Bool, allow_create_index_without_type, false, "Allow CREATE INDEX query without TYPE. Query will be ignored. Made for SQL compatibility tests.", 0)\
|
||||
M(Bool, create_index_ignore_unique, false, "Ignore UNIQUE keyword in CREATE UNIQUE INDEX. Made for SQL compatibility tests.", 0) \
|
||||
M(Bool, allow_create_index_without_type, false, "Allow CREATE INDEX query without TYPE. Query will be ignored. Made for SQL compatibility tests.", 0) \
|
||||
M(Bool, create_index_ignore_unique, false, "Ignore UNIQUE keyword in CREATE UNIQUE INDEX. Made for SQL compatibility tests.", 0) \
|
||||
|
||||
// End of COMMON_SETTINGS
|
||||
// Please add settings related to formats into the FORMAT_FACTORY_SETTINGS, move obsolete settings to OBSOLETE_SETTINGS and obsolete format settings to OBSOLETE_FORMAT_SETTINGS.
|
||||
@ -854,7 +855,7 @@ class IColumn;
|
||||
MAKE_DEPRECATED_BY_SERVER_CONFIG(M, UInt64, max_replicated_sends_network_bandwidth_for_server, 0) \
|
||||
/* ---- */ \
|
||||
MAKE_OBSOLETE(M, DefaultDatabaseEngine, default_database_engine, DefaultDatabaseEngine::Atomic) \
|
||||
MAKE_OBSOLETE(M, UInt64, max_pipeline_depth, 0) \
|
||||
MAKE_OBSOLETE(M, UInt64, max_pipeline_depth, 0) \
|
||||
MAKE_OBSOLETE(M, Seconds, temporary_live_view_timeout, 1) \
|
||||
MAKE_OBSOLETE(M, Milliseconds, async_insert_cleanup_timeout_ms, 1000) \
|
||||
MAKE_OBSOLETE(M, Bool, optimize_fuse_sum_count_avg, 0) \
|
||||
|
@ -80,7 +80,8 @@ namespace SettingsChangesHistory
|
||||
/// It's used to implement `compatibility` setting (see https://github.com/ClickHouse/ClickHouse/issues/35972)
|
||||
static std::map<ClickHouseVersion, SettingsChangesHistory::SettingsChanges> settings_changes_history =
|
||||
{
|
||||
{"23.9", {{"optimize_group_by_constant_keys", false, true, "Optimize group by constant keys by default"}}},
|
||||
{"23.9", {{"optimize_group_by_constant_keys", false, true, "Optimize group by constant keys by default"},
|
||||
{"http_write_exception_in_output_format", false, true, "Output valid JSON/XML on exception in HTTP streaming."}}},
|
||||
{"23.8", {{"rewrite_count_distinct_if_with_count_distinct_implementation", false, true, "Rewrite countDistinctIf with count_distinct_implementation configuration"}}},
|
||||
{"23.7", {{"function_sleep_max_microseconds_per_block", 0, 3000000, "In previous versions, the maximum sleep time of 3 seconds was applied only for `sleep`, but not for `sleepEachRow` function. In the new version, we introduce this setting. If you set compatibility with the previous versions, we will disable the limit altogether."}}},
|
||||
{"23.6", {{"http_send_timeout", 180, 30, "3 minutes seems crazy long. Note that this is timeout for a single network write call, not for the whole upload operation."},
|
||||
|
@ -164,7 +164,7 @@ NameToDataType getSubcolumnsOfNested(const NamesAndTypesList & names_and_types)
|
||||
std::unordered_map<String, NamesAndTypesList> nested;
|
||||
for (const auto & name_type : names_and_types)
|
||||
{
|
||||
const DataTypeArray * type_arr = typeid_cast<const DataTypeArray *>(name_type.type.get());
|
||||
const auto * type_arr = typeid_cast<const DataTypeArray *>(name_type.type.get());
|
||||
|
||||
/// Ignore true Nested type, but try to unite flatten arrays to Nested type.
|
||||
if (!isNested(name_type.type) && type_arr)
|
||||
@ -191,8 +191,11 @@ NamesAndTypesList collect(const NamesAndTypesList & names_and_types)
|
||||
auto nested_types = getSubcolumnsOfNested(names_and_types);
|
||||
|
||||
for (const auto & name_type : names_and_types)
|
||||
if (!isArray(name_type.type) || !nested_types.contains(splitName(name_type.name).first))
|
||||
{
|
||||
auto split = splitName(name_type.name);
|
||||
if (!isArray(name_type.type) || split.second.empty() || !nested_types.contains(split.first))
|
||||
res.push_back(name_type);
|
||||
}
|
||||
|
||||
for (const auto & name_type : nested_types)
|
||||
res.emplace_back(name_type.first, name_type.second);
|
||||
|
@ -370,6 +370,7 @@ public:
|
||||
|
||||
static String getFileNameForStream(const NameAndTypePair & column, const SubstreamPath & path);
|
||||
static String getFileNameForStream(const String & name_in_storage, const SubstreamPath & path);
|
||||
|
||||
static String getSubcolumnNameForStream(const SubstreamPath & path);
|
||||
static String getSubcolumnNameForStream(const SubstreamPath & path, size_t prefix_len);
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <Formats/FormatFactory.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <Core/Settings.h>
|
||||
#include <Formats/FormatSettings.h>
|
||||
#include <Interpreters/Context.h>
|
||||
#include <Interpreters/ProcessList.h>
|
||||
@ -230,6 +229,12 @@ FormatSettings getFormatSettings(ContextPtr context, const Settings & settings)
|
||||
context->getRemoteHostFilter().checkURL(avro_schema_registry_url);
|
||||
}
|
||||
|
||||
if (context->getClientInfo().interface == ClientInfo::Interface::HTTP && context->getSettingsRef().http_write_exception_in_output_format.value)
|
||||
{
|
||||
format_settings.json.valid_output_on_exception = true;
|
||||
format_settings.xml.valid_output_on_exception = true;
|
||||
}
|
||||
|
||||
return format_settings;
|
||||
}
|
||||
|
||||
|
@ -198,6 +198,7 @@ struct FormatSettings
|
||||
bool validate_types_from_metadata = true;
|
||||
bool validate_utf8 = false;
|
||||
bool allow_object_type = false;
|
||||
bool valid_output_on_exception = false;
|
||||
bool compact_allow_variable_number_of_columns = false;
|
||||
} json;
|
||||
|
||||
@ -414,6 +415,11 @@ struct FormatSettings
|
||||
bool allow_types_conversion = true;
|
||||
} native;
|
||||
|
||||
struct
|
||||
{
|
||||
bool valid_output_on_exception = false;
|
||||
} xml;
|
||||
|
||||
struct
|
||||
{
|
||||
bool escape_special_characters = false;
|
||||
|
@ -531,6 +531,12 @@ namespace JSONUtils
|
||||
}
|
||||
}
|
||||
|
||||
void writeException(const String & exception_message, WriteBuffer & out, const FormatSettings & settings, size_t indent)
|
||||
{
|
||||
writeTitle("exception", out, indent, " ");
|
||||
writeJSONString(exception_message, out, settings);
|
||||
}
|
||||
|
||||
Strings makeNamesValidJSONStrings(const Strings & names, const FormatSettings & settings, bool validate_utf8)
|
||||
{
|
||||
Strings result;
|
||||
|
@ -108,6 +108,8 @@ namespace JSONUtils
|
||||
bool write_statistics,
|
||||
WriteBuffer & out);
|
||||
|
||||
void writeException(const String & exception_message, WriteBuffer & out, const FormatSettings & settings, size_t indent = 0);
|
||||
|
||||
void skipColon(ReadBuffer & in);
|
||||
void skipComma(ReadBuffer & in);
|
||||
|
||||
|
@ -1096,22 +1096,25 @@ public:
|
||||
return res != nullptr;
|
||||
};
|
||||
|
||||
TypeIndex left_id = arg_then.type->getTypeId();
|
||||
TypeIndex right_id = arg_else.type->getTypeId();
|
||||
DataTypePtr left_type = arg_then.type;
|
||||
DataTypePtr right_type = arg_else.type;
|
||||
|
||||
if (const auto * left_array = checkAndGetDataType<DataTypeArray>(arg_then.type.get()))
|
||||
left_id = left_array->getNestedType()->getTypeId();
|
||||
left_type = left_array->getNestedType();
|
||||
|
||||
if (const auto * right_array = checkAndGetDataType<DataTypeArray>(arg_else.type.get()))
|
||||
right_id = right_array->getNestedType()->getTypeId();
|
||||
right_type = right_array->getNestedType();
|
||||
|
||||
/// Special case when one column is Integer and another is UInt64 that can be actually Int64.
|
||||
/// The result type for this case is Int64 and we need to change UInt64 type to Int64
|
||||
/// so the NumberTraits::ResultOfIf will return Int64 instead if Int128.
|
||||
if (isNativeInteger(arg_then.type) && isUInt64ThatCanBeInt64(arg_else.type))
|
||||
right_id = TypeIndex::Int64;
|
||||
else if (isNativeInteger(arg_else.type) && isUInt64ThatCanBeInt64(arg_then.type))
|
||||
left_id = TypeIndex::Int64;
|
||||
if (isNativeInteger(left_type) && isUInt64ThatCanBeInt64(right_type))
|
||||
right_type = std::make_shared<DataTypeInt64>();
|
||||
else if (isNativeInteger(right_type) && isUInt64ThatCanBeInt64(left_type))
|
||||
left_type = std::make_shared<DataTypeInt64>();
|
||||
|
||||
TypeIndex left_id = left_type->getTypeId();
|
||||
TypeIndex right_id = right_type->getTypeId();
|
||||
|
||||
if (!(callOnBasicTypes<true, true, true, false>(left_id, right_id, call)
|
||||
|| (res = executeTyped<UUID, UUID>(cond_col, arguments, result_type, input_rows_count))
|
||||
|
85
src/IO/PeekableWriteBuffer.cpp
Normal file
85
src/IO/PeekableWriteBuffer.cpp
Normal file
@ -0,0 +1,85 @@
|
||||
#include <IO/PeekableWriteBuffer.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
PeekableWriteBuffer::PeekableWriteBuffer(DB::WriteBuffer & sub_buf_) : BufferWithOwnMemory(0), sub_buf(sub_buf_)
|
||||
{
|
||||
Buffer & sub_working = sub_buf.buffer();
|
||||
BufferBase::set(sub_working.begin() + sub_buf.offset(), sub_working.size() - sub_buf.offset(), 0);
|
||||
}
|
||||
|
||||
void PeekableWriteBuffer::nextImpl()
|
||||
{
|
||||
if (checkpoint)
|
||||
{
|
||||
if (write_to_own_memory)
|
||||
{
|
||||
size_t prev_size = position() - memory.data();
|
||||
size_t new_size = memory.size() * 2;
|
||||
memory.resize(new_size);
|
||||
BufferBase::set(memory.data(), memory.size(), prev_size);
|
||||
return;
|
||||
}
|
||||
|
||||
if (memory.size() == 0)
|
||||
memory.resize(DBMS_DEFAULT_BUFFER_SIZE);
|
||||
|
||||
sub_buf.position() = position();
|
||||
BufferBase::set(memory.data(), memory.size(), 0);
|
||||
write_to_own_memory = true;
|
||||
return;
|
||||
}
|
||||
|
||||
sub_buf.position() = position();
|
||||
sub_buf.next();
|
||||
BufferBase::set(sub_buf.buffer().begin(), sub_buf.buffer().size(), sub_buf.offset());
|
||||
}
|
||||
|
||||
|
||||
void PeekableWriteBuffer::dropCheckpoint()
|
||||
{
|
||||
assert(checkpoint);
|
||||
checkpoint = std::nullopt;
|
||||
/// If we have saved data in own memory, write it to sub-buf.
|
||||
if (write_to_own_memory)
|
||||
{
|
||||
try
|
||||
{
|
||||
sub_buf.next();
|
||||
sub_buf.write(memory.data(), position() - memory.data());
|
||||
Buffer & sub_working = sub_buf.buffer();
|
||||
BufferBase::set(sub_working.begin(), sub_working.size(), sub_buf.offset());
|
||||
write_to_own_memory = false;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
/// If exception happened during writing to sub buffer, we should
|
||||
/// update buffer to not leave it in invalid state.
|
||||
Buffer & sub_working = sub_buf.buffer();
|
||||
BufferBase::set(sub_working.begin(), sub_working.size(), sub_buf.offset());
|
||||
write_to_own_memory = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void PeekableWriteBuffer::rollbackToCheckpoint(bool drop)
|
||||
{
|
||||
assert(checkpoint);
|
||||
|
||||
/// Just ignore all data written after checkpoint.
|
||||
if (write_to_own_memory)
|
||||
{
|
||||
Buffer & sub_working = sub_buf.buffer();
|
||||
BufferBase::set(sub_working.begin(), sub_working.size(), sub_buf.offset());
|
||||
write_to_own_memory = false;
|
||||
}
|
||||
|
||||
position() = *checkpoint;
|
||||
|
||||
if (drop)
|
||||
checkpoint = std::nullopt;
|
||||
}
|
||||
|
||||
}
|
59
src/IO/PeekableWriteBuffer.h
Normal file
59
src/IO/PeekableWriteBuffer.h
Normal file
@ -0,0 +1,59 @@
|
||||
#pragma once
|
||||
#include <IO/WriteBuffer.h>
|
||||
#include <IO/BufferWithOwnMemory.h>
|
||||
#include <stack>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int LOGICAL_ERROR;
|
||||
}
|
||||
|
||||
/// Similar to PeekableReadBuffer.
|
||||
/// Allows to set checkpoint at some position in stream and come back to this position later.
|
||||
/// When next() is called, saves data between checkpoint and current position to own memory instead of writing it to sub-buffer.
|
||||
/// So, all the data after checkpoint won't be written in sub-buffer until checkpoint is dropped.
|
||||
/// Rollback to checkpoint means that all data after checkpoint will be ignored and not sent to sub-buffer.
|
||||
/// Sub-buffer should not be accessed directly during the lifetime of peekable buffer (unless
|
||||
/// you reset() the state of peekable buffer after each change of underlying buffer)
|
||||
/// If position() of peekable buffer is explicitly set to some position before checkpoint
|
||||
/// (e.g. by istr.position() = prev_pos), behavior is undefined.
|
||||
class PeekableWriteBuffer : public BufferWithOwnMemory<WriteBuffer>
|
||||
{
|
||||
friend class PeekableWriteBufferCheckpoint;
|
||||
public:
|
||||
explicit PeekableWriteBuffer(WriteBuffer & sub_buf_);
|
||||
|
||||
/// Sets checkpoint at current position
|
||||
ALWAYS_INLINE inline void setCheckpoint()
|
||||
{
|
||||
if (checkpoint)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "PeekableWriteBuffer does not support recursive checkpoints.");
|
||||
|
||||
checkpoint.emplace(pos);
|
||||
}
|
||||
|
||||
/// Forget checkpoint and send all data from checkpoint to position to sub-buffer.
|
||||
void dropCheckpoint();
|
||||
|
||||
/// Sets position at checkpoint and forget all data written from checkpoint to position.
|
||||
/// All pointers (such as this->buffer().end()) may be invalidated
|
||||
void rollbackToCheckpoint(bool drop = false);
|
||||
|
||||
void finalizeImpl() override
|
||||
{
|
||||
assert(!checkpoint);
|
||||
sub_buf.position() = position();
|
||||
}
|
||||
|
||||
private:
|
||||
void nextImpl() override;
|
||||
|
||||
WriteBuffer & sub_buf;
|
||||
bool write_to_own_memory = false;
|
||||
std::optional<Position> checkpoint = std::nullopt;
|
||||
};
|
||||
|
||||
}
|
@ -27,6 +27,8 @@
|
||||
#include <Common/logger_useful.h>
|
||||
#include <Common/ProxyConfigurationResolverProvider.h>
|
||||
|
||||
#include <base/sleep.h>
|
||||
|
||||
|
||||
namespace ProfileEvents
|
||||
{
|
||||
@ -599,7 +601,9 @@ Client::doRequestWithRetryNetworkErrors(const RequestType & request, RequestFn r
|
||||
last_exception = std::current_exception();
|
||||
|
||||
auto error = Aws::Client::AWSError<Aws::Client::CoreErrors>(Aws::Client::CoreErrors::NETWORK_CONNECTION, /*retry*/ true);
|
||||
client_configuration.retryStrategy->CalculateDelayBeforeNextRetry(error, attempt_no);
|
||||
auto sleep_ms = client_configuration.retryStrategy->CalculateDelayBeforeNextRetry(error, attempt_no);
|
||||
LOG_WARNING(log, "Request failed, now waiting {} ms before attempting again", sleep_ms);
|
||||
sleepForMilliseconds(sleep_ms);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -461,7 +461,7 @@ SSOCredentialsProvider::SSOCredentialsProvider(DB::S3::PocoHTTPClientConfigurati
|
||||
, expiration_window_seconds(expiration_window_seconds_)
|
||||
, logger(&Poco::Logger::get(SSO_CREDENTIALS_PROVIDER_LOG_TAG))
|
||||
{
|
||||
LOG_INFO(logger, "Setting sso credentials provider to read config from {}", profile_to_use);
|
||||
LOG_TRACE(logger, "Setting sso credentials provider to read config from {}", profile_to_use);
|
||||
}
|
||||
|
||||
Aws::Auth::AWSCredentials SSOCredentialsProvider::GetAWSCredentials()
|
||||
@ -491,16 +491,14 @@ void SSOCredentialsProvider::Reload()
|
||||
ss_token << profile_directory;
|
||||
ss_token << Aws::FileSystem::PATH_DELIM << "sso" << Aws::FileSystem::PATH_DELIM << "cache" << Aws::FileSystem::PATH_DELIM << hashed_start_url << ".json";
|
||||
auto sso_token_path = ss_token.str();
|
||||
LOG_INFO(logger, "Loading token from: {}", sso_token_path);
|
||||
LOG_TEST(logger, "Loading token from: {}", sso_token_path);
|
||||
sso_region = profile.GetSsoRegion();
|
||||
return loadAccessTokenFile(sso_token_path);
|
||||
}();
|
||||
|
||||
if (access_token.empty())
|
||||
{
|
||||
LOG_TRACE(logger, "Access token for SSO not available");
|
||||
return;
|
||||
}
|
||||
|
||||
if (expires_at < Aws::Utils::DateTime::Now())
|
||||
{
|
||||
LOG_TRACE(logger, "Cached Token expired at {}", expires_at.ToGmtString(Aws::Utils::DateFormat::ISO_8601));
|
||||
@ -514,7 +512,7 @@ void SSOCredentialsProvider::Reload()
|
||||
|
||||
aws_client_configuration.scheme = Aws::Http::Scheme::HTTPS;
|
||||
aws_client_configuration.region = sso_region;
|
||||
LOG_TRACE(logger, "Passing config to client for region: {}", sso_region);
|
||||
LOG_TEST(logger, "Passing config to client for region: {}", sso_region);
|
||||
|
||||
Aws::Vector<Aws::String> retryable_errors;
|
||||
retryable_errors.push_back("TooManyRequestsException");
|
||||
@ -545,13 +543,13 @@ void SSOCredentialsProvider::refreshIfExpired()
|
||||
|
||||
Aws::String SSOCredentialsProvider::loadAccessTokenFile(const Aws::String & sso_access_token_path)
|
||||
{
|
||||
LOG_TRACE(logger, "Preparing to load token from: {}", sso_access_token_path);
|
||||
LOG_TEST(logger, "Preparing to load token from: {}", sso_access_token_path);
|
||||
|
||||
Aws::IFStream input_file(sso_access_token_path.c_str());
|
||||
|
||||
if (input_file)
|
||||
{
|
||||
LOG_TRACE(logger, "Reading content from token file: {}", sso_access_token_path);
|
||||
LOG_TEST(logger, "Reading content from token file: {}", sso_access_token_path);
|
||||
|
||||
Aws::Utils::Json::JsonValue token_doc(input_file);
|
||||
if (!token_doc.WasParseSuccessful())
|
||||
@ -565,11 +563,10 @@ Aws::String SSOCredentialsProvider::loadAccessTokenFile(const Aws::String & sso_
|
||||
expiration_str = token_view.GetString("expiresAt");
|
||||
Aws::Utils::DateTime expiration(expiration_str, Aws::Utils::DateFormat::ISO_8601);
|
||||
|
||||
LOG_TRACE(logger, "Token cache file contains accessToken [{}], expiration [{}]", tmp_access_token, expiration_str);
|
||||
LOG_TEST(logger, "Token cache file contains accessToken [{}], expiration [{}]", tmp_access_token, expiration_str);
|
||||
|
||||
if (tmp_access_token.empty() || !expiration.WasParseSuccessful())
|
||||
{
|
||||
LOG_TRACE(logger, R"(The SSO session associated with this profile has expired or is otherwise invalid. To refresh this SSO session run aws sso login with the corresponding profile.)");
|
||||
LOG_TRACE(
|
||||
logger,
|
||||
"Token cache file failed because {}{}",
|
||||
|
@ -1059,6 +1059,9 @@ void FileCache::loadMetadataForKeys(const fs::path & keys_dir)
|
||||
FileCache::~FileCache()
|
||||
{
|
||||
deactivateBackgroundOperations();
|
||||
#ifdef ABORT_ON_LOGICAL_ERROR
|
||||
assertCacheCorrectness();
|
||||
#endif
|
||||
}
|
||||
|
||||
void FileCache::deactivateBackgroundOperations()
|
||||
@ -1143,14 +1146,15 @@ size_t FileCache::getFileSegmentsNum() const
|
||||
|
||||
void FileCache::assertCacheCorrectness()
|
||||
{
|
||||
auto lock = lockCache();
|
||||
main_priority->iterate([&](LockedKey &, const FileSegmentMetadataPtr & segment_metadata)
|
||||
metadata.iterate([&](LockedKey & locked_key)
|
||||
{
|
||||
const auto & file_segment = *segment_metadata->file_segment;
|
||||
UNUSED(file_segment);
|
||||
chassert(file_segment.assertCorrectness());
|
||||
return PriorityIterationResult::CONTINUE;
|
||||
}, lock);
|
||||
for (const auto & [_, file_segment_metadata] : locked_key)
|
||||
{
|
||||
const auto & file_segment = *file_segment_metadata->file_segment;
|
||||
UNUSED(file_segment);
|
||||
chassert(file_segment.assertCorrectness());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
FileCache::QueryContextHolder::QueryContextHolder(
|
||||
|
@ -362,12 +362,6 @@ public:
|
||||
return;
|
||||
inserted = keys.insert(key).second;
|
||||
}
|
||||
/// There is an invariant that key cannot be submitted for removal if it is already in removal queue.
|
||||
/// Because
|
||||
/// 1) when submit key to removal it acquires state REMOVING and we submit key for removal only if it has ACTIVE state.
|
||||
/// 2) if a key is added to cache and it was found in removal queue - it will be removed from the queue and get state ACTIVE.
|
||||
/// and both these actions are synchronized by the same KeyGuard.
|
||||
chassert(inserted);
|
||||
if (inserted)
|
||||
{
|
||||
CurrentMetrics::add(CurrentMetrics::FilesystemCacheDelayedCleanupElements);
|
||||
|
@ -108,6 +108,7 @@ namespace fs = std::filesystem;
|
||||
namespace ProfileEvents
|
||||
{
|
||||
extern const Event ContextLock;
|
||||
extern const Event ContextLockWaitMicroseconds;
|
||||
}
|
||||
|
||||
namespace CurrentMetrics
|
||||
@ -704,7 +705,10 @@ std::unique_lock<std::recursive_mutex> Context::getLock() const
|
||||
{
|
||||
ProfileEvents::increment(ProfileEvents::ContextLock);
|
||||
CurrentMetrics::Increment increment{CurrentMetrics::ContextLockWait};
|
||||
return std::unique_lock(shared->mutex);
|
||||
Stopwatch watch;
|
||||
auto lock = std::unique_lock(shared->mutex);
|
||||
ProfileEvents::increment(ProfileEvents::ContextLockWaitMicroseconds, watch.elapsedMicroseconds());
|
||||
return lock;
|
||||
}
|
||||
|
||||
ProcessList & Context::getProcessList() { return shared->process_list; }
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "ExternalLoader.h"
|
||||
|
||||
#include <mutex>
|
||||
#include <pcg_random.hpp>
|
||||
#include <Common/MemoryTrackerBlockerInThread.h>
|
||||
#include <Common/Config/AbstractConfigurationComparison.h>
|
||||
#include <Common/Exception.h>
|
||||
@ -9,7 +8,6 @@
|
||||
#include <Common/ThreadPool.h>
|
||||
#include <Common/randomSeed.h>
|
||||
#include <Common/setThreadName.h>
|
||||
#include <Common/StatusInfo.h>
|
||||
#include <Common/scope_guard_safe.h>
|
||||
#include <Common/logger_useful.h>
|
||||
#include <base/chrono_io.h>
|
||||
@ -18,12 +16,6 @@
|
||||
#include <unordered_set>
|
||||
|
||||
|
||||
namespace CurrentStatusInfo
|
||||
{
|
||||
extern const Status DictionaryStatus;
|
||||
}
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
namespace ErrorCodes
|
||||
@ -1145,7 +1137,6 @@ private:
|
||||
if (info && (info->loading_id == loading_id))
|
||||
{
|
||||
info->loading_id = info->state_id;
|
||||
CurrentStatusInfo::set(CurrentStatusInfo::DictionaryStatus, name, static_cast<Int8>(info->status()));
|
||||
}
|
||||
min_id_to_finish_loading_dependencies.erase(std::this_thread::get_id());
|
||||
|
||||
@ -1307,7 +1298,6 @@ scope_guard ExternalLoader::addConfigRepository(std::unique_ptr<IExternalLoaderC
|
||||
return [this, ptr, name]()
|
||||
{
|
||||
config_files_reader->removeConfigRepository(ptr);
|
||||
CurrentStatusInfo::unset(CurrentStatusInfo::DictionaryStatus, name);
|
||||
reloadConfig(name);
|
||||
};
|
||||
}
|
||||
|
@ -86,11 +86,12 @@ NamesAndTypesList SessionLogElement::getNamesAndTypes()
|
||||
AUTH_TYPE_NAME_AND_VALUE(AuthType::DOUBLE_SHA1_PASSWORD),
|
||||
AUTH_TYPE_NAME_AND_VALUE(AuthType::LDAP),
|
||||
AUTH_TYPE_NAME_AND_VALUE(AuthType::KERBEROS),
|
||||
AUTH_TYPE_NAME_AND_VALUE(AuthType::SSH_KEY),
|
||||
AUTH_TYPE_NAME_AND_VALUE(AuthType::SSL_CERTIFICATE),
|
||||
AUTH_TYPE_NAME_AND_VALUE(AuthType::BCRYPT_PASSWORD),
|
||||
});
|
||||
#undef AUTH_TYPE_NAME_AND_VALUE
|
||||
static_assert(static_cast<int>(AuthenticationType::MAX) == 8);
|
||||
static_assert(static_cast<int>(AuthenticationType::MAX) == 9);
|
||||
|
||||
auto interface_type_column = std::make_shared<DataTypeEnum8>(
|
||||
DataTypeEnum8::Values
|
||||
|
@ -89,6 +89,7 @@ NamesAndTypesList ZooKeeperLogElement::getNamesAndTypes()
|
||||
{"SessionID", static_cast<Int16>(Coordination::OpNum::SessionID)},
|
||||
{"FilteredList", static_cast<Int16>(Coordination::OpNum::FilteredList)},
|
||||
{"CheckNotExists", static_cast<Int16>(Coordination::OpNum::CheckNotExists)},
|
||||
{"CreateIfNotExists", static_cast<Int16>(Coordination::OpNum::CreateIfNotExists)},
|
||||
});
|
||||
|
||||
auto error_enum = getCoordinationErrorCodesEnumType();
|
||||
|
@ -1266,7 +1266,8 @@ void executeQuery(
|
||||
bool allow_into_outfile,
|
||||
ContextMutablePtr context,
|
||||
SetResultDetailsFunc set_result_details,
|
||||
const std::optional<FormatSettings> & output_format_settings)
|
||||
const std::optional<FormatSettings> & output_format_settings,
|
||||
HandleExceptionInOutputFormatFunc handle_exception_in_output_format)
|
||||
{
|
||||
PODArray<char> parse_buf;
|
||||
const char * begin;
|
||||
@ -1324,6 +1325,7 @@ void executeQuery(
|
||||
|
||||
ASTPtr ast;
|
||||
BlockIO streams;
|
||||
OutputFormatPtr output_format;
|
||||
|
||||
std::tie(ast, streams) = executeQueryImpl(begin, end, context, false, QueryProcessingStage::Complete, &istr);
|
||||
auto & pipeline = streams.pipeline;
|
||||
@ -1366,30 +1368,30 @@ void executeQuery(
|
||||
? getIdentifierName(ast_query_with_output->format)
|
||||
: context->getDefaultFormat();
|
||||
|
||||
auto out = FormatFactory::instance().getOutputFormatParallelIfPossible(
|
||||
output_format = FormatFactory::instance().getOutputFormatParallelIfPossible(
|
||||
format_name,
|
||||
compressed_buffer ? *compressed_buffer : *out_buf,
|
||||
materializeBlock(pipeline.getHeader()),
|
||||
context,
|
||||
output_format_settings);
|
||||
|
||||
out->setAutoFlush();
|
||||
output_format->setAutoFlush();
|
||||
|
||||
/// Save previous progress callback if any. TODO Do it more conveniently.
|
||||
auto previous_progress_callback = context->getProgressCallback();
|
||||
|
||||
/// NOTE Progress callback takes shared ownership of 'out'.
|
||||
pipeline.setProgressCallback([out, previous_progress_callback] (const Progress & progress)
|
||||
pipeline.setProgressCallback([output_format, previous_progress_callback] (const Progress & progress)
|
||||
{
|
||||
if (previous_progress_callback)
|
||||
previous_progress_callback(progress);
|
||||
out->onProgress(progress);
|
||||
output_format->onProgress(progress);
|
||||
});
|
||||
|
||||
result_details.content_type = out->getContentType();
|
||||
result_details.content_type = output_format->getContentType();
|
||||
result_details.format = format_name;
|
||||
|
||||
pipeline.complete(std::move(out));
|
||||
pipeline.complete(output_format);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1419,6 +1421,8 @@ void executeQuery(
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
if (handle_exception_in_output_format && output_format)
|
||||
handle_exception_in_output_format(*output_format);
|
||||
streams.onException();
|
||||
throw;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ namespace DB
|
||||
class IInterpreter;
|
||||
class ReadBuffer;
|
||||
class WriteBuffer;
|
||||
class IOutputFormat;
|
||||
struct QueryStatusInfo;
|
||||
|
||||
struct QueryResultDetails
|
||||
@ -26,6 +27,7 @@ struct QueryResultDetails
|
||||
};
|
||||
|
||||
using SetResultDetailsFunc = std::function<void(const QueryResultDetails &)>;
|
||||
using HandleExceptionInOutputFormatFunc = std::function<void(IOutputFormat & output_format)>;
|
||||
|
||||
/// Parse and execute a query.
|
||||
void executeQuery(
|
||||
@ -34,7 +36,8 @@ void executeQuery(
|
||||
bool allow_into_outfile, /// If true and the query contains INTO OUTFILE section, redirect output to that file.
|
||||
ContextMutablePtr context, /// DB, tables, data types, storage engines, functions, aggregate functions...
|
||||
SetResultDetailsFunc set_result_details, /// If a non-empty callback is passed, it will be called with the query id, the content-type, the format, and the timezone.
|
||||
const std::optional<FormatSettings> & output_format_settings = std::nullopt /// Format settings for output format, will be calculated from the context if not set.
|
||||
const std::optional<FormatSettings> & output_format_settings = std::nullopt, /// Format settings for output format, will be calculated from the context if not set.
|
||||
HandleExceptionInOutputFormatFunc handle_exception_in_output_format = {} /// If a non-empty callback is passed, it will be called on exception with created output format.
|
||||
);
|
||||
|
||||
|
||||
|
@ -26,6 +26,7 @@ std::optional<String> ASTAuthenticationData::getPassword() const
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
std::optional<String> ASTAuthenticationData::getSalt() const
|
||||
{
|
||||
if (type && *type == AuthenticationType::SHA256_PASSWORD && children.size() == 2)
|
||||
@ -117,6 +118,12 @@ void ASTAuthenticationData::formatImpl(const FormatSettings & settings, FormatSt
|
||||
password = true;
|
||||
break;
|
||||
}
|
||||
case AuthenticationType::SSH_KEY:
|
||||
{
|
||||
prefix = "BY";
|
||||
parameters = true;
|
||||
break;
|
||||
}
|
||||
case AuthenticationType::NO_PASSWORD: [[fallthrough]];
|
||||
case AuthenticationType::MAX:
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "AST: Unexpected authentication type {}", toString(*type));
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user