Modified:
branches/5.1/CHANGES
branches/5.1/Driver/Source/Connection.cs
branches/5.1/TestSuite/Source/ConnectionTests.cs
Log:
- Fixed problem with opening a connection that was previously closed by sudden server
disconnection (bug #33909)
The problem was that a connection that disconnects suddenly goes through all the steps of
removing from the connection pool and sets the state to closed but the internal driver
object is not set to null. This causes a second open to try and use the existing driver
object which fails.
Modified: branches/5.1/CHANGES
===================================================================
--- branches/5.1/CHANGES 2008-01-29 16:32:12 UTC (rev 1153)
+++ branches/5.1/CHANGES 2008-01-29 17:30:59 UTC (rev 1154)
@@ -6,6 +6,7 @@
- Fixed problem where connection state reported through the state change handler was
not
showing Open (bug #34082)
- Incorporated some connection string cache optimizations sent to us by Maxim Mass (bug
#34000)
+ - Fixed problem with opening a connection that was previously closed by sudden server
disconnection (bug #33909)
Version 5.1.4 - 11/12/2007
- Fixed issue where column name metadata was not using the charset given on the
connection string
Modified: branches/5.1/Driver/Source/Connection.cs
===================================================================
--- branches/5.1/Driver/Source/Connection.cs 2008-01-29 16:32:12 UTC (rev 1153)
+++ branches/5.1/Driver/Source/Connection.cs 2008-01-29 17:30:59 UTC (rev 1154)
@@ -419,10 +419,11 @@
/// <returns></returns>
public bool Ping()
{
- bool result = driver.Ping();
- if (!result)
- SetState(ConnectionState.Closed, true);
- return result;
+ if (driver != null && driver.Ping())
+ return true;
+ driver = null;
+ SetState(ConnectionState.Closed, true);
+ return false;
}
/// <include file='docs/MySqlConnection.xml' path='docs/Open/*'/>
Modified: branches/5.1/TestSuite/Source/ConnectionTests.cs
===================================================================
--- branches/5.1/TestSuite/Source/ConnectionTests.cs 2008-01-29 16:32:12 UTC (rev 1153)
+++ branches/5.1/TestSuite/Source/ConnectionTests.cs 2008-01-29 17:30:59 UTC (rev 1154)
@@ -326,6 +326,8 @@
KillConnection(conn2);
Assert.IsFalse(conn2.Ping());
Assert.IsTrue(conn2.State == ConnectionState.Closed);
+ conn2.Open();
+ conn2.Close();
}
/// <summary>
| Thread |
|---|
| • Connector/NET commit: r1154 - in branches/5.1: . Driver/Source TestSuite/Source | rburnett | 29 Jan |