text
stringlengths
19
585k
label
stringclasses
2 values
category
stringclasses
2 values
language
stringclasses
14 values
repo
stringclasses
932 values
sha
stringlengths
40
40
@@ -67,6 +67,8 @@ ASTPtr ASTAlterCommand::clone() const res->rename_to = res->children.emplace_back(rename_to->clone()).get(); if (execute_args) res->execute_args = res->children.emplace_back(execute_args->clone()).get(); + if (add_enum_values) + res->add_enum_values = res->children.emp...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/Parsers/ASTAlterQuery.cpp b/src/Parsers/ASTAlterQuery.cpp index e0a808c98056..17a8e6ca3420 100644 --- a/src/Parsers/ASTAlterQuery.cpp +++ b/src/Parsers/ASTAlterQuery.cpp @@ -67,6 +67,8 @@ ASTPtr ASTAlterCommand::clone() const res->rename_to = res->children.emplace_back(rename_to->clone()).get(...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -1428,6 +1438,76 @@ void AlterCommands::prepare(const StorageInMemoryMetadata & metadata) command.default_expression = column_from_table.default_desc.expression; } + struct EnumTypeInfo + { + const IDataTypeEnum * enum_type = nu...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/Storages/AlterCommands.cpp b/src/Storages/AlterCommands.cpp index 3863adc67515..387e0f5e55c2 100644 --- a/src/Storages/AlterCommands.cpp +++ b/src/Storages/AlterCommands.cpp @@ -81,6 +81,7 @@ namespace ErrorCodes extern const int NOT_IMPLEMENTED; extern const int ALTER_OF_COLUMN_IS_FORBIDDEN;...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -332,17 +344,79 @@ static DataTypePtr create(const ASTPtr & arguments) Int64 value = value_literal->value.safeGet<Int64>(); if (value > std::numeric_limits<Int8>::max() || value < std::numeric_limits<Int8>::min()) - return createExact<DataTypeEnum16>(arguments); + return cre...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/DataTypes/DataTypeEnum.cpp b/src/DataTypes/DataTypeEnum.cpp index 682cb3106b26..e401538cfdc8 100644 --- a/src/DataTypes/DataTypeEnum.cpp +++ b/src/DataTypes/DataTypeEnum.cpp @@ -16,6 +16,7 @@ #include <Interpreters/Context.h> #include <Core/Settings.h> +#include <algorithm> #include <limits> @...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -1428,6 +1438,76 @@ void AlterCommands::prepare(const StorageInMemoryMetadata & metadata) command.default_expression = column_from_table.default_desc.expression; } + struct EnumTypeInfo + { + const IDataTypeEnum * enum_type = nu...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/Storages/AlterCommands.cpp b/src/Storages/AlterCommands.cpp index 3863adc67515..387e0f5e55c2 100644 --- a/src/Storages/AlterCommands.cpp +++ b/src/Storages/AlterCommands.cpp @@ -81,6 +81,7 @@ namespace ErrorCodes extern const int NOT_IMPLEMENTED; extern const int ALTER_OF_COLUMN_IS_FORBIDDEN;...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -819,6 +823,17 @@ bool ParserAlterCommand::parseImpl(Pos & pos, ASTPtr & node, Expected & expected if (!parser_reset_setting.parse(pos, command_settings_resets, expected)) return false; } + else if (s_add_enum_values.ignore(pos, expected))...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/Parsers/ParserAlterQuery.cpp b/src/Parsers/ParserAlterQuery.cpp index 866ce4286351..e2bd193b1a2d 100644 --- a/src/Parsers/ParserAlterQuery.cpp +++ b/src/Parsers/ParserAlterQuery.cpp @@ -45,6 +45,7 @@ bool ParserAlterCommand::parseImpl(Pos & pos, ASTPtr & node, Expected & expected ParserKeyword s_m...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -3,6 +3,7 @@ #include <DataTypes/IDataType.h> #include <DataTypes/EnumValues.h> #include <Columns/ColumnVector.h> +#include <Parsers/IAST.h>
bad
review
c
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/DataTypes/DataTypeEnum.h b/src/DataTypes/DataTypeEnum.h index 86baf4238f9a..8e5222499559 100644 --- a/src/DataTypes/DataTypeEnum.h +++ b/src/DataTypes/DataTypeEnum.h @@ -1,8 +1,10 @@ #pragma once +#include <vector> #include <DataTypes/IDataType.h> #include <DataTypes/EnumValues.h> #include <Colum...
good
review_fixed
c
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -275,6 +282,24 @@ Reset column setting `max_compress_block_size` to it's default value: ALTER TABLE table_name MODIFY COLUMN column_name RESET SETTING max_compress_block_size; ``` +## MODIFY COLUMN ADD ENUM VALUES {#modify-column-add-enum-values} + +Adds new values to a column of type `Enum`, `Enum8` or `Enum16`...
bad
review
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/docs/en/sql-reference/statements/alter/column.md b/docs/en/sql-reference/statements/alter/column.md index f845210447bc..39f8fa02bb7c 100644 --- a/docs/en/sql-reference/statements/alter/column.md +++ b/docs/en/sql-reference/statements/alter/column.md @@ -29,6 +29,7 @@ The following actions are supported: -...
good
review_fixed
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -1428,6 +1438,82 @@ void AlterCommands::prepare(const StorageInMemoryMetadata & metadata) command.default_expression = column_from_table.default_desc.expression; } + struct EnumTypeInfo + { + const IDataTypeEnum * enum_type = nu...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/Storages/AlterCommands.cpp b/src/Storages/AlterCommands.cpp index 3863adc67515..387e0f5e55c2 100644 --- a/src/Storages/AlterCommands.cpp +++ b/src/Storages/AlterCommands.cpp @@ -81,6 +81,7 @@ namespace ErrorCodes extern const int NOT_IMPLEMENTED; extern const int ALTER_OF_COLUMN_IS_FORBIDDEN;...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -1422,12 +1432,82 @@ void AlterCommands::prepare(const StorageInMemoryMetadata & metadata) if (has_column) { const auto & column_from_table = columns.get(command.column_name); + struct EnumTypeInfo + { + const IDataTypeEnum *...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/Storages/AlterCommands.cpp b/src/Storages/AlterCommands.cpp index 3863adc67515..387e0f5e55c2 100644 --- a/src/Storages/AlterCommands.cpp +++ b/src/Storages/AlterCommands.cpp @@ -81,6 +81,7 @@ namespace ErrorCodes extern const int NOT_IMPLEMENTED; extern const int ALTER_OF_COLUMN_IS_FORBIDDEN;...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -250,6 +255,7 @@ static void autoAssignNumberForEnum(const ASTPtr & arguments) literal_child_assign_num = value_literal->value.safeGet<Int64>(); } assign_number_child.emplace_back(child); + can_be_relative = false;
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/DataTypes/DataTypeEnum.cpp b/src/DataTypes/DataTypeEnum.cpp index 682cb3106b26..e401538cfdc8 100644 --- a/src/DataTypes/DataTypeEnum.cpp +++ b/src/DataTypes/DataTypeEnum.cpp @@ -16,6 +16,7 @@ #include <Interpreters/Context.h> #include <Core/Settings.h> +#include <algorithm> #include <limits> @...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -0,0 +1,57 @@ +{% for NULLABLE_START, NULLABLE_END in {'' : '', 'Nullable(' : ')'}.items() -%} +SELECT '======= NULLABLE {{ NULLABLE_START }} {{ NULLABLE_END }} ==============='; +{% for ENUM_TYPE in ['Enum', 'Enum8', 'Enum16'] -%} + +SELECT '======= {{ ENUM_TYPE }} ==============='; +DROP TABLE IF EXISTS enum; +CRE...
bad
review
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/tests/queries/0_stateless/04307_add_to_enum.sql.j2 b/tests/queries/0_stateless/04307_add_to_enum.sql.j2 new file mode 100644 index 000000000000..250dd7fdf109 --- /dev/null +++ b/tests/queries/0_stateless/04307_add_to_enum.sql.j2 @@ -0,0 +1,129 @@ +{% for NULLABLE_START, NULLABLE_END in {'' : '', 'Nullable(...
good
review_fixed
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -217,39 +221,75 @@ static void checkASTStructure(const ASTPtr & child) "'name' = number, where name is string literal and number is an integer"); } -static void autoAssignNumberForEnum(const ASTPtr & arguments) +struct EnumElementLiterals +{ + const ASTLiteral * name_literal = nullptr;...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/DataTypes/DataTypeEnum.cpp b/src/DataTypes/DataTypeEnum.cpp index 682cb3106b26..e401538cfdc8 100644 --- a/src/DataTypes/DataTypeEnum.cpp +++ b/src/DataTypes/DataTypeEnum.cpp @@ -16,6 +16,7 @@ #include <Interpreters/Context.h> #include <Core/Settings.h> +#include <algorithm> #include <limits> @...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -275,6 +282,24 @@ Reset column setting `max_compress_block_size` to it's default value: ALTER TABLE table_name MODIFY COLUMN column_name RESET SETTING max_compress_block_size; ```
bad
review
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/docs/en/sql-reference/statements/alter/column.md b/docs/en/sql-reference/statements/alter/column.md index f845210447bc..39f8fa02bb7c 100644 --- a/docs/en/sql-reference/statements/alter/column.md +++ b/docs/en/sql-reference/statements/alter/column.md @@ -29,6 +29,7 @@ The following actions are supported: -...
good
review_fixed
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -164,3 +164,26 @@ Enum values are also convertible to numeric types using the `toT` function, wher The Enum type can be changed without cost using ALTER, if only the set of values is changed. It is possible to both add and remove members of the Enum using ALTER (removing is safe only if the removed value has never ...
bad
review
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/docs/en/sql-reference/data-types/enum.md b/docs/en/sql-reference/data-types/enum.md index 5f330bcd8766..ecbc90e8bc42 100644 --- a/docs/en/sql-reference/data-types/enum.md +++ b/docs/en/sql-reference/data-types/enum.md @@ -162,3 +162,26 @@ Enum values are also convertible to numeric types using the `toT` fu...
good
review_fixed
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -332,17 +362,88 @@ static DataTypePtr create(const ASTPtr & arguments) Int64 value = value_literal->value.safeGet<Int64>(); if (value > std::numeric_limits<Int8>::max() || value < std::numeric_limits<Int8>::min()) - return createExact<DataTypeEnum16>(arguments); + return cre...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/DataTypes/DataTypeEnum.cpp b/src/DataTypes/DataTypeEnum.cpp index 682cb3106b26..e401538cfdc8 100644 --- a/src/DataTypes/DataTypeEnum.cpp +++ b/src/DataTypes/DataTypeEnum.cpp @@ -16,6 +16,7 @@ #include <Interpreters/Context.h> #include <Core/Settings.h> +#include <algorithm> #include <limits> @...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -332,17 +362,88 @@ static DataTypePtr create(const ASTPtr & arguments) Int64 value = value_literal->value.safeGet<Int64>(); if (value > std::numeric_limits<Int8>::max() || value < std::numeric_limits<Int8>::min()) - return createExact<DataTypeEnum16>(arguments); + return cre...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/DataTypes/DataTypeEnum.cpp b/src/DataTypes/DataTypeEnum.cpp index 682cb3106b26..e401538cfdc8 100644 --- a/src/DataTypes/DataTypeEnum.cpp +++ b/src/DataTypes/DataTypeEnum.cpp @@ -16,6 +16,7 @@ #include <Interpreters/Context.h> #include <Core/Settings.h> +#include <algorithm> #include <limits> @...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -1437,12 +1447,82 @@ void AlterCommands::prepare(const StorageInMemoryMetadata & metadata, bool share if (has_column) { const auto & column_from_table = columns.get(command.column_name); + struct EnumTypeInfo + { + const IDat...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/Storages/AlterCommands.cpp b/src/Storages/AlterCommands.cpp index 3863adc67515..387e0f5e55c2 100644 --- a/src/Storages/AlterCommands.cpp +++ b/src/Storages/AlterCommands.cpp @@ -81,6 +81,7 @@ namespace ErrorCodes extern const int NOT_IMPLEMENTED; extern const int ALTER_OF_COLUMN_IS_FORBIDDEN;...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -275,6 +282,24 @@ Reset column setting `max_compress_block_size` to it's default value: ALTER TABLE table_name MODIFY COLUMN column_name RESET SETTING max_compress_block_size; ``` +## MODIFY COLUMN ADD ENUM VALUES {#modify-column-add-enum-values} + +Adds new values to a column of type `Enum`, `Enum8`, `Enum16`, ...
bad
review
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/docs/en/sql-reference/statements/alter/column.md b/docs/en/sql-reference/statements/alter/column.md index f845210447bc..39f8fa02bb7c 100644 --- a/docs/en/sql-reference/statements/alter/column.md +++ b/docs/en/sql-reference/statements/alter/column.md @@ -29,6 +29,7 @@ The following actions are supported: -...
good
review_fixed
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -1465,12 +1475,81 @@ void AlterCommands::prepare(const StorageInMemoryMetadata & metadata, bool share if (has_column) { const auto & column_from_table = columns.get(command.column_name); + struct EnumTypeInfo + { + const IDat...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/Storages/AlterCommands.cpp b/src/Storages/AlterCommands.cpp index 3863adc67515..387e0f5e55c2 100644 --- a/src/Storages/AlterCommands.cpp +++ b/src/Storages/AlterCommands.cpp @@ -81,6 +81,7 @@ namespace ErrorCodes extern const int NOT_IMPLEMENTED; extern const int ALTER_OF_COLUMN_IS_FORBIDDEN;...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -1477,15 +1489,102 @@ void AlterCommands::prepare(const StorageInMemoryMetadata & metadata, bool share if (!has_column && command.if_exists) command.ignore = true; + /// `ADD ENUM VALUES` derives the resulting type by merging against the existing column, so + ///...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/Storages/AlterCommands.cpp b/src/Storages/AlterCommands.cpp index 3863adc67515..387e0f5e55c2 100644 --- a/src/Storages/AlterCommands.cpp +++ b/src/Storages/AlterCommands.cpp @@ -81,6 +81,7 @@ namespace ErrorCodes extern const int NOT_IMPLEMENTED; extern const int ALTER_OF_COLUMN_IS_FORBIDDEN;...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -1477,9 +1491,124 @@ void AlterCommands::prepare(const StorageInMemoryMetadata & metadata, bool share if (!has_column && command.if_exists) command.ignore = true; + if (!command.ignore) + { + if (command.add_enum_values) + { + ...
bad
review
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
diff --git a/src/Storages/AlterCommands.cpp b/src/Storages/AlterCommands.cpp index 3863adc67515..387e0f5e55c2 100644 --- a/src/Storages/AlterCommands.cpp +++ b/src/Storages/AlterCommands.cpp @@ -81,6 +81,7 @@ namespace ErrorCodes extern const int NOT_IMPLEMENTED; extern const int ALTER_OF_COLUMN_IS_FORBIDDEN;...
good
review_fixed
cpp
ClickHouse/ClickHouse
07520f54fbc7a36adc637c461574cfc15b3a8c8e
@@ -343,7 +346,18 @@ DetachedPartInfo DetachedPartInfo::parseDetachedPartName( part_info.disk = disk; part_info.dir_name = dir_name; - /// First, try to find known prefix and parse dir_name as <prefix>_<part_name>. + /// First let's check if it ends with the "_tryN" suffix + if (const auto try_n_po...
bad
review
cpp
ClickHouse/ClickHouse
5a97c47f8cc44684f949f702e24274d41258eb00
diff --git a/src/Storages/MergeTree/MergeTreePartInfo.cpp b/src/Storages/MergeTree/MergeTreePartInfo.cpp index 346b4bb09d75..c41ab2b4fcc1 100644 --- a/src/Storages/MergeTree/MergeTreePartInfo.cpp +++ b/src/Storages/MergeTree/MergeTreePartInfo.cpp @@ -1,9 +1,12 @@ #include <Storages/MergeTree/MergeTreePartInfo.h> + +#i...
good
review_fixed
cpp
ClickHouse/ClickHouse
5a97c47f8cc44684f949f702e24274d41258eb00
@@ -343,7 +346,18 @@ DetachedPartInfo DetachedPartInfo::parseDetachedPartName( part_info.disk = disk; part_info.dir_name = dir_name; - /// First, try to find known prefix and parse dir_name as <prefix>_<part_name>. + /// First let's check if it ends with the "_tryN" suffix + if (const auto try_n_po...
bad
review
cpp
ClickHouse/ClickHouse
5a97c47f8cc44684f949f702e24274d41258eb00
diff --git a/src/Storages/MergeTree/MergeTreePartInfo.cpp b/src/Storages/MergeTree/MergeTreePartInfo.cpp index 346b4bb09d75..c41ab2b4fcc1 100644 --- a/src/Storages/MergeTree/MergeTreePartInfo.cpp +++ b/src/Storages/MergeTree/MergeTreePartInfo.cpp @@ -1,9 +1,12 @@ #include <Storages/MergeTree/MergeTreePartInfo.h> + +#i...
good
review_fixed
cpp
ClickHouse/ClickHouse
5a97c47f8cc44684f949f702e24274d41258eb00
@@ -0,0 +1,65 @@ +#!/usr/bin/env bash + +# Regression test for parsing detached part names with the _tryN suffix. +# The bug caused BAD_DATA_PART_NAME when trying to drop such parts. + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +# shellcheck source=../shell_config.sh +. "$CURDIR"/../shell_config.sh + +TABLE=...
bad
review
ClickHouse/ClickHouse
5a97c47f8cc44684f949f702e24274d41258eb00
diff --git a/tests/queries/0_stateless/04063_drop_detached_part_with_try_n_suffix.sh b/tests/queries/0_stateless/04063_drop_detached_part_with_try_n_suffix.sh new file mode 100755 index 000000000000..d233b70f1e30 --- /dev/null +++ b/tests/queries/0_stateless/04063_drop_detached_part_with_try_n_suffix.sh @@ -0,0 +1,130 ...
good
review_fixed
ClickHouse/ClickHouse
5a97c47f8cc44684f949f702e24274d41258eb00
@@ -343,7 +346,18 @@ DetachedPartInfo DetachedPartInfo::parseDetachedPartName( part_info.disk = disk; part_info.dir_name = dir_name; - /// First, try to find known prefix and parse dir_name as <prefix>_<part_name>. + /// First let's check if it ends with the "_tryN" suffix + if (const auto try_n_po...
bad
review
cpp
ClickHouse/ClickHouse
5a97c47f8cc44684f949f702e24274d41258eb00
diff --git a/src/Storages/MergeTree/MergeTreePartInfo.cpp b/src/Storages/MergeTree/MergeTreePartInfo.cpp index 346b4bb09d75..c41ab2b4fcc1 100644 --- a/src/Storages/MergeTree/MergeTreePartInfo.cpp +++ b/src/Storages/MergeTree/MergeTreePartInfo.cpp @@ -1,9 +1,12 @@ #include <Storages/MergeTree/MergeTreePartInfo.h> + +#i...
good
review_fixed
cpp
ClickHouse/ClickHouse
5a97c47f8cc44684f949f702e24274d41258eb00
@@ -183,6 +183,12 @@ struct DetachedPartInfo : public MergeTreePartInfo /// If false, MergeTreePartInfo is in invalid state (directory name was not successfully parsed). bool valid_name{}; + /// True if the directory name carried a "_tryN" suffix that was stripped before parsing. + /// Such directorie...
bad
review
c
ClickHouse/ClickHouse
5a97c47f8cc44684f949f702e24274d41258eb00
diff --git a/src/Storages/MergeTree/MergeTreePartInfo.h b/src/Storages/MergeTree/MergeTreePartInfo.h index 599093d820cc..f1ca8c0e2529 100644 --- a/src/Storages/MergeTree/MergeTreePartInfo.h +++ b/src/Storages/MergeTree/MergeTreePartInfo.h @@ -183,6 +183,12 @@ struct DetachedPartInfo : public MergeTreePartInfo /// ...
good
review_fixed
c
ClickHouse/ClickHouse
5a97c47f8cc44684f949f702e24274d41258eb00
@@ -548,6 +568,51 @@ def start(): test_result.set_failed() break + # Run additional build types for bugfix validation + if is_bugfix_validation: + for r in test_result.results: + r.set_label(BUGFIX_BUILD_TYPES[0]) + all_b...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -548,6 +568,51 @@ def start(): test_result.set_failed() break + # Run additional build types for bugfix validation + if is_bugfix_validation: + for r in test_result.results: + r.set_label(BUGFIX_BUILD_TYPES[0]) + all_b...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -548,6 +568,51 @@ def start(): test_result.set_failed() break + # Run additional build types for bugfix validation + if is_bugfix_validation: + for r in test_result.results: + r.set_label(BUGFIX_BUILD_TYPES[0]) + all_b...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -908,6 +922,53 @@ def main(): ) break + # Run additional build types for bugfix validation. + # Exit early on first failure to avoid duplicate test names and workspace pollution. + if is_bugfix_validation: + for r in test_results: + r.set_label(BUGFIX_BU...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -16,6 +16,23 @@ temp_dir = f"{Utils.cwd()}/ci/tmp" +BUGFIX_BUILD_TYPES = ["amd_asan", "amd_tsan", "amd_msan", "amd_ubsan", "amd_debug"] + + +def find_master_builds(): + """Find S3 URLs for all 5 build types from a recent master commit.""" + commits = Info().get_kv_data("master_commits") or [] + for sha...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -21,6 +21,24 @@ repo_dir = Utils.cwd() temp_path = f"{repo_dir}/ci/tmp" + + +BUGFIX_BUILD_TYPES = ["amd_asan", "amd_tsan", "amd_msan", "amd_ubsan", "amd_debug"] + + +def find_master_builds(): + """Find S3 URLs for all 5 build types from a recent master commit.""" + commits = Info().get_kv_data("master_comm...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -561,16 +589,146 @@ def start(): f" remaining: {global_time_limit}s)" ) - run_tests( - batch_num=batch_num if not tests else 0, - batch_total=total_batches if not tests else 0, - tests=tests, - extra_args=runner_options, - ...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -561,16 +589,146 @@ def start(): f" remaining: {global_time_limit}s)" ) - run_tests( - batch_num=batch_num if not tests else 0, - batch_total=total_batches if not tests else 0, - tests=tests, - extra_args=runner_options, - ...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -623,6 +651,60 @@ def start(): test_result = ft_res_processor.run() + # Run additional build types for bugfix validation. + # Exit early on first failure to avoid duplicate test names, + # workspace pollution, and to preserve logs for analysis. + # Fatal message checking (CHE...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -295,14 +318,19 @@ def main(): if is_bugfix_validation: os.environ["GLOBAL_TAGS"] = "no-random-settings" ch_path = temp_dir - if not info.is_local_run or not (Path(temp_dir) / "clickhouse").is_file(): - link_arch = "aarch64" if Utils.is_arm() else "amd64" - link_to...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -678,21 +702,17 @@ def main(): ) if is_bugfix_validation: - if Utils.is_arm(): - link_to_master_head_binary = "https://clickhouse-builds.s3.us-east-1.amazonaws.com/master/aarch64/clickhouse" - else: - link_to_master_head_binary = "https://clickhouse...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -940,6 +973,61 @@ def main(): ) break + # Run additional build types for bugfix validation. + # Exit early on first failure to avoid duplicate test names and workspace pollution. + if is_bugfix_validation: + for r in test_results: + r.set_label(BUGFIX_BU...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -752,7 +849,9 @@ def start(): has_failure = False for r in test_result.results: r.set_label(Result.Label.XFAIL) - if r.status == Result.Status.FAIL: + if r.status in (Result.Status.FAIL, Result.Status.ERROR):
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -1059,7 +1149,9 @@ def main(): for r in R.results: # invert statuses r.set_label(Result.Label.XFAIL) - if r.status == Result.Status.FAIL: + if r.status in (Result.Status.FAIL, Result.Status.ERROR):
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -597,6 +638,63 @@ def start(): test_result = ft_res_processor.run(runner_exit_code=runner_exit_code) + # Run additional build types for bugfix validation. + # Exit early on first failure to avoid duplicate test names, + # workspace pollution, and to preserve logs for analysis. + ...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -752,6 +857,13 @@ def start(): has_failure = False for r in test_result.results: r.set_label(Result.Label.XFAIL) + # Invert only explicit reproduction signals (`FAIL`). + # Crashes are reported as a separate `Server died` / fatal-message + # entry with ...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -749,22 +861,40 @@ def start(): # invert result status for bugfix validation if is_bugfix_validation and test_result and (Labels.PR_BUGFIX in info.pr_labels or Labels.PR_CRITICAL_BUGFIX in info.pr_labels): - has_failure = False - for r in test_result.results: - r.set_label(Result...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -17,6 +17,29 @@ temp_dir = f"{Utils.cwd()}/ci/tmp" +BUGFIX_BUILD_TYPES = ["amd_asan_ubsan", "amd_tsan", "amd_msan", "amd_debug"] + + +def find_master_builds(): + """Find S3 URLs for all build types from a recent master commit. + + Verifies that artifacts for every entry in BUGFIX_BUILD_TYPES exist + be...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -295,14 +318,32 @@ def main(): if is_bugfix_validation: os.environ["GLOBAL_TAGS"] = "no-random-settings" ch_path = temp_dir - if not info.is_local_run or not (Path(temp_dir) / "clickhouse").is_file(): - link_arch = "aarch64" if Utils.is_arm() else "amd64" - link_to...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -334,14 +348,33 @@ def main(): if is_bugfix_validation: os.environ["GLOBAL_TAGS"] = "no-random-settings" ch_path = temp_dir - if not info.is_local_run or not (Path(temp_dir) / "clickhouse").is_file(): - link_arch = "aarch64" if Utils.is_arm() else "amd64" - link_to...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -640,6 +673,78 @@ def start(): test_result = ft_res_processor.run(runner_exit_code=runner_exit_code) + # Run additional build types for bugfix validation. + # Exit early on first failure to avoid duplicate test names, + # workspace pollution, and to preserve logs for analysis. + ...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -0,0 +1,23 @@ +from ci.praktika.info import Info +from ci.praktika.utils import Shell + +BUGFIX_BUILD_TYPES = ["amd_asan_ubsan", "amd_tsan", "amd_msan", "amd_debug"] + + +def find_master_builds():
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/scripts/bugfix_validation.py b/ci/jobs/scripts/bugfix_validation.py new file mode 100644 index 000000000000..eb5dd1f612b7 --- /dev/null +++ b/ci/jobs/scripts/bugfix_validation.py @@ -0,0 +1,23 @@ +from ci.praktika.info import Info +from ci.praktika.utils import Shell + +BUGFIX_BUILD_TYPES = ["amd_a...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -653,10 +692,89 @@ def start(): random_order=is_bugfix_validation, rerun_count=rerun_count, global_time_limit=global_time_limit, + build_type=BUGFIX_BUILD_TYPES[0] if is_bugfix_validation else None, ) test_result = ft_res_proce...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -653,10 +692,105 @@ def start(): random_order=is_bugfix_validation, rerun_count=rerun_count, global_time_limit=global_time_limit, + build_type=BUGFIX_BUILD_TYPES[0] if is_bugfix_validation else None, ) test_result = ft_res_proc...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032