Repository navigation
Revert "Revert "Revert "Fix SettingsConstraints erasing explicit settings before compatibility applies""" - #99352
Conversation
…ttings before compatibility applies"""
|
Workflow [PR], commit [170410e] Summary: ⏳
AI ReviewSummaryThis PR reverts the recent fix in Missing context
Findings❌ Blockers
Tests
ClickHouse Rules
Final Verdict
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| std::erase_if(changes, [&](SettingChange & change) { return !checkImpl(current_settings, change, THROW_ON_VIOLATION, source); }); | ||
| else | ||
| for (auto & change : changes) | ||
| checkImpl(current_settings, change, THROW_ON_VIOLATION, source); |
There was a problem hiding this comment.
Compatibility setting silently overrides explicit user settings
High Severity
This revert removes the guard that prevented compatibility from silently overriding explicit user settings. getNewValueToCheck returns false when a setting's new value matches the current value, causing std::erase_if to remove it from the changes list. When compatibility is also in the batch, it later changes defaults, and the erased explicit setting is lost. The removed code correctly skipped erasure when compatibility was present, preserving user intent.
| [&](SettingChange & change) -> bool | ||
| { | ||
| return !checkImpl(current_settings, change, THROW_ON_VIOLATION, source); | ||
| }); |
There was a problem hiding this comment.
Reintroducing unconditional std::erase_if here drops explicit settings whose value initially matches current settings; when compatibility is also present in the same batch, compatibility defaults are applied later and can silently override the explicit user value. Please keep the compatibility special-case (or an equivalent two-phase application) so explicit settings are preserved.
| [&](SettingChange & change) -> bool | ||
| { | ||
| return !checkImpl(current_settings, change, THROW_ON_VIOLATION, source); | ||
| }); |
There was a problem hiding this comment.
Reintroducing unconditional std::erase_if here drops explicit settings whose value initially matches current settings; when compatibility is also present in the same batch, compatibility defaults are applied later and can silently override the explicit user value. Please keep the compatibility special-case (or an equivalent two-phase application) so explicit settings are preserved.
| @@ -1,10 +0,0 @@ | |||
| -- compatibility alone reverts to 0 | |||
| 0 | |||
| -- explicit =1 with compatibility=24.12 (compat first in URL) | |||
There was a problem hiding this comment.
Removing this regression test drops coverage for the compatibility + explicit-setting precedence behavior that this file documents. Please keep this test (or add an equivalent replacement) so this edge case stays protected.
There was a problem hiding this comment.
Thanks! I will take a look tomorrow why NOT_FOUND_COLUMN_IN_BLOCK that you describe here happens. My current suspicion is that we did something different in older CH version. But before this change, compatibility settings were silently ignored in stress tests. Now they aren't, we get an error
…cit settings before compatibility applies"""" #99352


Reverts #99311
Closes #99347
Closes #98605
Note
Medium Risk
Changes how
SettingsConstraints::checkfiltersSettingsChangesby again dropping unchanged settings even whencompatibilityis set, which can affect which explicit settings ultimately apply. Removes the regression test that covered this edge case, increasing the chance of behavior changes going unnoticed.Overview
Reverts the special-case in
SettingsConstraints::check(SettingsChanges&)that kept settings in the batch whencompatibilitywas present; the method now alwayserase_ifunchanged/unchecked settings.Deletes the stateless test (
03916_check_settings_constraints_erases_with_compatibility) that asserted explicit settings are preserved whencompatibilityis provided in the same request.Written by Cursor Bugbot for commit 170410e. This will update automatically on new commits. Configure here.
Version info
26.3.1.627