Bug #57265 CommandTimeout = 0 does not work
Submitted: 5 Oct 2010 22:36 Modified: 13 Oct 2010 10:46
Reporter: Vladislav Vaintroub Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Vladislav Vaintroub CPU Architecture:Any

[5 Oct 2010 22:36] Vladislav Vaintroub
Description:
Setting MySqlCommand.CommandTimeout to 0 does not work. 
The effect of this setting should be infinite timeout (SqlCommand behavior).

It is set to 30 if "Default Command Timeout=0" is given in connection string, and  if setting MySqlCommand.CommandTimeout to 0 will also yield 30 when the value is read.

See also http://forums.mysql.com/read.php?38,382361,382361#msg-382361

How to repeat:
1)
MySqlConnection c = new MySqlConnection("default command timeout = 0");
MySqlCommand cmd = new MySqlCommand("",c);
Debug.Assert(cmd.CommandTimeout == 0);
will fail

2)
MySqlCommand cmd = new MySqlCommand();
cmd.CommandTimeout = 0;
Debug.Assert(cmd.CommandTimeout == 0);

will fail as well.
[5 Oct 2010 22:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/120040

900 Vladislav Vaintroub	2010-10-06
      Bug #57265 CommandTimeout = 0 does not work.
      
      Fix : change the behavior of propertyl  MySqlCommand.CommandTimeout to return default value
      30 if and only if it was never set and there is no connection associated with the command. 
      Do not treat value 0 as special indicator for "timeout was never assigned".
[7 Oct 2010 21:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/120302

840 Vladislav Vaintroub	2010-10-07
      Bug #57265 CommandTimeout = 0 does not work.
           
      Fix : change the behavior of propertyl  MySqlCommand.CommandTimeout to return default value
      30 if and only if it was never set and there is no connection associated with the command. 
      Do not treat value 0 as special indicator for "timeout was never assigned".
[7 Oct 2010 22:03] Vladislav Vaintroub
queued to 6.0, 6.1, 6.2, 6.3 and trunk
[13 Oct 2010 10:46] Tony Bedford
An entry has been added to the 6.0.8, 6.1.6, 6.2.5, and 6.3.5 changelogs:

Setting MySqlCommand.CommandTimeout to 0 had no effect. It should have resulted in an infinite timeout.