Bug #13658 connection.state does not update on Ping()
Submitted: 30 Sep 2005 14:28 Modified: 3 Oct 2005 22:18
Reporter: Jean Bédard Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:1.0.6.25887 OS:Windows (Win XP Pro SP2)
Assigned to: Reggie Burnett CPU Architecture:Any

[30 Sep 2005 14:28] Jean Bédard
Description:
When a connection is successfully opened. Try shutdown the mysql server and cal Ping() method, Ping() will return false as expected but connection state remains Open.

How to repeat:
MySQLConnection m_myConnection = new MySQLConnection();
m_myConnection.ConnectionString = ...
m_myConnection.Open();

// Open succeed... now shutdown the mysql server
// then execute the following code
bool bRes = m_myConnection.Ping(); // bRes is false
System.Data.ConnectionState state = m_myConnection.State; // state is Open !?!

Suggested fix:
Update the connection state when ping fail.
[2 Oct 2005 11:24] Vasily Kishkin
Thanks for the bug report. I was able to reproduce the bug. My test case is attached.
[2 Oct 2005 11:25] Vasily Kishkin
Test case

Attachment: 13658.zip (application/x-zip-compressed, text), 5.59 KiB.

[3 Oct 2005 15:31] Reggie Burnett
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

fixed in 1.0.7
[3 Oct 2005 22:18] Mike Hillyer
Documented in 1.0.7 changelog: <listitem>
        <para>
          <literal>Ping()</literal> method did not update
          <literal>State</literal> property of
          <literal>Connection</literal> object. (Bug #13658)
        </para>
      </listitem>