[MDEV-31109] Parameters that can't be set from server command-line (and inconsistent documentation thereof) Created: 2023-04-21 Updated: 2023-05-27 Resolved: 2023-05-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Lenski | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Documentation, SkySQL | ||
| Issue Links: |
|
||||||||
| Description |
|
According to the mariadb.com reference guide to system variables, it should be possible to set the system variable check_constraint_checks via the command-line ("--check-constraint-checks=VALUE"). However, according to another page (https://mariadb.com/docs/skysql-new-release-dbaas/ref/mdb/system-variables/check_constraint_checks), this parameter cannot be set via command-line option or config file, but only via SET [GLOBAL|SESSION] at runtime:
Testing (with MariaDB 10.6.12)shows that the parameter cannot be set from command-line or config-file:
Few questions...
|
| Comments |
| Comment by Daniel Lenski [ 2023-04-21 ] | |||||||||||||||||||||||||||||||||||||||||||
|
We've attempted to use the metadata in INFORMATION_SCHEMA.SYSTEM_VARIABLES as a reliable indicator of whether or not a system variable can be set from config-file or CLI options… Per https://mariadb.com/kb/en/information-schema-system_variables-table, if INFORMATION_SCHEMA.SYSTEM_VARIABLES.COMMAND_LINE_ARGUMENT is NULL then a variable cannot be set via CLI:
However, this too appears to be inaccurate: according to I_S.S_V, DEFAULT_STORAGE_ENGINE cannot be set via CLI:
… but this is clearly wrong, because mariadbd does accept --default_storage_engine as a command-line argument:
… and then correctly reflects the value set from the CLI via I_S.S_V:
| |||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lenski [ 2023-04-21 ] | |||||||||||||||||||||||||||||||||||||||||||
|
What is, or should be, the single source of truth for metadata on system variables? I thought it might ultimately lie in sys_vars.cc, but there too I find that DEFAULT_STORAGE_ENGINE is marked as NO_CMD_LINE… which is clearly wrong. | |||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2023-04-21 ] | |||||||||||||||||||||||||||||||||||||||||||
|
NO_CMD_LINE means that there is no automatic --command-line-option from a sysvar. But there might be a separately created command line option with some special code to handle its values, sysvar subsystem wouldn't know anything about it. This is the case here, the option is defined in https://github.com/MariaDB/server/blob/mariadb-10.6.12/sql/mysqld.cc#L6442 | |||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2023-04-21 ] | |||||||||||||||||||||||||||||||||||||||||||
|
This is because my_getopt can only handle basic types, but not plugins, and default_storage_engine is Sys_var_plugin. This can be fixed, of course, but it's a rather minor issue priority-wise. | |||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lenski [ 2023-04-24 ] | |||||||||||||||||||||||||||||||||||||||||||
Got it, thanks.
As I show in the description, the behavior of system variables is already unnecessarily complex (some global variables don't have command-line or config options… still unsure why not) and the metadata is stored in a sufficiently inconsistent way that there is no internal consistency in the documentation. This makes it difficult and error-prone to run MariaDB as a managed service, since there are regular surprises and complications in the interfaces to the system variables. This also makes it difficult to test setting system via different interfaces in a consistent way. | |||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2023-05-27 ] | |||||||||||||||||||||||||||||||||||||||||||
|
KB entry for check_constraints is fixed |