Parameters
| Name | Type | Mode |
|---|---|---|
| in_variable_name | varchar(128) | IN |
| in_default_value | varchar(128) | IN |
Returns the value for the requested variable using the following logic:
Notes for using sys_get_config():
in_variable_name (VARCHAR(128)): The name of the config option to return the value for.
in_default_value (VARCHAR(128)): The default value to return if the variable does not exist in sys.sys_config.
VARCHAR(128)
– Get the configuration value from sys.sys_config falling back on 128 if the option is not present in the table. mysql> SELECT sys.sys_get_config(‘statement_truncate_len’, 128) AS Value; +——-+ | Value | +——-+ | 64 | +——-+ 1 row in set (0.00 sec)
– Check whether the option is already set, if not assign - IFNULL(…) one liner example. mysql> SET @sys.statement_truncate_len = IFNULL(@sys.statement_truncate_len, sys.sys_get_config(‘statement_truncate_len’, 64)); Query OK, 0 rows affected (0.00 sec)
– Check whether the option is already set, if not assign - IF … THEN … END IF example. IF (@sys.statement_truncate_len IS NULL) THEN SET @sys.statement_truncate_len = sys.sys_get_config(‘statement_truncate_len’, 64); END IF;
| Name | Type | Mode |
|---|---|---|
| in_variable_name | varchar(128) | IN |
| in_default_value | varchar(128) | IN |