Repository navigation
feat(admin): edit a server variable in place - #623
Merged
Merged
Conversation
FR-7.2.2 asks for inline editing of settable variables and a description for each. Values were read-only text and there were no descriptions, so changing a variable meant leaving the panel (#438). The issue names performance_schema.variables_info as the source for descriptions. It is not one: on MySQL 8.0.46 that table carries where a value came from and its bounds, and no prose at all. MySQL does not expose variable documentation over SQL. MariaDB does, in information_schema.SYSTEM_VARIABLES.VARIABLE_COMMENT, along with READ_ONLY. So descriptions appear on MariaDB and are absent on MySQL rather than invented, and the read-only flag is used to disable editing where the server reports it. On MySQL there is nothing to check first — it reports read-only only by failing the SET with 1238 — so the attempt is made and the refusal is surfaced. Scope is a choice, and the dialog is explicit about what each one means. SET GLOBAL does not survive a restart, which is the thing people are surprised by, so choosing it says so. SET PERSIST does, and is MySQL's alone: MariaDB rejects it outright, so it is not offered there rather than offered and then failing. Verified on both. SET GLOBAL, SET PERSIST and SET PERSIST_ONLY are now destructive statements for the production gate. `SET GLOBAL max_connections = 1` takes a server down as surely as a DROP, and it is one keystroke away from a session-scoped change that is harmless. SET SESSION is deliberately not gated: it reaches only the connection that issued it, and prompting for ordinary work trains people to dismiss the dialog. This covers the editor as well as this panel. ServerVariable is camelCase over the wire now, matching every other type crossing the boundary. `name` and `value` are unaffected. One label was renamed: the scope select and the button were both called "Apply", which is ambiguous for anyone not reading the layout. Closes #438 Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #438.
Values were read-only text with no descriptions, so changing a variable meant leaving the panel.
The issue names a source that doesn't have descriptions
It says descriptions come from
performance_schema.variables_info. On MySQL 8.0.46 that table carriesVARIABLE_SOURCE,MIN_VALUE,MAX_VALUE,SET_TIME,SET_USER— and no prose at all. MySQL doesn't expose variable documentation over SQL.MariaDB does, in
information_schema.SYSTEM_VARIABLES.VARIABLE_COMMENT, along withREAD_ONLY.So descriptions appear on MariaDB and are absent on MySQL rather than invented. Read-only disables editing where the server reports it; on MySQL there's nothing to check first — it reports read-only only by failing the
SETwith 1238 — so the attempt is made and the refusal surfaced.Scope is explicit about what it means
SET GLOBALSET SESSIONSET GLOBAL version='9'SET PERSISTSET GLOBALdoesn't survive a restart — the thing people are surprised by — so choosing it says so.SET PERSISTdoes, and is MySQL's alone, so it isn't offered on MariaDB rather than offered and then failing; MariaDB users are pointed at the config file instead.SET GLOBALis now a destructive statementSET GLOBAL max_connections = 1takes a production server down as surely as aDROP, and it's one keystroke from a session-scoped change that's harmless. Now gated — in the editor as well as this panel.SET SESSIONdeliberately isn't: it reaches only the connection that issued it, and prompting for ordinary work trains people to dismiss the dialog.Also
ServerVariableis camelCase over the wire now, matching every other boundary type. One label renamed: the scope select and the button were both "Apply".Verification
12 builder tests, 12 dialog tests, 5 safety tests. Unit 2199, browser 297, Rust + clippy clean.