Merge pull request #70021 from ClickHouse/backport/24.9/69895

Backport #69895 to 24.9: Fix analyzer default with old compatibility value
This commit is contained in:
robot-ch-test-poll 2024-09-26 18:27:20 +02:00 committed by GitHub
commit c9f438a336
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 3 deletions

View File

@ -1247,12 +1247,15 @@ void SettingsImpl::applyCompatibilitySetting(const String & compatibility_value)
/// Apply reversed changes from this version.
for (const auto & change : it->second)
{
/// In case the alias is being used (e.g. use enable_analyzer) we must change the original setting
auto final_name = SettingsTraits::resolveName(change.name);
/// If this setting was changed manually, we don't change it
if (isChanged(change.name) && !settings_changed_by_compatibility_setting.contains(change.name))
if (isChanged(final_name) && !settings_changed_by_compatibility_setting.contains(final_name))
continue;
BaseSettings::set(change.name, change.previous_value);
settings_changed_by_compatibility_setting.insert(change.name);
BaseSettings::set(final_name, change.previous_value);
settings_changed_by_compatibility_setting.insert(final_name);
}
}
}

View File

@ -0,0 +1,8 @@
allow_experimental_analyzer 1 0
enable_analyzer 1 0
allow_experimental_analyzer 1 0
enable_analyzer 1 0
allow_experimental_analyzer 1 1
enable_analyzer 1 1
allow_experimental_analyzer 0 1
enable_analyzer 0 1

View File

@ -0,0 +1,8 @@
SET enable_analyzer = DEFAULT;
SELECT name, value, changed from system.settings where name IN ('allow_experimental_analyzer', 'enable_analyzer') ORDER BY name;
SET compatibility = '24.8';
SELECT name, value, changed from system.settings where name IN ('allow_experimental_analyzer', 'enable_analyzer') ORDER BY name;
SET compatibility = '24.3';
SELECT name, value, changed from system.settings where name IN ('allow_experimental_analyzer', 'enable_analyzer') ORDER BY name;
SET compatibility = '24.1';
SELECT name, value, changed from system.settings where name IN ('allow_experimental_analyzer', 'enable_analyzer') ORDER BY name;