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

"SET SESSION var=DEFAULT" doesn't set session value to global value for all variables

    XMLWordPrintable

    Details

      Description

      The MySQL documentation says the following:

      To set a global system variable value to the compiled-in MySQL default value or a session system variable to the current corresponding global value, set the variable to the value DEFAULT.

      https://dev.mysql.com/doc/refman/5.6/en/set-variable.html#set-variable-system-variables

      However, this does not appear to work for all system variables in MariaDB. For example, it does not seem to work for foreign_key_checks:

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

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            GeoffMontee Geoff Montee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration