Skip to content

Commit 2975f49

Browse files
Merge branch 'master' into no-bad-tests
2 parents e316f67 + 1b7dc9c commit 2975f49

File tree

55 files changed

+868
-482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+868
-482
lines changed

ci/jobs/scripts/check_style/aspell-ignore/en/aspell-dict.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,6 +1961,7 @@ grpcio
19611961
gtest
19621962
gtid
19631963
gzip
1964+
gunzip
19641965
gzipped
19651966
hadoop
19661967
halfMD
@@ -2345,6 +2346,8 @@ namespace
23452346
namespaces
23462347
natively
23472348
nats
2349+
ncat
2350+
netcat
23482351
ness
23492352
nestjs
23502353
netloc

ci/jobs/scripts/check_style/check_cpp.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ find $ROOT_PATH/{src,base,programs,utils} -name '*.h' -or -name '*.cpp' |
327327
echo "If an exception has LOGICAL_ERROR code, there is no need to include the text 'Logical error' in the exception message, because then the phrase 'Logical error' will be printed twice."
328328

329329
PATTERN="allow_";
330-
DIFF=$(comm -3 <(grep -o "\b$PATTERN\w*\b" $ROOT_PATH/src/Core/Settings.cpp | sort -u) <(grep -o -h "\b$PATTERN\w*\b" $ROOT_PATH/src/Databases/enableAllExperimentalSettings.cpp $ROOT_PATH/utils/check-style/experimental_settings_ignore.txt | sort -u));
331-
[ -n "$DIFF" ] && echo "$DIFF" && echo "^^ Detected 'allow_*' settings that might need to be included in src/Databases/enableAllExperimentalSettings.cpp" && echo "Alternatively, consider adding an exception to utils/check-style/experimental_settings_ignore.txt"
330+
DIFF=$(comm -3 <(grep -o "\b$PATTERN\w*\b" $ROOT_PATH/src/Core/Settings.cpp | sort -u) <(grep -o -h "\b$PATTERN\w*\b" $ROOT_PATH/src/Databases/enableAllExperimentalSettings.cpp $ROOT_PATH/ci/jobs/scripts/check_style/experimental_settings_ignore.txt | sort -u));
331+
[ -n "$DIFF" ] && echo "$DIFF" && echo "^^ Detected 'allow_*' settings that might need to be included in src/Databases/enableAllExperimentalSettings.cpp" && echo "Alternatively, consider adding an exception to ci/jobs/scripts/check_style/experimental_settings_ignore.txt"
332332

333333
# Don't allow the direct inclusion of magic_enum.hpp and instead point to base/EnumReflection.h
334334
find $ROOT_PATH/{src,base,programs,utils} -name '*.cpp' -or -name '*.h' | xargs grep -l "magic_enum.hpp" | grep -v EnumReflection.h | while read -r line;

ci/jobs/scripts/check_style/check_typos.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ ROOT_PATH="."
77
#FIXME: check all (or almost all) repo
88
codespell \
99
--skip "*generated*,*gperf*,*.bin,*.mrk*,*.idx,checksums.txt,*.dat,*.pyc,*.kate-swp,*obfuscateQueries.cpp,d3-*.js,*.min.js,*.sum,${ROOT_PATH}/utils/check-style/aspell-ignore" \
10-
--ignore-words "${ROOT_PATH}/utils/check-style/codespell-ignore-words.list" \
11-
--exclude-file "${ROOT_PATH}/utils/check-style/codespell-ignore-lines.list" \
10+
--ignore-words "${ROOT_PATH}/ci/jobs/scripts/check_style/codespell-ignore-words.list" \
11+
--exclude-file "${ROOT_PATH}/ci/jobs/scripts/check_style/codespell-ignore-lines.list" \
1212
--quiet-level 2 \
1313
"$ROOT_PATH"/{src,base,programs,utils} \
1414
$@ | grep -P '.' \

docs/en/interfaces/http.md

Lines changed: 267 additions & 128 deletions
Large diffs are not rendered by default.

programs/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ endif()
224224

225225
if (CHECK_LARGE_OBJECT_SIZES)
226226
add_custom_command(TARGET clickhouse POST_BUILD
227-
COMMAND "${CMAKE_SOURCE_DIR}/utils/check-style/check-large-objects.sh" "${CMAKE_BINARY_DIR}")
227+
COMMAND "${CMAKE_SOURCE_DIR}/utils/check-large-objects.sh" "${CMAKE_BINARY_DIR}")
228228
endif ()
229229

230230
if (SPLIT_DEBUG_SYMBOLS)

src/Common/ZooKeeper/ZooKeeper.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,13 @@ ZooKeeper::multiImpl(const Coordination::Requests & requests, Coordination::Resp
771771

772772
if (future_result.wait_for(std::chrono::milliseconds(args.operation_timeout_ms)) != std::future_status::ready)
773773
{
774-
impl->finalize(fmt::format("Operation timeout on {} {}", Coordination::OpNum::Multi, requests[0]->getPath()));
774+
auto & request = *requests[0];
775+
impl->finalize(fmt::format(
776+
"Operation timeout on {} of {} requests. First ({}): {}",
777+
Coordination::OpNum::Multi,
778+
requests.size(),
779+
demangle(typeid(request).name()),
780+
request.getPath()));
775781
return {Coordination::Error::ZOPERATIONTIMEOUT, ""};
776782
}
777783

src/Common/parseGlobs.cpp

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,27 @@ namespace ErrorCodes
1515
extern const int BAD_ARGUMENTS;
1616
}
1717

18-
static const re2::RE2 range_regex(R"({([\d]+\.\.[\d]+)})"); /// regexp for {M..N}, where M and N - non-negative integers
19-
static const re2::RE2 enum_regex(R"({([^{}*,]+[^{}*]*[^{}*,])})"); /// regexp for {expr1,expr2,expr3}, expr's should be without "{", "}", "*" and ","
18+
namespace
19+
{
20+
struct Regexps
21+
{
22+
static const Regexps & instance()
23+
{
24+
static Regexps regexps;
25+
return regexps;
26+
}
27+
28+
/// regexp for {M..N}, where M and N - non-negative integers
29+
re2::RE2 range_regex{R"({([\d]+\.\.[\d]+)})"};
30+
31+
/// regexp for {expr1,expr2,expr3}, expr's should be without "{", "}", "*" and ","
32+
re2::RE2 enum_regex{R"({([^{}*,]+[^{}*]*[^{}*,])})"};
33+
};
34+
}
2035

2136
bool containsRangeGlob(const std::string & input)
2237
{
23-
return RE2::PartialMatch(input, range_regex);
38+
return RE2::PartialMatch(input, Regexps::instance().range_regex);
2439
}
2540

2641
bool containsOnlyEnumGlobs(const std::string & input)
@@ -67,8 +82,8 @@ std::string makeRegexpPatternFromGlobs(const std::string & initial_str_with_glob
6782
std::string_view matched_range;
6883
std::string_view matched_enum;
6984

70-
auto did_match_range = RE2::PartialMatch(input, range_regex, &matched_range);
71-
auto did_match_enum = RE2::PartialMatch(input, enum_regex, &matched_enum);
85+
auto did_match_range = RE2::PartialMatch(input, Regexps::instance().range_regex, &matched_range);
86+
auto did_match_enum = RE2::PartialMatch(input, Regexps::instance().enum_regex, &matched_enum);
7287

7388
/// Enum regex matches ranges, so if they both match and point to the same data,
7489
/// it is a range.
@@ -78,7 +93,7 @@ std::string makeRegexpPatternFromGlobs(const std::string & initial_str_with_glob
7893
/// We matched a range, and range comes earlier than enum
7994
if (did_match_range && (!did_match_enum || matched_range.data() < matched_enum.data()))
8095
{
81-
RE2::FindAndConsume(&input, range_regex, &matched);
96+
RE2::FindAndConsume(&input, Regexps::instance().range_regex, &matched);
8297
std::string buffer(matched);
8398
oss_for_replacing << escaped_with_globs.substr(current_index, matched_range.data() - escaped_with_globs.data() - current_index - 1) << '(';
8499

@@ -122,7 +137,7 @@ std::string makeRegexpPatternFromGlobs(const std::string & initial_str_with_glob
122137
/// We matched enum, and it comes earlier than range.
123138
else if (did_match_enum && (!did_match_range || matched_enum.data() < matched_range.data()))
124139
{
125-
RE2::FindAndConsume(&input, enum_regex, &matched);
140+
RE2::FindAndConsume(&input, Regexps::instance().enum_regex, &matched);
126141
std::string buffer(matched);
127142

128143
oss_for_replacing << escaped_with_globs.substr(current_index, matched.data() - escaped_with_globs.data() - current_index - 1) << '(';

0 commit comments

Comments
 (0)