[MDEV-21937] "SET SESSION var=DEFAULT" doesn't set session value to global value for all variables Created: 2020-03-13  Updated: 2020-03-13

Status: Open
Project: MariaDB Server
Component/s: Configuration, Variables
Affects Version/s: 10.4.12
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 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)


Generated at Thu Feb 08 09:10:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.