Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into bff
Browse files Browse the repository at this point in the history
  • Loading branch information
al13n321 committed Dec 18, 2024
2 parents 3448e4d + 33f3db7 commit d6f374d
Show file tree
Hide file tree
Showing 2,519 changed files with 67,460 additions and 207,695 deletions.
24 changes: 3 additions & 21 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,23 @@ Checks: [
'-android-*',

'-boost-use-ranges',
'-modernize-use-ranges',

'-bugprone-assignment-in-if-condition',
'-bugprone-branch-clone',
'-bugprone-easily-swappable-parameters',
'-bugprone-exception-escape',
'-bugprone-forward-declaration-namespace',
'-bugprone-implicit-widening-of-multiplication-result',
'-bugprone-multi-level-implicit-pointer-conversion',
'-bugprone-narrowing-conversions',
'-bugprone-not-null-terminated-result',
'-bugprone-unchecked-optional-access',
'-bugprone-crtp-constructor-accessibility',
'-bugprone-not-null-terminated-result',

'-cert-dcl16-c',
'-cert-err58-cpp',
'-cert-msc32-c',
'-cert-msc51-cpp',
'-cert-oop54-cpp',
'-cert-oop57-cpp',
'-cert-err33-c', # Misreports on clang-19: it warns about all functions containing 'remove' in the name, not only about the standard library.

'-clang-analyzer-optin.performance.Padding',

'-clang-analyzer-cplusplus.PlacementNew',

'-clang-analyzer-unix.Malloc',

'-cppcoreguidelines-*', # impractical in a codebase as large as ClickHouse, also slow

'-darwin-*',
Expand Down Expand Up @@ -77,40 +66,34 @@ Checks: [
'-hicpp-use-emplace',
'-hicpp-vararg',

'-linuxkernel-*',

'-llvm-*',

'-llvmlibc-*',

'-openmp-*',

'-misc-const-correctness',
'-misc-include-cleaner', # useful but far too many occurrences
'-misc-no-recursion',
'-misc-non-private-member-variables-in-classes',
'-misc-confusable-identifiers', # useful but slooo
'-misc-use-anonymous-namespace',
'-misc-use-internal-linkage',

'-modernize-avoid-c-arrays',
'-modernize-concat-nested-namespaces',
'-modernize-macro-to-enum',
'-modernize-pass-by-value',
'-modernize-return-braced-init-list',
'-modernize-use-auto',
'-modernize-use-constraints', # This is a good check, but clang-tidy crashes, see https://github.com/llvm/llvm-project/issues/91872
'-modernize-use-default-member-init',
'-modernize-use-emplace',
'-modernize-use-nodiscard',
'-modernize-use-ranges',
'-modernize-use-trailing-return-type',
'-modernize-use-designated-initializers',

'-performance-avoid-endl',
'-performance-enum-size',
'-performance-inefficient-string-concatenation',
'-performance-inefficient-vector-operation',
'-performance-no-int-to-ptr',
'-performance-avoid-endl',
'-performance-unnecessary-value-param',

'-portability-simd-intrinsics',
Expand All @@ -125,7 +108,6 @@ Checks: [
'-readability-identifier-length',
'-readability-identifier-naming', # useful but too slow
'-readability-implicit-bool-conversion',
'-readability-isolate-declaration',
'-readability-magic-numbers',
'-readability-named-parameter',
'-readability-redundant-declaration',
Expand Down
121 changes: 120 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ string (TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
list(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)

option (ENABLE_FUZZING "Fuzzy testing using libfuzzer" OFF)
option (ENABLE_FUZZER_TEST "Build testing fuzzers in order to test libFuzzer functionality" OFF)

if (ENABLE_FUZZING)
# Also set WITH_COVERAGE=1 for better fuzzing process
Expand Down Expand Up @@ -592,6 +591,20 @@ endif()

include (cmake/sanitize_targets.cmake)

if (COMPILER_CACHE STREQUAL "chcache")
set (ENABLE_BUILD_PATH_MAPPING_DEFAULT ON)

get_all_targets(all_targets)
set (chcache_targets _cargo-build_chcache cargo-build_chcache cargo-prebuild_chcache)
foreach(target ${all_targets})
if (target IN_LIST chcache_targets)
continue()
endif()

add_dependencies(${target} cargo-build_chcache)
endforeach()
endif()

# Build native targets if necessary
get_property(NATIVE_BUILD_TARGETS GLOBAL PROPERTY NATIVE_BUILD_TARGETS)
if (NATIVE_BUILD_TARGETS
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ curl https://clickhouse.com/ | sh

Every month we get together with the community (users, contributors, customers, those interested in learning more about ClickHouse) to discuss what is coming in the latest release. If you are interested in sharing what you've built on ClickHouse, let us know.

* [v24.10 Community Call](https://clickhouse.com/company/events/v24-10-community-release-call) - October 31
* [v24.12 Community Call](https://clickhouse.com/company/events/v24-12-community-release-call) - December 19

## Upcoming Events

Keep an eye out for upcoming meetups and events around the world. Somewhere else you want us to be? Please feel free to reach out to tyler `<at>` clickhouse `<dot>` com. You can also peruse [ClickHouse Events](https://clickhouse.com/company/news-events) for a list of all upcoming trainings, meetups, speaking engagements, etc.

Upcoming meetups

* [Amsterdam Meetup](https://www.meetup.com/clickhouse-netherlands-user-group/events/303638814) - December 3
* [Stockholm Meetup](https://www.meetup.com/clickhouse-stockholm-user-group/events/304382411) - December 9
* [New York Meetup](https://www.meetup.com/clickhouse-new-york-user-group/events/304268174) - December 9
* [Kuala Lampur Meetup](https://www.meetup.com/clickhouse-malaysia-meetup-group/events/304576472/) - December 11
* [San Francisco Meetup](https://www.meetup.com/clickhouse-silicon-valley-meetup-group/events/304286951/) - December 12
* [Dubai Meetup](https://www.meetup.com/clickhouse-dubai-meetup-group/events/303096989/) - Feb 3

Recently completed meetups

* [San Francisco Meetup](https://www.meetup.com/clickhouse-silicon-valley-meetup-group/events/304286951/) - December 12
* [Kuala Lampur Meetup](https://www.meetup.com/clickhouse-malaysia-meetup-group/events/304576472/) - December 11
* [Stockholm Meetup](https://www.meetup.com/clickhouse-stockholm-user-group/events/304382411) - December 9
* [New York Meetup](https://www.meetup.com/clickhouse-new-york-user-group/events/304268174) - December 9
* [Amsterdam Meetup](https://www.meetup.com/clickhouse-netherlands-user-group/events/303638814) - December 3
* [Paris Meetup](https://www.meetup.com/clickhouse-france-user-group/events/303096434) - November 26
* [Ghent Meetup](https://www.meetup.com/clickhouse-belgium-user-group/events/303049405/) - November 19
* [Barcelona Meetup](https://www.meetup.com/clickhouse-spain-user-group/events/303096876/) - November 12
Expand Down
2 changes: 1 addition & 1 deletion base/base/JSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <base/find_symbols.h>
#include <base/preciseExp10.h>

#define JSON_MAX_DEPTH 100
constexpr size_t JSON_MAX_DEPTH = 100;


#pragma clang diagnostic push
Expand Down
4 changes: 2 additions & 2 deletions base/base/itoa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,13 @@ ALWAYS_INLINE inline char * writeSIntText(T x, char * pos)
if constexpr (std::is_same_v<T, Int128>)
{
const char * res = "-170141183460469231731687303715884105728";
memcpy(pos, res, strlen(res));
memcpy(pos, res, strlen(res)); /// NOLINT(bugprone-not-null-terminated-result)
return pos + strlen(res);
}
else if constexpr (std::is_same_v<T, Int256>)
{
const char * res = "-57896044618658097711785492504343953926634992332820282019728792003956564819968";
memcpy(pos, res, strlen(res));
memcpy(pos, res, strlen(res)); /// NOLINT(bugprone-not-null-terminated-result)
return pos + strlen(res);
}
}
Expand Down
3 changes: 2 additions & 1 deletion base/base/preciseExp10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ double preciseExp10(double x)
1e+289, 1e+290, 1e+291, 1e+292, 1e+293, 1e+294, 1e+295, 1e+296, 1e+297, 1e+298, 1e+299, 1e+300, 1e+301, 1e+302, 1e+303, 1e+304, 1e+305,
1e+306, 1e+307, 1e+308};

double n, y = modf(x, &n);
double n;
double y = modf(x, &n);
if (n > 308) return INFINITY;
if (n < -323) return 0;

Expand Down
2 changes: 1 addition & 1 deletion base/harmful/harmful.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ TRAP(gethostbyaddr)
TRAP(gethostbyname)
TRAP(gethostbyname2)
TRAP(gethostent)
TRAP(getlogin)
TRAP(getnetbyaddr)
TRAP(getnetbyname)
TRAP(getnetent)
Expand Down Expand Up @@ -291,6 +290,7 @@ TRAP(putenv)
TRAP(setlogmask)
TRAP(rand)
TRAP(getmntent)
TRAP(getlogin)
#endif

#endif
5 changes: 5 additions & 0 deletions base/poco/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ add_subdirectory (Data)
add_subdirectory (Data/ODBC)
add_subdirectory (Foundation)
add_subdirectory (JSON)

if (USE_MONGODB)
add_subdirectory(MongoDB)
endif()

add_subdirectory (Net)
add_subdirectory (NetSSL_OpenSSL)
add_subdirectory (Redis)
Expand Down
16 changes: 16 additions & 0 deletions base/poco/MongoDB/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
file (GLOB SRCS src/*.cpp)

add_library (_poco_mongodb ${SRCS})
add_library (Poco::MongoDB ALIAS _poco_mongodb)

# TODO: remove these warning exclusions
target_compile_options (_poco_mongodb
PRIVATE
-Wno-old-style-cast
-Wno-unused-parameter
-Wno-zero-as-null-pointer-constant
)

target_include_directories (_poco_mongodb SYSTEM PUBLIC "include")
target_link_libraries (_poco_mongodb PUBLIC Poco::Net)

142 changes: 142 additions & 0 deletions base/poco/MongoDB/include/Poco/MongoDB/Array.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
//
// Array.h
//
// Library: MongoDB
// Package: MongoDB
// Module: Array
//
// Definition of the Array class.
//
// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//


#ifndef MongoDB_Array_INCLUDED
#define MongoDB_Array_INCLUDED


#include "Poco/MongoDB/Document.h"
#include "Poco/MongoDB/MongoDB.h"
#include "Poco/NumberFormatter.h"


namespace Poco
{
namespace MongoDB
{


class MongoDB_API Array : public Document
/// This class represents a BSON Array.
{
public:
using Ptr = SharedPtr<Array>;

Array();
/// Creates an empty Array.

virtual ~Array();
/// Destroys the Array.

// Document template functions available for backward compatibility
using Document::add;
using Document::get;

template <typename T>
Document & add(T value)
/// Creates an element with the name from the current pos and value and
/// adds it to the array document.
///
/// The active document is returned to allow chaining of the add methods.
{
return Document::add<T>(Poco::NumberFormatter::format(size()), value);
}

Document & add(const char * value)
/// Creates an element with a name from the current pos and value and
/// adds it to the array document.
///
/// The active document is returned to allow chaining of the add methods.
{
return Document::add(Poco::NumberFormatter::format(size()), value);
}

template <typename T>
T get(std::size_t pos) const
/// Returns the element at the given index and tries to convert
/// it to the template type. If the element is not found, a
/// Poco::NotFoundException will be thrown. If the element cannot be
/// converted a BadCastException will be thrown.
{
return Document::get<T>(Poco::NumberFormatter::format(pos));
}

template <typename T>
T get(std::size_t pos, const T & deflt) const
/// Returns the element at the given index and tries to convert
/// it to the template type. If the element is not found, or
/// has the wrong type, the deflt argument will be returned.
{
return Document::get<T>(Poco::NumberFormatter::format(pos), deflt);
}

Element::Ptr get(std::size_t pos) const;
/// Returns the element at the given index.
/// An empty element will be returned if the element is not found.

template <typename T>
bool isType(std::size_t pos) const
/// Returns true if the type of the element equals the TypeId of ElementTrait,
/// otherwise false.
{
return Document::isType<T>(Poco::NumberFormatter::format(pos));
}

std::string toString(int indent = 0) const;
/// Returns a string representation of the Array.

private:
friend void BSONReader::read<Array::Ptr>(Array::Ptr & to);
};


// BSON Embedded Array
// spec: document
template <>
struct ElementTraits<Array::Ptr>
{
enum
{
TypeId = 0x04
};

static std::string toString(const Array::Ptr & value, int indent = 0)
{
//TODO:
return value.isNull() ? "null" : value->toString(indent);
}
};


template <>
inline void BSONReader::read<Array::Ptr>(Array::Ptr & to)
{
to->read(_reader);
}


template <>
inline void BSONWriter::write<Array::Ptr>(Array::Ptr & from)
{
from->write(_writer);
}


}
} // namespace Poco::MongoDB


#endif // MongoDB_Array_INCLUDED
Loading

0 comments on commit d6f374d

Please sign in to comment.