Merge pull request #49678 from azat/build/llvm-16

Switch to LLVM/clang 16 (16.0.3)
This commit is contained in:
Robert Schulze 2023-05-12 13:47:36 +02:00 committed by GitHub
commit b9c185af44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 129 additions and 140 deletions

View File

@ -111,6 +111,7 @@ Checks: '*,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-confusable-identifiers, # useful but slooow
-misc-use-anonymous-namespace,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,

View File

@ -125,8 +125,8 @@ jobs:
SONAR_SCANNER_VERSION: 4.8.0.2856
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
CC: clang-15
CXX: clang++-15
CC: clang-16
CXX: clang++-16
steps:
- name: Check out repository code
uses: ClickHouse/checkout@v1

5
.gitmodules vendored
View File

@ -267,7 +267,10 @@
url = https://github.com/ClickHouse/nats.c
[submodule "contrib/vectorscan"]
path = contrib/vectorscan
url = https://github.com/VectorCamp/vectorscan
# FIXME: update once upstream fixes will be merged:
# - https://github.com/VectorCamp/vectorscan/pull/148
# - https://github.com/VectorCamp/vectorscan/pull/149
url = https://github.com/azat-ch/vectorscan
[submodule "contrib/c-ares"]
path = contrib/c-ares
url = https://github.com/ClickHouse/c-ares

View File

@ -342,13 +342,6 @@ if (COMPILER_CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstrict-vtable-pointers")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
# Set new experimental pass manager, it's a performance, build time and binary size win.
# Can be removed after https://reviews.llvm.org/D66490 merged and released to at least two versions of clang.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexperimental-new-pass-manager")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexperimental-new-pass-manager")
endif ()
# We cannot afford to use LTO when compiling unit tests, and it's not enough
# to only supply -fno-lto at the final linking stage. So we disable it
# completely.

View File

@ -10,9 +10,16 @@ set (SAN_FLAGS "${SAN_FLAGS} -g -fno-omit-frame-pointer -DSANITIZER")
if (SANITIZE)
if (SANITIZE STREQUAL "address")
# LLVM-15 has a bug in Address Sanitizer, preventing the usage of 'sanitize-address-use-after-scope',
# see https://github.com/llvm/llvm-project/issues/58633
set (ASAN_FLAGS "-fsanitize=address -fno-sanitize-address-use-after-scope")
set (ASAN_FLAGS "-fsanitize=address -fsanitize-address-use-after-scope")
if (COMPILER_CLANG)
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL 15 AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 16)
# LLVM-15 has a bug in Address Sanitizer, preventing the usage
# of 'sanitize-address-use-after-scope', see [1].
#
# [1]: https://github.com/llvm/llvm-project/issues/58633
set (ASAN_FLAGS "${ASAN_FLAGS} -fno-sanitize-address-use-after-scope")
endif()
endif()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} ${ASAN_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} ${ASAN_FLAGS}")

View File

@ -70,13 +70,15 @@ if (LINKER_NAME)
if (NOT LLD_PATH)
message (FATAL_ERROR "Using linker ${LINKER_NAME} but can't find its path.")
endif ()
if (COMPILER_CLANG)
# This a temporary quirk to emit .debug_aranges with ThinLTO, can be removed after upgrade to clang-16
# This a temporary quirk to emit .debug_aranges with ThinLTO, it is only the case clang/llvm <16
if (COMPILER_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
set (LLD_WRAPPER "${CMAKE_CURRENT_BINARY_DIR}/ld.lld")
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/cmake/ld.lld.in" "${LLD_WRAPPER}" @ONLY)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --ld-path=${LLD_WRAPPER}")
endif ()
else ()
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --ld-path=${LLD_PATH}")
endif()
endif ()

2
contrib/vectorscan vendored

@ -1 +1 @@
Subproject commit b4bba94b1a250603b0b198e0394946e32f6c3f30
Subproject commit aaca65aa210ce3ec91bd2b249c4d59e55e80a869

View File

@ -362,17 +362,16 @@ def parse_args() -> argparse.Namespace:
parser.add_argument(
"--compiler",
choices=(
"clang-15",
"clang-15-darwin",
"clang-15-darwin-aarch64",
"clang-15-aarch64",
"clang-15-aarch64-v80compat",
"clang-15-ppc64le",
"clang-15-amd64-compat",
"clang-15-freebsd",
"gcc-11",
"clang-16",
"clang-16-darwin",
"clang-16-darwin-aarch64",
"clang-16-aarch64",
"clang-16-aarch64-v80compat",
"clang-16-ppc64le",
"clang-16-amd64-compat",
"clang-16-freebsd",
),
default="clang-15",
default="clang-16",
help="a compiler to use",
)
parser.add_argument(

View File

@ -10,35 +10,20 @@ RUN sed -i "s|http://archive.ubuntu.com|$apt_archive|g" /etc/apt/sources.list
RUN apt-get update && apt-get --yes --allow-unauthenticated install libclang-${LLVM_VERSION}-dev libmlir-${LLVM_VERSION}-dev
# libclang-15-dev does not contain proper symlink:
#
# This is what cmake will search for:
#
# # readlink -f /usr/lib/llvm-15/lib/libclang-15.so.1
# /usr/lib/x86_64-linux-gnu/libclang-15.so.1
#
# This is what exists:
#
# # ls -l /usr/lib/x86_64-linux-gnu/libclang-15*
# lrwxrwxrwx 1 root root 16 Sep 5 13:31 /usr/lib/x86_64-linux-gnu/libclang-15.so -> libclang-15.so.1
# lrwxrwxrwx 1 root root 21 Sep 5 13:31 /usr/lib/x86_64-linux-gnu/libclang-15.so.15 -> libclang-15.so.15.0.0
# -rw-r--r-- 1 root root 31835760 Sep 5 13:31 /usr/lib/x86_64-linux-gnu/libclang-15.so.15.0.0
#
ARG TARGETARCH
RUN arch=${TARGETARCH:-amd64} \
&& case $arch in \
amd64) rarch=x86_64 ;; \
arm64) rarch=aarch64 ;; \
*) exit 1 ;; \
esac \
&& ln -rsf /usr/lib/$rarch-linux-gnu/libclang-15.so.15 /usr/lib/$rarch-linux-gnu/libclang-15.so.1
esac
# repo versions doesn't work correctly with C++17
# also we push reports to s3, so we add index.html to subfolder urls
# https://github.com/ClickHouse-Extras/woboq_codebrowser/commit/37e15eaf377b920acb0b48dbe82471be9203f76b
RUN git clone --depth=1 https://github.com/ClickHouse/woboq_codebrowser /woboq_codebrowser \
&& cd /woboq_codebrowser \
&& cmake . -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang\+\+-${LLVM_VERSION} -DCMAKE_C_COMPILER=clang-${LLVM_VERSION} \
&& cmake . -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang\+\+-${LLVM_VERSION} -DCMAKE_C_COMPILER=clang-${LLVM_VERSION} -DCLANG_BUILTIN_HEADERS_DIR=/usr/lib/llvm-${LLVM_VERSION}/lib/clang/${LLVM_VERSION}/include \
&& ninja
ENV CODEGEN=/woboq_codebrowser/generator/codebrowser_generator

View File

@ -9,7 +9,7 @@ trap 'kill $(jobs -pr) ||:' EXIT
stage=${stage:-}
# Compiler version, normally set by Dockerfile
export LLVM_VERSION=${LLVM_VERSION:-13}
export LLVM_VERSION=${LLVM_VERSION:-16}
# A variable to pass additional flags to CMake.
# Here we explicitly default it to nothing so that bash doesn't complain about

View File

@ -15,7 +15,7 @@ stage=${stage:-}
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo "$script_dir"
repo_dir=ch
BINARY_TO_DOWNLOAD=${BINARY_TO_DOWNLOAD:="clang-15_debug_none_unsplitted_disable_False_binary"}
BINARY_TO_DOWNLOAD=${BINARY_TO_DOWNLOAD:="clang-16_debug_none_unsplitted_disable_False_binary"}
BINARY_URL_TO_DOWNLOAD=${BINARY_URL_TO_DOWNLOAD:="https://clickhouse-builds.s3.amazonaws.com/$PR_TO_TEST/$SHA_TO_TEST/clickhouse_build_check/$BINARY_TO_DOWNLOAD/clickhouse"}
function git_clone_with_retry

View File

@ -2,7 +2,7 @@
set -euo pipefail
CLICKHOUSE_PACKAGE=${CLICKHOUSE_PACKAGE:="https://clickhouse-builds.s3.amazonaws.com/$PR_TO_TEST/$SHA_TO_TEST/clickhouse_build_check/clang-15_relwithdebuginfo_none_unsplitted_disable_False_binary/clickhouse"}
CLICKHOUSE_PACKAGE=${CLICKHOUSE_PACKAGE:="https://clickhouse-builds.s3.amazonaws.com/$PR_TO_TEST/$SHA_TO_TEST/clickhouse_build_check/clang-16_relwithdebuginfo_none_unsplitted_disable_False_binary/clickhouse"}
CLICKHOUSE_REPO_PATH=${CLICKHOUSE_REPO_PATH:=""}

View File

@ -2,7 +2,7 @@
set -euo pipefail
CLICKHOUSE_PACKAGE=${CLICKHOUSE_PACKAGE:="https://clickhouse-builds.s3.amazonaws.com/$PR_TO_TEST/$SHA_TO_TEST/clickhouse_build_check/clang-15_relwithdebuginfo_none_unsplitted_disable_False_binary/clickhouse"}
CLICKHOUSE_PACKAGE=${CLICKHOUSE_PACKAGE:="https://clickhouse-builds.s3.amazonaws.com/$PR_TO_TEST/$SHA_TO_TEST/clickhouse_build_check/clang-16_relwithdebuginfo_none_unsplitted_disable_False_binary/clickhouse"}
CLICKHOUSE_REPO_PATH=${CLICKHOUSE_REPO_PATH:=""}

View File

@ -20,31 +20,27 @@ install_packages package_folder
# Thread Fuzzer allows to check more permutations of possible thread scheduling
# and find more potential issues.
# Temporarily disable ThreadFuzzer with tsan because of https://github.com/google/sanitizers/issues/1540
is_tsan_build=$(clickhouse local -q "select value like '% -fsanitize=thread %' from system.build_options where name='CXX_FLAGS'")
if [ "$is_tsan_build" -eq "0" ]; then
export THREAD_FUZZER_CPU_TIME_PERIOD_US=1000
export THREAD_FUZZER_SLEEP_PROBABILITY=0.1
export THREAD_FUZZER_SLEEP_TIME_US=100000
export THREAD_FUZZER_CPU_TIME_PERIOD_US=1000
export THREAD_FUZZER_SLEEP_PROBABILITY=0.1
export THREAD_FUZZER_SLEEP_TIME_US=100000
export THREAD_FUZZER_pthread_mutex_lock_BEFORE_MIGRATE_PROBABILITY=1
export THREAD_FUZZER_pthread_mutex_lock_AFTER_MIGRATE_PROBABILITY=1
export THREAD_FUZZER_pthread_mutex_unlock_BEFORE_MIGRATE_PROBABILITY=1
export THREAD_FUZZER_pthread_mutex_unlock_AFTER_MIGRATE_PROBABILITY=1
export THREAD_FUZZER_pthread_mutex_lock_BEFORE_MIGRATE_PROBABILITY=1
export THREAD_FUZZER_pthread_mutex_lock_AFTER_MIGRATE_PROBABILITY=1
export THREAD_FUZZER_pthread_mutex_unlock_BEFORE_MIGRATE_PROBABILITY=1
export THREAD_FUZZER_pthread_mutex_unlock_AFTER_MIGRATE_PROBABILITY=1
export THREAD_FUZZER_pthread_mutex_lock_BEFORE_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_lock_AFTER_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_unlock_BEFORE_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_unlock_AFTER_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_lock_BEFORE_SLEEP_TIME_US=10000
export THREAD_FUZZER_pthread_mutex_lock_BEFORE_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_lock_AFTER_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_unlock_BEFORE_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_unlock_AFTER_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_lock_BEFORE_SLEEP_TIME_US=10000
export THREAD_FUZZER_pthread_mutex_lock_AFTER_SLEEP_TIME_US=10000
export THREAD_FUZZER_pthread_mutex_unlock_BEFORE_SLEEP_TIME_US=10000
export THREAD_FUZZER_pthread_mutex_unlock_AFTER_SLEEP_TIME_US=10000
export THREAD_FUZZER_pthread_mutex_lock_AFTER_SLEEP_TIME_US=10000
export THREAD_FUZZER_pthread_mutex_unlock_BEFORE_SLEEP_TIME_US=10000
export THREAD_FUZZER_pthread_mutex_unlock_AFTER_SLEEP_TIME_US=10000
export THREAD_FUZZER_EXPLICIT_SLEEP_PROBABILITY=0.01
export THREAD_FUZZER_EXPLICIT_MEMORY_EXCEPTION_PROBABILITY=0.01
fi
export THREAD_FUZZER_EXPLICIT_SLEEP_PROBABILITY=0.01
export THREAD_FUZZER_EXPLICIT_MEMORY_EXCEPTION_PROBABILITY=0.01
export ZOOKEEPER_FAULT_INJECTION=1
# Initial run without S3 to create system.*_log on local file system to make it

View File

@ -6,7 +6,7 @@ ARG apt_archive="http://archive.ubuntu.com"
RUN sed -i "s|http://archive.ubuntu.com|$apt_archive|g" /etc/apt/sources.list
# 15.0.2
ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=15
ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=16
RUN apt-get update \
&& apt-get install \
@ -52,6 +52,7 @@ RUN apt-get update \
lld-${LLVM_VERSION} \
llvm-${LLVM_VERSION} \
llvm-${LLVM_VERSION}-dev \
libclang-${LLVM_VERSION}-dev \
moreutils \
nasm \
ninja-build \

View File

@ -11,14 +11,14 @@ This is intended for continuous integration checks that run on Linux servers. If
The cross-build for macOS is based on the [Build instructions](../development/build.md), follow them first.
## Install Clang-15
## Install Clang-16
Follow the instructions from https://apt.llvm.org/ for your Ubuntu or Debian setup.
For example the commands for Bionic are like:
``` bash
sudo echo "deb [trusted=yes] http://apt.llvm.org/bionic/ llvm-toolchain-bionic-15 main" >> /etc/apt/sources.list
sudo apt-get install clang-15
sudo echo "deb [trusted=yes] http://apt.llvm.org/bionic/ llvm-toolchain-bionic-16 main" >> /etc/apt/sources.list
sudo apt-get install clang-16
```
## Install Cross-Compilation Toolset {#install-cross-compilation-toolset}
@ -55,7 +55,7 @@ curl -L 'https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX1
cd ClickHouse
mkdir build-darwin
cd build-darwin
CC=clang-15 CXX=clang++-15 cmake -DCMAKE_AR:FILEPATH=${CCTOOLS}/bin/x86_64-apple-darwin-ar -DCMAKE_INSTALL_NAME_TOOL=${CCTOOLS}/bin/x86_64-apple-darwin-install_name_tool -DCMAKE_RANLIB:FILEPATH=${CCTOOLS}/bin/x86_64-apple-darwin-ranlib -DLINKER_NAME=${CCTOOLS}/bin/x86_64-apple-darwin-ld -DCMAKE_TOOLCHAIN_FILE=cmake/darwin/toolchain-x86_64.cmake ..
CC=clang-16 CXX=clang++-16 cmake -DCMAKE_AR:FILEPATH=${CCTOOLS}/bin/x86_64-apple-darwin-ar -DCMAKE_INSTALL_NAME_TOOL=${CCTOOLS}/bin/x86_64-apple-darwin-install_name_tool -DCMAKE_RANLIB:FILEPATH=${CCTOOLS}/bin/x86_64-apple-darwin-ranlib -DLINKER_NAME=${CCTOOLS}/bin/x86_64-apple-darwin-ld -DCMAKE_TOOLCHAIN_FILE=cmake/darwin/toolchain-x86_64.cmake ..
ninja
```

View File

@ -47,8 +47,8 @@ GCC as a compiler is not supported
To build with a specific Clang version:
``` bash
export CC=clang-15
export CXX=clang++-15
export CC=clang-16
export CXX=clang++-16
```
### Checkout ClickHouse Sources {#checkout-clickhouse-sources}

View File

@ -102,7 +102,7 @@ Builds ClickHouse in various configurations for use in further steps. You have t
### Report Details
- **Compiler**: `clang-15`, optionally with the name of a target platform
- **Compiler**: `clang-16`, optionally with the name of a target platform
- **Build type**: `Debug` or `RelWithDebInfo` (cmake).
- **Sanitizer**: `none` (without sanitizers), `address` (ASan), `memory` (MSan), `undefined` (UBSan), or `thread` (TSan).
- **Status**: `success` or `fail`

View File

@ -152,7 +152,7 @@ While inside the `build` directory, configure your build by running CMake. Befor
export CC=clang CXX=clang++
cmake ..
If you installed clang using the automatic installation script above, also specify the version of clang installed in the first command, e.g. `export CC=clang-15 CXX=clang++-15`. The clang version will be in the script output.
If you installed clang using the automatic installation script above, also specify the version of clang installed in the first command, e.g. `export CC=clang-16 CXX=clang++-16`. The clang version will be in the script output.
The `CC` variable specifies the compiler for C (short for C Compiler), and `CXX` variable instructs which C++ compiler is to be used for building.

View File

@ -42,7 +42,7 @@ namespace ErrorCodes
#define __NR_renameat2 316
#elif defined(__aarch64__)
#define __NR_renameat2 276
#elif defined(__ppc64__)
#elif defined(__powerpc64__)
#define __NR_renameat2 357
#elif defined(__riscv)
#define __NR_renameat2 276

View File

@ -41,7 +41,7 @@ enum PollPidResult
#define SYS_pidfd_open 434
#elif defined(__aarch64__)
#define SYS_pidfd_open 434
#elif defined(__ppc64__)
#elif defined(__powerpc64__)
#define SYS_pidfd_open 434
#elif defined(__riscv)
#define SYS_pidfd_open 434

View File

@ -32,9 +32,9 @@ void SerializationArray::serializeBinary(const Field & field, WriteBuffer & ostr
{
const Array & a = field.get<const Array &>();
writeVarUInt(a.size(), ostr);
for (size_t i = 0; i < a.size(); ++i)
for (const auto & i : a)
{
nested->serializeBinary(a[i], ostr, settings);
nested->serializeBinary(i, ostr, settings);
}
}

View File

@ -67,7 +67,7 @@ DatabaseMySQL::DatabaseMySQL(
try
{
/// Test that the database is working fine; it will also fetch tables.
empty();
empty(); // NOLINT(bugprone-standalone-empty)
}
catch (...)
{

View File

@ -32,7 +32,7 @@
#define SYS_preadv2 327
#elif defined(__aarch64__)
#define SYS_preadv2 286
#elif defined(__ppc64__)
#elif defined(__powerpc64__)
#define SYS_preadv2 380
#elif defined(__riscv)
#define SYS_preadv2 286

View File

@ -108,6 +108,10 @@ struct NgramDistanceImpl
if constexpr (case_insensitive)
{
#if defined(MEMORY_SANITIZER)
/// Due to PODArray padding accessing more elements should be OK
__msan_unpoison(code_points + (N - 1), padding_offset * sizeof(CodePoint));
#endif
/// We really need template lambdas with C++20 to do it inline
unrollLowering<N - 1>(code_points, std::make_index_sequence<padding_offset>());
}

View File

@ -44,6 +44,15 @@ TEST(IOResourceStaticResourceManager, Smoke)
TEST(IOResourceStaticResourceManager, Prioritization)
{
std::optional<Int64> last_priority;
auto check = [&] (Int64 priority)
{
// Lock is not required here because this is called during request execution and we have max_requests = 1
if (last_priority)
EXPECT_TRUE(priority <= *last_priority); // Should be true if every queue arrived at the same time at busy period start
last_priority = priority;
};
constexpr size_t threads_per_queue = 2;
int requests_per_thead = 100;
ResourceTest t(4 * threads_per_queue + 1);
@ -71,15 +80,6 @@ TEST(IOResourceStaticResourceManager, Prioritization)
</clickhouse>
)CONFIG");
std::optional<Int64> last_priority;
auto check = [&] (Int64 priority)
{
// Lock is not required here because this is called during request execution and we have max_requests = 1
if (last_priority)
EXPECT_TRUE(priority <= *last_priority); // Should be true if every queue arrived at the same time at busy period start
last_priority = priority;
};
for (String name : {"A", "B", "C", "D"})
{
for (int thr = 0; thr < threads_per_queue; thr++)

View File

@ -301,13 +301,13 @@ void checkAccessRightsForSelect(
}
ASTPtr parseAdditionalFilterConditionForTable(
const Map & setting,
const Map & additional_table_filters,
const DatabaseAndTableWithAlias & target,
const Context & context)
{
for (size_t i = 0; i < setting.size(); ++i)
for (const auto & additional_filter : additional_table_filters)
{
const auto & tuple = setting[i].safeGet<const Tuple &>();
const auto & tuple = additional_filter.safeGet<const Tuple &>();
auto & table = tuple.at(0).safeGet<String>();
auto & filter = tuple.at(1).safeGet<String>();

View File

@ -448,9 +448,9 @@ Field convertFieldToTypeImpl(const Field & src, const IDataType & type, const ID
{
Object object;
const auto & map = src.get<const Map &>();
for (size_t i = 0; i < map.size(); ++i)
for (const auto & element : map)
{
const auto & map_entry = map[i].get<Tuple>();
const auto & map_entry = element.get<Tuple>();
const auto & key = map_entry[0];
const auto & value = map_entry[1];

View File

@ -82,7 +82,7 @@ namespace
{
for (auto qt : collections::range(QuotaType::MAX))
{
if (ParserKeyword{QuotaTypeInfo::get(qt).keyword.c_str()}.ignore(pos, expected))
if (ParserKeyword{QuotaTypeInfo::get(qt).keyword}.ignore(pos, expected))
{
quota_type = qt;
return true;

View File

@ -17,8 +17,8 @@ namespace
for (auto i : collections::range(AccessEntityType::MAX))
{
const auto & type_info = AccessEntityTypeInfo::get(i);
if (ParserKeyword{type_info.name.c_str()}.ignore(pos, expected)
|| (!type_info.alias.empty() && ParserKeyword{type_info.alias.c_str()}.ignore(pos, expected)))
if (ParserKeyword{type_info.name}.ignore(pos, expected)
|| (!type_info.alias.empty() && ParserKeyword{type_info.alias}.ignore(pos, expected)))
{
type = i;
return true;

View File

@ -15,8 +15,8 @@ namespace
for (auto i : collections::range(AccessEntityType::MAX))
{
const auto & type_info = AccessEntityTypeInfo::get(i);
if (ParserKeyword{type_info.plural_name.c_str()}.ignore(pos, expected)
|| (!type_info.plural_alias.empty() && ParserKeyword{type_info.plural_alias.c_str()}.ignore(pos, expected)))
if (ParserKeyword{type_info.plural_name}.ignore(pos, expected)
|| (!type_info.plural_alias.empty() && ParserKeyword{type_info.plural_alias}.ignore(pos, expected)))
{
type = i;
return true;

View File

@ -25,8 +25,8 @@ namespace
for (auto i : collections::range(AccessEntityType::MAX))
{
const auto & type_info = AccessEntityTypeInfo::get(i);
if (ParserKeyword{type_info.name.c_str()}.ignore(pos, expected)
|| (!type_info.alias.empty() && ParserKeyword{type_info.alias.c_str()}.ignore(pos, expected)))
if (ParserKeyword{type_info.name}.ignore(pos, expected)
|| (!type_info.alias.empty() && ParserKeyword{type_info.alias}.ignore(pos, expected)))
{
type = i;
plural = false;
@ -37,8 +37,8 @@ namespace
for (auto i : collections::range(AccessEntityType::MAX))
{
const auto & type_info = AccessEntityTypeInfo::get(i);
if (ParserKeyword{type_info.plural_name.c_str()}.ignore(pos, expected)
|| (!type_info.plural_alias.empty() && ParserKeyword{type_info.plural_alias.c_str()}.ignore(pos, expected)))
if (ParserKeyword{type_info.plural_name}.ignore(pos, expected)
|| (!type_info.plural_alias.empty() && ParserKeyword{type_info.plural_alias}.ignore(pos, expected)))
{
type = i;
plural = true;

View File

@ -447,9 +447,9 @@ FilterDAGInfo buildAdditionalFiltersIfNeeded(const StoragePtr & storage,
auto const & storage_id = storage->getStorageID();
ASTPtr additional_filter_ast;
for (size_t i = 0; i < additional_filters.size(); ++i)
for (const auto & additional_filter : additional_filters)
{
const auto & tuple = additional_filters[i].safeGet<const Tuple &>();
const auto & tuple = additional_filter.safeGet<const Tuple &>();
auto const & table = tuple.at(0).safeGet<String>();
auto const & filter = tuple.at(1).safeGet<String>();

View File

@ -281,9 +281,9 @@ static void columnMapToContainer(const ColumnMap * col_map, size_t row_num, Cont
Field field;
col_map->get(row_num, field);
const auto & map_field = field.get<Map>();
for (size_t i = 0; i < map_field.size(); ++i)
for (const auto & map_element : map_field)
{
const auto & map_entry = map_field[i].get<Tuple>();
const auto & map_entry = map_element.get<Tuple>();
String entry_key;
String entry_value;

View File

@ -169,7 +169,7 @@ bool TemplateRowInputFormat::parseRowAndPrintDiagnosticInfo(MutableColumns & col
{
out << "Suffix does not match: ";
size_t last_successfully_parsed_idx = format_reader->getFormatDataIdx() + 1;
const ReadBuffer::Position row_begin_pos = buf->position();
auto * const row_begin_pos = buf->position();
bool caught = false;
try
{

View File

@ -52,8 +52,8 @@ void KafkaProducer::produce(const String & message, size_t rows_in_message, cons
if (key_column_index)
{
const auto & key_column = assert_cast<const ColumnString &>(*columns[key_column_index.value()]);
const auto key_data = key_column.getDataAt(last_row).toString();
builder.key(cppkafka::Buffer(key_data.data(), key_data.size()));
const auto key_data = key_column.getDataAt(last_row);
builder.key(cppkafka::Buffer(key_data.data, key_data.size));
}
if (timestamp_column_index)

View File

@ -464,10 +464,8 @@ static std::set<MergeTreeIndexPtr> getIndicesToRecalculate(
ASTPtr indices_recalc_expr_list = std::make_shared<ASTExpressionList>();
const auto & indices = metadata_snapshot->getSecondaryIndices();
for (size_t i = 0; i < indices.size(); ++i)
for (const auto & index : indices)
{
const auto & index = indices[i];
bool has_index =
source_part->checksums.has(INDEX_FILE_PREFIX + index.name + ".idx") ||
source_part->checksums.has(INDEX_FILE_PREFIX + index.name + ".idx2");

View File

@ -9,7 +9,7 @@ BuildConfig = Dict[str, ConfValue]
CI_CONFIG = {
"build_config": {
"package_release": {
"compiler": "clang-15",
"compiler": "clang-16",
"build_type": "",
"sanitizer": "",
"package_type": "deb",
@ -19,7 +19,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"coverity": {
"compiler": "clang-15",
"compiler": "clang-16",
"build_type": "",
"sanitizer": "",
"package_type": "coverity",
@ -28,7 +28,7 @@ CI_CONFIG = {
"official": False,
},
"package_aarch64": {
"compiler": "clang-15-aarch64",
"compiler": "clang-16-aarch64",
"build_type": "",
"sanitizer": "",
"package_type": "deb",
@ -38,7 +38,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"package_asan": {
"compiler": "clang-15",
"compiler": "clang-16",
"build_type": "",
"sanitizer": "address",
"package_type": "deb",
@ -46,7 +46,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"package_ubsan": {
"compiler": "clang-15",
"compiler": "clang-16",
"build_type": "",
"sanitizer": "undefined",
"package_type": "deb",
@ -54,7 +54,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"package_tsan": {
"compiler": "clang-15",
"compiler": "clang-16",
"build_type": "",
"sanitizer": "thread",
"package_type": "deb",
@ -62,7 +62,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"package_msan": {
"compiler": "clang-15",
"compiler": "clang-16",
"build_type": "",
"sanitizer": "memory",
"package_type": "deb",
@ -70,7 +70,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"package_debug": {
"compiler": "clang-15",
"compiler": "clang-16",
"build_type": "debug",
"sanitizer": "",
"package_type": "deb",
@ -78,7 +78,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"binary_release": {
"compiler": "clang-15",
"compiler": "clang-16",
"build_type": "",
"sanitizer": "",
"package_type": "binary",
@ -86,7 +86,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"binary_tidy": {
"compiler": "clang-15",
"compiler": "clang-16",
"build_type": "debug",
"sanitizer": "",
"package_type": "binary",
@ -95,7 +95,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"binary_darwin": {
"compiler": "clang-15-darwin",
"compiler": "clang-16-darwin",
"build_type": "",
"sanitizer": "",
"package_type": "binary",
@ -104,7 +104,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"binary_aarch64": {
"compiler": "clang-15-aarch64",
"compiler": "clang-16-aarch64",
"build_type": "",
"sanitizer": "",
"package_type": "binary",
@ -112,7 +112,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"binary_aarch64_v80compat": {
"compiler": "clang-15-aarch64-v80compat",
"compiler": "clang-16-aarch64-v80compat",
"build_type": "",
"sanitizer": "",
"package_type": "binary",
@ -121,7 +121,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"binary_freebsd": {
"compiler": "clang-15-freebsd",
"compiler": "clang-16-freebsd",
"build_type": "",
"sanitizer": "",
"package_type": "binary",
@ -130,7 +130,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"binary_darwin_aarch64": {
"compiler": "clang-15-darwin-aarch64",
"compiler": "clang-16-darwin-aarch64",
"build_type": "",
"sanitizer": "",
"package_type": "binary",
@ -139,7 +139,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"binary_ppc64le": {
"compiler": "clang-15-ppc64le",
"compiler": "clang-16-ppc64le",
"build_type": "",
"sanitizer": "",
"package_type": "binary",
@ -148,7 +148,7 @@ CI_CONFIG = {
"with_coverage": False,
},
"binary_amd64_compat": {
"compiler": "clang-15-amd64-compat",
"compiler": "clang-16-amd64-compat",
"build_type": "",
"sanitizer": "",
"package_type": "binary",

View File

@ -1,6 +1,6 @@
===1===
{"operation_name":"void DB::DistributedSink::writeToLocal(const Cluster::ShardInfo &, const DB::Block &, size_t)","cluster":"test_cluster_two_shards_localhost","shard":"1","rows":"1","bytes":"8"}
{"operation_name":"void DB::DistributedSink::writeToLocal(const Cluster::ShardInfo &, const DB::Block &, size_t)","cluster":"test_cluster_two_shards_localhost","shard":"2","rows":"1","bytes":"8"}
{"operation_name":"void DB::DistributedSink::writeToLocal(const Cluster::ShardInfo &, const Block &, size_t)","cluster":"test_cluster_two_shards_localhost","shard":"1","rows":"1","bytes":"8"}
{"operation_name":"void DB::DistributedSink::writeToLocal(const Cluster::ShardInfo &, const Block &, size_t)","cluster":"test_cluster_two_shards_localhost","shard":"2","rows":"1","bytes":"8"}
1
===2===
{"operation_name":"void DB::DistributedAsyncInsertDirectoryQueue::processFile(const std::string &)","cluster":"test_cluster_two_shards_localhost","shard":"1","rows":"1","bytes":"8"}
@ -8,11 +8,11 @@
3
2
===3===
{"operation_name":"auto DB::DistributedSink::runWritingJob(DB::DistributedSink::JobReplica &, const DB::Block &, size_t)::(anonymous class)::operator()() const","cluster":"test_cluster_two_shards_localhost","shard":"1","rows":"1","bytes":"8"}
{"operation_name":"auto DB::DistributedSink::runWritingJob(DB::DistributedSink::JobReplica &, const DB::Block &, size_t)::(anonymous class)::operator()() const","cluster":"test_cluster_two_shards_localhost","shard":"2","rows":"1","bytes":"8"}
{"operation_name":"auto DB::DistributedSink::runWritingJob(JobReplica &, const Block &, size_t)::(anonymous class)::operator()() const","cluster":"test_cluster_two_shards_localhost","shard":"1","rows":"1","bytes":"8"}
{"operation_name":"auto DB::DistributedSink::runWritingJob(JobReplica &, const Block &, size_t)::(anonymous class)::operator()() const","cluster":"test_cluster_two_shards_localhost","shard":"2","rows":"1","bytes":"8"}
1
===4===
{"operation_name":"auto DB::DistributedSink::runWritingJob(DB::DistributedSink::JobReplica &, const DB::Block &, size_t)::(anonymous class)::operator()() const","cluster":"test_cluster_two_shards_localhost","shard":"1","rows":"1","bytes":"8"}
{"operation_name":"auto DB::DistributedSink::runWritingJob(DB::DistributedSink::JobReplica &, const DB::Block &, size_t)::(anonymous class)::operator()() const","cluster":"test_cluster_two_shards_localhost","shard":"2","rows":"1","bytes":"8"}
{"operation_name":"auto DB::DistributedSink::runWritingJob(JobReplica &, const Block &, size_t)::(anonymous class)::operator()() const","cluster":"test_cluster_two_shards_localhost","shard":"1","rows":"1","bytes":"8"}
{"operation_name":"auto DB::DistributedSink::runWritingJob(JobReplica &, const Block &, size_t)::(anonymous class)::operator()() const","cluster":"test_cluster_two_shards_localhost","shard":"2","rows":"1","bytes":"8"}
3
2