Repository: ClickHouse/ClickHouse
File: src/Core/SettingsChangesHistory.cpp (C++)

Code before:
    /// Forbid duplicate versions
    auto [_, inserted] = settings_changes_history.emplace(ClickHouseVersion(version), std::move(changes));
    if (!inserted)
        throw Exception{ErrorCodes::LOGICAL_ERROR, "Detected duplicate version '{}'", ClickHouseVersion(version).toString()};
}

const VersionToSettingsChangesMap & getSettingsChangesHistory()
{
    static VersionToSettingsChangesMap settings_changes_history;
    static std::once_flag initialized_flag;
    std::call_once(initialized_flag, [&]
    {
        // clang-format off
        /// History of settings changes that controls some backward incompatible changes
        /// across all ClickHouse versions. It maps ClickHouse version to settings changes that were done
        /// in this version. This history contains both changes to existing settings and newly added settings.
        /// Settings changes is a vector of structs
        ///     {setting_name, previous_value, new_value, reason}.
        /// For newly added setting choose the most appropriate previous_value (for example, if new setting
        /// controls new feature and it's 'true' by default, use 'false' as previous_value).
        /// It's used to implement `compatibility` setting (see https://github.com/ClickHouse/ClickHouse/issues/35972)
        /// Note: please check if the key already exists to prevent duplicate entries.
        addSettingsChanges(settings_changes_history, "26.3",
        {
            {"allow_calculating_subcolumns_sizes_for_merge_tree_reading", false, true, "Allow calculating subcolumns sizes for merge tree reading to improve read tasks splitting"},
            {"use_partition_pruning", true, true, "New setting controlling whether MergeTree uses partition key for pruning."},
            {"use_partition_key", true, true, "Alias for setting 'use_partition_pruning'."},
        });
        addSettingsChanges(settings_changes_history, "26.2",
        {
            {"allow_fuzz_query_functions", false, false, "New setting to enable the fuzzQuery function."},
            {"ast_fuzzer_runs", 0, 0, "New setting to enable server-side AST fuzzer."},
            {"ast_fuzzer_any_query", false, false, "New setting to allow fuzzing all query types, not just read-only."},
            {"check_named_collection_dependencies", true, true, "New setting to check if dropping a named collection would break dependent tables."},
            {"deduplicate_blocks_in_dependent_materialized_views", false, true, "Enable deduplication for dependent materialized views by default."},
            {"deduplicate_insert", "backward_compatible_choice", "enable", "Enable deduplication for all sync and async inserts by default."},
            {"deduplicate_insert", "backward_compatible_choice", "backward_compatible_choice", "New setting to control deduplication for INSERT queries."},
            {"enable_join_runtime_filters", false, true, "Enabled this optimization"},
            {"parallel_replicas_filter_pushdown", false, false, "New setting"},
            {"optimize_dry_run_check_part", true, true, "New setting"},
            {"parallel_non_joined_rows_processing", true, true, "New setting to enable parallel processing of non-joined rows in RIGHT/FULL parallel_hash joins."},
            {"enable_automatic_decision_for_merging_across_partitions_for_final", true, true, "New setting"},
            {"enable_full_text_index", false, true, "The text index is now GA"},
            {"allow_experimental_full_text_index", false, true, "The text index is now GA"},
            {"use_page_cache_for_local_disks", false, false, "New setting to use userspace page cache for local disks"},
            {"use_page_cache_for_object_storage", false, false, "New setting to use userspace page cache for object storage table functions"},
            {"use_statistics_cache", false, true, "Enable statistics cache"},
            {"apply_row_policy_after_final", false, true, "Enabling apply_row_policy_after_final by default, as if was in 25.8 before #87303"},
            {"ignore_format_null_for_explain", false, true, "FORMAT Null is now ignored for EXPLAIN queries by default"},
            {"input_format_connection_handling", false, false, "New setting to allow parsing and processing remaining data in the buffer if the connection closes unexpectedly"},
            {"input_format_max_block_wait_ms", 0, 0, "New setting to limit maximum wait time in milliseconds before a block is emitted by input format"},

Review comment (suggestion):
...for pruning. `use_partition_key` is an alias for this setting.(refer to use_statistics)

Code after:
    /// Forbid duplicate versions
    auto [_, inserted] = settings_changes_history.emplace(ClickHouseVersion(version), std::move(changes));
    if (!inserted)
        throw Exception{ErrorCodes::LOGICAL_ERROR, "Detected duplicate version '{}'", ClickHouseVersion(version).toString()};
}

const VersionToSettingsChangesMap & getSettingsChangesHistory()
{
    static VersionToSettingsChangesMap settings_changes_history;
    static std::once_flag initialized_flag;
    std::call_once(initialized_flag, [&]
    {
        // clang-format off
        /// History of settings changes that controls some backward incompatible changes
        /// across all ClickHouse versions. It maps ClickHouse version to settings changes that were done
        /// in this version. This history contains both changes to existing settings and newly added settings.
        /// Settings changes is a vector of structs
        ///     {setting_name, previous_value, new_value, reason}.
        /// For newly added setting choose the most appropriate previous_value (for example, if new setting
        /// controls new feature and it's 'true' by default, use 'false' as previous_value).
        /// It's used to implement `compatibility` setting (see https://github.com/ClickHouse/ClickHouse/issues/35972)
        /// Note: please check if the key already exists to prevent duplicate entries.
        addSettingsChanges(settings_changes_history, "26.3",
        {
            {"allow_calculating_subcolumns_sizes_for_merge_tree_reading", false, true, "Allow calculating subcolumns sizes for merge tree reading to improve read tasks splitting"},
            {"use_partition_pruning", true, true, "New setting controlling whether MergeTree uses partition key for pruning. 'use_partition_key' is an alias for this setting."},
            {"use_partition_key", true, true, "Alias for setting 'use_partition_pruning'."},
        });
        addSettingsChanges(settings_changes_history, "26.2",
        {
            {"allow_fuzz_query_functions", false, false, "New setting to enable the fuzzQuery function."},
            {"ast_fuzzer_runs", 0, 0, "New setting to enable server-side AST fuzzer."},
            {"ast_fuzzer_any_query", false, false, "New setting to allow fuzzing all query types, not just read-only."},
            {"check_named_collection_dependencies", true, true, "New setting to check if dropping a named collection would break dependent tables."},
            {"deduplicate_blocks_in_dependent_materialized_views", false, true, "Enable deduplication for dependent materialized views by default."},
            {"deduplicate_insert", "backward_compatible_choice", "enable", "Enable deduplication for all sync and async inserts by default."},
            {"deduplicate_insert", "backward_compatible_choice", "backward_compatible_choice", "New setting to control deduplication for INSERT queries."},
            {"enable_join_runtime_filters", false, true, "Enabled this optimization"},
            {"parallel_replicas_filter_pushdown", false, false, "New setting"},
            {"optimize_dry_run_check_part", true, true, "New setting"},
            {"parallel_non_joined_rows_processing", true, true, "New setting to enable parallel processing of non-joined rows in RIGHT/FULL parallel_hash joins."},
            {"enable_automatic_decision_for_merging_across_partitions_for_final", true, true, "New setting"},
            {"enable_full_text_index", false, true, "The text index is now GA"},
            {"allow_experimental_full_text_index", false, true, "The text index is now GA"},
            {"use_page_cache_for_local_disks", false, false, "New setting to use userspace page cache for local disks"},
            {"use_page_cache_for_object_storage", false, false, "New setting to use userspace page cache for object storage table functions"},
            {"use_statistics_cache", false, true, "Enable statistics cache"},
            {"apply_row_policy_after_final", false, true, "Enabling apply_row_policy_after_final by default, as if was in 25.8 before #87303"},
            {"ignore_format_null_for_explain", false, true, "FORMAT Null is now ignored for EXPLAIN queries by default"},
            {"input_format_connection_handling", false, false, "New setting to allow parsing and processing remaining data in the buffer if the connection closes unexpectedly"},
            {"input_format_max_block_wait_ms", 0, 0, "New setting to limit maximum wait time in milliseconds before a block is emitted by input format"},