Bug #38119 NET Connector returns unuasual error
Submitted: 15 Jul 2008 0:06 Modified: 24 Jul 2008 16:01
Reporter: Jared S (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:5.2.2 OS:Any (Windows)
Assigned to: CPU Architecture:Any
Tags: closed, failed, open, stream, wait_timeout, Writing

[15 Jul 2008 0:06] Jared S
Description:
Hi Reggie,

I am not satisfied with error being return after 28000 wait_timeout. 

Current Error: "Writing to stream failed"

How to repeat:
public MySql.Data.MySqlClient.MySqlDataReader DTR0;
public MySql.Data.MySqlClient.MySqlConnection CON0;
public MySql.Data.MySqlClient.MySqlCommand CMD0;

private void Button1_Click(object sender, System.EventArgs e)
{
object zObject = null;
CON0 = new MySql.Data.MySqlClient.MySqlConnection();
CON0.ConnectionString = "server=localhost;database=information_schema;user=root;password=;port=3306";
CON0.Open();
CMD0 = new MySql.Data.MySqlClient.MySqlCommand("set wait_timeout = 5", CON0);
CMD0.ExecuteNonQuery();
System.Threading.Thread.Sleep(6000);
CMD0 = new MySql.Data.MySqlClient.MySqlCommand("select version()", CON0);
zObject = CMD0.ExecuteScalar();
Trace.WriteLine(zObject.ToString());
}

Suggested fix:
I would like to see the state of the NET connector "Closed" when server hits the 28000 second wait_timeout threshould.

I imagine that there may be a delay in the process of flagging the NET connector to closed, but "Writing to stream has failed" is CLEARLY an incorrect message if the connection was shutdown by the server.

Whilst I like details of inner exceptions error messages, I think the "Writing to stream" error message needs to be replaced with State.Closed EVENT.
[18 Jul 2008 8:28] Tonci Grgin
Hi Jared.

How come this is "S1"? I see it as "S4" and completely agree with you. If you have no objections, please lower the severity so I can set it to Verified.
[18 Jul 2008 20:51] 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/50058
[18 Jul 2008 21:04] Reggie Burnett
Fixed in 5.2.3
[18 Jul 2008 21:25] Jared S
High priority BC I need to do more extensive testing on NET con. failures.

MySQL has made internal fix also leading into 5.2.3 tree...
http://forums.mysql.com/read.php?38,187729,217696#msg-217696
[24 Jul 2008 16:01] Tony Bedford
An entry was added to the 5.2.3 changelog:

Error string was returned after a 28000 second wait_timeout. This has been changed to generate a ConnectionState.Closed event.