Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
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:
check_constraint_checks
|
|
See also: System Variables for MariaDB Enterprise Server 10.6, in 10.5 ES, and in 10.4 ES
|
|
PARAMETERS
|
|
Command-line: Not Supported
|
Configuration file: Not Supported
|
Dynamic: Yes
|
Scope: Global, Session
|
Data Type: BOOLEAN (OFF, ON)
|
Product Default Value: ON
|
Testing (with MariaDB 10.6.12)shows that the parameter cannot be set from command-line or config-file:
[Note] InnoDB: File '/DATAPATH/db/innodb/ibtmp1' size is now 12 MB.
|
[Note] InnoDB: 10.6.12 started; log sequence number $SEQ; transaction id $TID
|
[ERROR] /ENGINEPATH/mysql/bin/mysqld: unknown variable 'check_constraint_checks=1'
|
Few questions...
- How did we end up with the "SkySQL" docs correct, but the knowledge base reference is incorrect?
- Why are some (global) system variables not settable via CLI/config-file?
- This certainly does not simplify the end users' interface or expectations for configuring the engine.
- Is there some internal benefit, perhaps in terms of simplifying code structure, to not allowing these variables to be set via CLI/config-file?
Attachments
Issue Links
- relates to
-
MDEV-30228 For system variables defined NO_CMD_LINE that have manually-defined configuration options, information_schema.SYSTEM_VARIABLES is incorrect
-
- Confirmed
-
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:
COMMAND_LINE_ARGUMENT Whether an argument is required when setting the variable on the command line. NULL when a variable can not be set on the command line.
However, this too appears to be inaccurate: according to I_S.S_V, DEFAULT_STORAGE_ENGINE cannot be set via CLI:
MariaDB [(none)]> select * from information_schema.system_variables where variable_name='DEFAULT_STORAGE_ENGINE'\G
*************************** 1. row ***************************
VARIABLE_NAME: DEFAULT_STORAGE_ENGINE
SESSION_VALUE: InnoDB
GLOBAL_VALUE: InnoDB
GLOBAL_VALUE_ORIGIN: COMPILE-TIME
DEFAULT_VALUE: InnoDB
VARIABLE_SCOPE: SESSION
VARIABLE_TYPE: VARCHAR
VARIABLE_COMMENT: The default storage engine for new tables
NUMERIC_MIN_VALUE: NULL
NUMERIC_MAX_VALUE: NULL
NUMERIC_BLOCK_SIZE: NULL
ENUM_VALUE_LIST: NULL
READ_ONLY: NO
COMMAND_LINE_ARGUMENT: NULL
GLOBAL_VALUE_PATH: NULL
1 row in set (0.003 sec)
… but this is clearly wrong, because mariadbd does accept --default_storage_engine as a command-line argument:
% build/bin/mariadbd --no-defaults --socket=$DDIR/mysql.sock \
--datadir=$DDIR/data --skip-grant-tables --skip-networking \
--default_storage_engine=Aria
2023-04-21 11:39:47 0 [Note] Starting MariaDB 10.6.12-MariaDB source revision $COMMIT as process $PID
2023-04-21 11:39:47 0 [Note] build/bin/mariadbd: ready for connections.
Version: '10.6.12-MariaDB' socket: '$DDIR/mysql.sock' port: 0 managed by https://aws.amazon.com/rds/
… and then correctly reflects the value set from the CLI via I_S.S_V:
MariaDB [(none)]> select * from information_schema.system_variables where variable_name='DEFAULT_STORAGE_ENGINE'\G
*************************** 1. row ***************************
VARIABLE_NAME: DEFAULT_STORAGE_ENGINE
SESSION_VALUE: Aria
GLOBAL_VALUE: Aria
GLOBAL_VALUE_ORIGIN: COMPILE-TIME
DEFAULT_VALUE: Aria
VARIABLE_SCOPE: SESSION
VARIABLE_TYPE: VARCHAR
VARIABLE_COMMENT: The default storage engine for new tables
NUMERIC_MIN_VALUE: NULL
NUMERIC_MAX_VALUE: NULL
NUMERIC_BLOCK_SIZE: NULL
ENUM_VALUE_LIST: NULL
READ_ONLY: NO
COMMAND_LINE_ARGUMENT: NULL
GLOBAL_VALUE_PATH: NULL
1 row in set (0.001 sec)