Backport #69895 to 24.8: Fix analyzer default with old compatibility value

This commit is contained in:
robot-clickhouse 2024-09-26 13:13:54 +00:00
parent 394506429a
commit e21ed67c13
3 changed files with 22 additions and 3 deletions

View File

@ -153,12 +153,15 @@ void Settings::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;