Bug #19735 wait_timeout=0 sets wait_timeout=1 (requesting 0=infinite).
Submitted: 11 May 2006 17:57 Modified: 11 May 2006 18:03
Reporter: Morgan Tocker Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[11 May 2006 17:57] Morgan Tocker
Description:
When a wait_timeout is set to 0, it is automatically converted to 1..  which leads to an almost instant disconnect.

I'm requesting that 0=infinite, and the wait_timeout doesn't apply.

How to repeat:
mysql> set session wait_timeout = 0;
Query OK, 0 rows affected (0.00 sec)

mysql> show session variables like 'wait_timeout';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    33
Current database: *** NONE ***

+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 28800 |
+---------------+-------+
1 row in set (0.01 sec)
[11 May 2006 18:03] MySQL Verification Team
Thank you for the bug report.
[21 Dec 2007 15:34] Thomas Gelf
Is there anything new regarding this feature request (IMO it's an inconsistent
behavior, and therefore a bug... but who cares ;-)?

Kind regards,
Thomas Gelf
[4 Jun 2008 21:38] Sveta Smirnova
Bug #37205 was marked as duplicate of this one.
[22 Nov 2010 18:20] Sveta Smirnova
Morgan,

could you please clarify if you request a way to set the timeout to "infinite", which currently there is no way and don't insist on method we implement it. For example you don't care if 0==infinite or SOME_VALUE==infinite. Please confirm or reject.
[1 Mar 2012 9:46] Holger Tasch
Is there any way to request a wait_timeout of infinite now? Don't care how, but it should be documented.
[2 Dec 2016 6:50] Jeff Walter
Has this been implemented yet? I think the original request was to simply be able to do:

set session wait_timeout = 0;

and have the db connection not timeout.  

Sveta Smirnova, I'm not sure what you were asking about 0==infinite or SOME_VALUE==infinite, but I assume the answer you wanted was that 0 should semantically mean "infinite" in this case. i.e., If wait_timeout = 0 then never timeout the connection.

Can someone please fix this already? It's only been 10 years. :/