[MDEV-13114] New MariaDB 10.2 connection always has wait_timeout=28800, does not use global value Created: 2017-06-16  Updated: 2020-08-25  Resolved: 2017-06-16

Status: Closed
Project: MariaDB Server
Component/s: libmariadb, Scripts & Clients, Server, Variables
Affects Version/s: 10.2.6
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: client, connection, variable


 Description   

Let's say that I do the following:

[ec2-user@ip-172-30-0-58 ~]$ mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 22
Server version: 10.2.6-MariaDB MariaDB Server
 
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> SET GLOBAL wait_timeout=600;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [(none)]> \q
Bye

The above command set the global value for wait_timeout to 600, so new sessions should use this value. However, they still seem to use the default value in 10.2.6:

[ec2-user@ip-172-30-0-58 ~]$ mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 23
Server version: 10.2.6-MariaDB MariaDB Server
 
Copyright (c) 2000, 2017, 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 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 600   |
+---------------+-------+
1 row in set (0.00 sec)
 
MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 28800 |
+---------------+-------+
1 row in set (0.00 sec)
 
MariaDB [(none)]> \q
Bye

For whatever reason, other variables like interactive_timeout and connect_timeout do not have the same problem.



 Comments   
Comment by Elena Stepanova [ 2017-06-16 ]

There is nothing either new, or wrong, or MariaDB-specific in this behavior. By definition, the session value of wait_timeout is initialized either from the global wait_timeout value or from the global interactive_timeout value, depending on what kind of client you use. Since you're using the interactive client, it's initialized from interactive_timeout.

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.7-MariaDB-debug Source distribution
 
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> SET GLOBAL wait_timeout=600;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [(none)]> SET GLOBAL interactive_timeout=1000;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [(none)]> exit
Bye

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.2.7-MariaDB-debug Source distribution
 
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 1000  |
+---------------+-------+
1 row in set (0.00 sec)
 
MariaDB [(none)]> 

Generated at Thu Feb 08 08:03:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.