Repository navigation
Add ALTER USER/ROLE/SETTINGS PROFILE ... SET as an alias for MODIFY SETTING - #108722
Conversation
…ETTING SET <setting> = <value> now modifies a single profile setting in place, exactly like MODIFY SETTING, instead of replacing the whole settings list like the bare SETTINGS clause does. Implemented in the shared ParserAlterSettingsProfileElements by mapping SET to action=MODIFY, target=SETTINGS, so it produces the same modify_settings AST and reuses all existing interpreter and formatter logic (the formatter canonicalizes SET back to MODIFY SETTING). No AST or interpreter changes are needed, and the new syntax is purely additive. The motivation is the common footgun where users type SETTINGS (which replaces the list) when they meant MODIFY SETTING (which edits one entry). Closes: ClickHouse#108717 Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-2:20260627-233800 |
|
cc @vitlibar @pufit — could you review this? It adds |
|
Workflow [PR], commit [a536ae3] Summary: ✅
AI ReviewSummaryThis PR adds Missing context / blind spots
Final Verdict✅ Approve |
CI finish ledger — 6ec4e24Every failure below has an owner: a fixing PR (ours or external). Only
Session id: cron:our-pr-ci-monitor:20260628-060000 |
…y_setting.sh The test only exercises ordinary access-control DDL (CREATE/ALTER/DROP USER/ROLE/SETTINGS PROFILE), SHOW CREATE and formatQuery, all core features present in every build including Fast test. The sibling 02943_alter_user_modify_settings.sh covers the same path without the tag, so there is no concrete fasttest-only dependency. Co-Authored-By: Claude Opus 4.8 <[email protected]>
CI finish ledger — 3286c6cEvery failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only This PR is a 6-line
Session id: cron:our-pr-ci-monitor:20260629-060000 |
…-set-modify-setting-108717
|
Merged the latest Both reds on the previous run are pre-existing trunk bugs unrelated to this parser-only change, and each had a fixing PR:
Status: approved by @alexey-milovidov (LGTM) and the AI review (✅ Approve), with no unresolved review threads. Waiting on a fresh CI run. |
CI status —
|
| Check / test | Reason | Owner / fixing PR |
|---|---|---|
Unit tests (msan, function_prop_fuzzer) / FunctionsStress.stress (+ AllTests) |
trunk bug — reinterpret(x, 'Decimal256(69)') over a same-physical-type Decimal(76, 22) source returns a column whose internal scale is the source scale, so the stress harness reports function returned column of unexpected type or scale: Decimal256 instead of Decimal(76, 69). Values are correct; the column object is structurally inconsistent with its declared type. A parser alias for ALTER USER ... SET cannot reach this code path. |
#108878 (ours, open) |
Evidence this is master-wide and not caused by this PR: the function_prop_fuzzer "unexpected type or scale" failure first appeared on 2026-06-30 and hit 20 distinct PRs that day (all base_ref = master), including this one. The fix is already in progress in #108878 ("Fix reinterpret to Decimal/DateTime64 with a different scale").
Did not re-merge master: the branch is only 6 commits behind (the master merge above was this morning), and #108878 is not yet in master, so a re-merge would not clear this red — it would only churn the in-flight CI. Waiting on the fresh run to finish and on #108878 to land.
…-set-modify-setting-108717
|
Re-merged The only real CI red on the previous head was Still approved (LGTM) with an AI-review approve and 0 unresolved threads. |
The `ALTER USER` / `ALTER ROLE` docs warned that the bare `SETTINGS` clause "replaces the whole settings list", but in `ParserAlterSettingsProfileElements::parseImpl` the old-style `SETTINGS` path sets both `drop_all_settings` and `drop_all_profiles`, so it also removes all inherited (parent) profiles, not just sibling settings. Correct both warnings to mention parent-profile removal, mirroring the already-accurate wording in `alter/settings-profile.md`. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Addressed the AI review's Request changes minimum-required-action ( The finding was correct: the |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 6/6 (100.00%) · Uncovered code |
20e5f3d
…r-set-modify-setting-108717 Add ALTER USER/ROLE/SETTINGS PROFILE ... SET as an alias for MODIFY SETTING
Closes: #108717
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
ALTER USER,ALTER ROLEandALTER SETTINGS PROFILEnow acceptSET name = valueas an alias forMODIFY SETTING name = value. It changes individual settings in place while keeping the rest, unlike the bareSETTINGSclause which replaces the whole settings list. This makes it less likely to accidentally wipe a user's other settings.Description
Implements #108717 (requested by @alexey-milovidov).
SET <setting> = <value>is added as an alias forMODIFY SETTING <setting> = <value>onALTER USER,ALTER ROLEandALTER SETTINGS PROFILE. It modifies a single setting in place (keeping the other settings and parent profiles), in contrast to the bareSETTINGSclause which replaces the entire settings list. The motivation in the issue is the common footgun of typingSETTINGS(replace) whenMODIFY SETTING(in-place edit) was intended.Implementation: a single branch in the shared
ParserAlterSettingsProfileElementsmaps theSETkeyword toaction = MODIFY,target = SETTINGS, so it produces the exact samemodify_settingsAST asMODIFY SETTING. All existing interpreter and formatter logic is reused unchanged; the formatter canonicalizesSETback toMODIFY SETTING. The change is purely additive (no setting defaults, on-disk or wire formats changed), so it is fully backward compatible. TheSETTING/SETTINGSkeywords are unaffected (word-boundary keyword matching), andSETcomposes withADD/DROPin a single statement.Examples:
Added stateless test
04365_alter_user_set_as_modify_setting(covers USER/ROLE/PROFILE, multiple settings, MIN/MAX/constraints, equivalence withMODIFY SETTING, and parser round-trip) and updated theALTER USER/ALTER ROLE/ALTER SETTINGS PROFILEdocs.Version info
26.7.1.416(included in26.7and later)