Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-21780

event_scheduler system variable's usage message doesn't mention the possible value "ORIGINAL"

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.1.44, 10.2.31, 10.3.22, 10.4.12
    • 10.4
    • Events, Variables
    • None

    Description

      The event_scheduler system variable supports the values: OFF, ON, DISABLED, and ORIGINAL. We can see that from the following code:

      static const char *event_scheduler_names[]= { "OFF", "ON", "DISABLED",
                                                    "ORIGINAL", NullS };
      

      https://github.com/MariaDB/server/blob/mariadb-10.4.12/sql/sys_vars.cc#L1010

      According to the source code, the value ORIGINAL means that the value should revert back to the startup state:

        /* EVENTS_ORIGINAL means we should revert back to the startup state */
        if (opt_event_scheduler_value == Events::EVENTS_ORIGINAL)
        {
          opt_event_scheduler_value= Events::opt_event_scheduler=
            Events::startup_state;
        }
      

      https://github.com/MariaDB/server/blob/mariadb-10.4.12/sql/sys_vars.cc#L1049

      This can be easily confirmed by performing a simple test:

      MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'event_scheduler';
      +-----------------+-------+
      | Variable_name   | Value |
      +-----------------+-------+
      | event_scheduler | OFF   |
      +-----------------+-------+
      1 row in set (0.002 sec)
       
      MariaDB [(none)]> SET GLOBAL event_scheduler=ON;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'event_scheduler';
      +-----------------+-------+
      | Variable_name   | Value |
      +-----------------+-------+
      | event_scheduler | ON    |
      +-----------------+-------+
      1 row in set (0.001 sec)
       
      MariaDB [(none)]> SET GLOBAL event_scheduler=ORIGINAL;
      Query OK, 0 rows affected (0.001 sec)
       
      MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'event_scheduler';
      +-----------------+-------+
      | Variable_name   | Value |
      +-----------------+-------+
      | event_scheduler | OFF   |
      +-----------------+-------+
      1 row in set (0.001 sec)
      

      Unfortunately, the ORIGINAL value is not mentioned in the variable's usage message:

      MariaDB [(none)]> SELECT VARIABLE_COMMENT FROM information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='event_scheduler';
      +----------------------------------------------------------------------------------------------------------------------------------------------------------+
      | VARIABLE_COMMENT                                                                                                                                         |
      +----------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Enable the event scheduler. Possible values are ON, OFF, and DISABLED (keep the event scheduler completely deactivated, it cannot be activated run-time) |
      +----------------------------------------------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.001 sec)
      

      The usage message should be changed to mention this value, and it should describe what the value does.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.