One-liner example: Check whether the option is already set; if not, assign the  IFNULL(...)  result (using the value from the  sys_config  table): IF (...) THEN ... END IF;  block example: Check whether the option is already set; if not, assign the value from the  sys_config  table: This function returns the major version of the MySQL server. None. A  TINYINT UNSIGNED  value. This function returns the minor version of the MySQL server. None. A  TINYINT UNSIGNED  value. Example Return Value Parameters 28.4.5.21 The version_minor() Function Example Parameters Return Value 28.4.5.20 The version_major() Function sys Schema Stored Functions | Value | +-------+ | 64 | +-------+ mysql>  SET @sys.statement_truncate_len = IFNULL(@sys.statement_truncate_len, sys.sys_get_config(’statement_truncate_len’, 64)); IF (@sys.statement_truncate_len IS NULL) THEN SET @sys.statement_truncate_len = sys.sys_get_config(’statement_truncate_len’, 64); END IF; mysql>  SELECT VERSION(), sys.version_major(); +--------------+---------------------+ | VERSION() | sys.version_major() | +--------------+---------------------+ | 8.0.13-debug | 8 | +--------------+---------------------+ mysql>  SELECT VERSION(), sys.version_minor(); +--------------+---------------------+ | VERSION() | sys.version_minor() | +--------------+---------------------+ | 8.0.13-debug | 0 | +--------------+---------------------+ 5213