Bug #19998 SET GLOBAL wait_timeout is not propagated to new connections
Submitted: 22 May 2006 11:56 Modified: 22 May 2006 16:26
Reporter: Jan Kneschke Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.16, 5.1-bk OS:Linux (Linux/x86, MacOSX)
Assigned to: CPU Architecture:Any

[22 May 2006 11:56] Jan Kneschke
Description:
the wait_timeout for new connections can't be changed at runtime.

SET GLOBAL wait_timeout = 12000 is setting the global wait_timeout as expected, but if you reconnect with the mysql commandline client it still has to old wait_timeout (28800) set.

How to repeat:
Using the MySQL client:

> show variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 28800 |
+---------------+-------+

> set global wait_timeout = 12000;
Query OK, 0 rows affected (0.00 sec)

> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 12000 |
+---------------+-------+

> quit
... login again ...

> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 12000 |
+---------------+-------+
1 row in set (0.00 sec)

> show variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 28800 |
+---------------+-------+
1 row in set (0.00 sec)

> select @@wait_timeout;
+----------------+
| @@wait_timeout |
+----------------+
|          28800 |
+----------------+
1 row in set (0.00 sec)

Suggested fix:
propagate wait_timeout from the global settings to the session settings for new connections.
[22 May 2006 11:58] Domas Mituzas
Verified at fresh 5.1-bk build
[22 May 2006 14:58] Jim Winstead
Did you remember to change interactive_timeout? (That's where the setting for a session's wait_timeout comes from when it has been flagged as an interactive connection, which the mysql client does.)

See http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html

This bug should not have been marked 'Verified' without checking this, since it is not mentioned in the bug report.
[22 May 2006 16:13] Jan Kneschke
Right, this "feature" is working as documented in the manual.

For a user this a non-obvious and from his perspective still a bug, even if it is documented.
[22 May 2006 16:26] Valeriy Kravchuk
There are many different things not obvious to users and even support engineers or developers. Not all of them are bugs, though. So, this one looks like intended and documented behavior - not a bug.