Bug #24661 mysql-connector-net-5.0.2-beta Driver.IsTooOld() Error....
Submitted: 28 Nov 2006 16:43 Modified: 14 Dec 2006 14:50
Reporter: Antonio Begue Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:5.0.x, 1.0.x OS:Windows (Windows xp)
Assigned to: CPU Architecture:Any
Tags: connector, IsTooOld, NET

[28 Nov 2006 16:43] Antonio Begue
Description:
In
namespace MySql.Data.MySqlClient
internal abstract class Driver
public bool IsTooOld()

The time is compared using the second property
if (ts.Seconds > Settings.ConnectionLifeTime)
This property doesn't count the minutes
So it cycles between Driver.IsTooOld()= TRue , Driver.IsTooOld() = False  every minute.

How to repeat:
Change Seconds to TotalSeconds property like this:

Suggested fix:
public bool IsTooOld()
{
	TimeSpan ts = DateTime.Now.Subtract(creationTime);
	if (ts.TotalSeconds > Settings.ConnectionLifeTime)
		return true;
	return false;
}
[7 Dec 2006 10:59] Tonci Grgin
Hi Antonio and thanks for your problem report. Verified as described in both connector/NET latest sources.
[8 Dec 2006 20:57] 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/16693
[8 Dec 2006 20:57] 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/16694
[8 Dec 2006 20:57] Reggie Burnett
Fixed in 1.0.9 and 5.0.3
[14 Dec 2006 14:50] MC Brown
A note has been added to the 1.0.9 and 5.0.3 changelogs.