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"

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.1.44, 10.2.31, 10.3.22, 10.4.12
    • 10.4(EOL)
    • 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

            is it any different in behavior from DEFAULT?

            serg Sergei Golubchik added a comment - is it any different in behavior from DEFAULT?

            Hi serg,

            Yes, the behavior of the ORIGINAL value is quite different from the behavior of the DEFAULT value. See the following example:

            [ec2-user@ip-172-30-0-123 ~]$ sudo tee /etc/my.cnf.d/event_scheduler.cnf <<EOF
            > [mariadb]
            > event_scheduler=ON
            > EOF
            [mariadb]
            event_scheduler=ON
            [ec2-user@ip-172-30-0-123 ~]$ sudo systemctl start mariadb
            [ec2-user@ip-172-30-0-123 ~]$ sudo mysql
            Welcome to the MariaDB monitor.  Commands end with ; or \g.
            Your MariaDB connection id is 10
            Server version: 10.4.11-5-MariaDB-enterprise-log MariaDB Enterprise Server
             
            Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
             
            Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
             
            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=OFF;
            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)
             
            MariaDB [(none)]> SET GLOBAL event_scheduler=ORIGINAL;
            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=DEFAULT;
            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)
            

            GeoffMontee Geoff Montee (Inactive) added a comment - Hi serg , Yes, the behavior of the ORIGINAL value is quite different from the behavior of the DEFAULT value. See the following example: [ec2-user@ip-172-30-0-123 ~]$ sudo tee /etc/my.cnf.d/event_scheduler.cnf <<EOF > [mariadb] > event_scheduler=ON > EOF [mariadb] event_scheduler=ON [ec2-user@ip-172-30-0-123 ~]$ sudo systemctl start mariadb [ec2-user@ip-172-30-0-123 ~]$ sudo mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 10.4.11-5-MariaDB-enterprise-log MariaDB Enterprise Server   Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.   Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.   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=OFF; 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)   MariaDB [(none)]> SET GLOBAL event_scheduler=ORIGINAL; 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=DEFAULT; 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)

            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.