List:Internals« Previous MessageNext Message »
From:rburnett Date:October 3 2005 5:29pm
Subject:Connector/NET commit: r187 - in branches/1.0: TestSuite mysqlclient
View as plain text  
Modified:
   branches/1.0/TestSuite/ConnectionTests.cs
   branches/1.0/TestSuite/StoredProcedure.cs
   branches/1.0/mysqlclient/Connection.cs
Log:
Bug #13658  	connection.state does not update on Ping() [ fixed ]

Files changed
------------------------------------------------------------------------------------------
Connection.cs - Mark connection as closed if ping fails
ConnectionTests.cs - Add test case for bug Bug #13658  	connection.state does not update
on Ping()
StoredProcedure.cs - Added test case for returning int values out of stored procedures


Modified: branches/1.0/TestSuite/ConnectionTests.cs
===================================================================
--- branches/1.0/TestSuite/ConnectionTests.cs	2005-09-27 14:58:59 UTC (rev 186)
+++ branches/1.0/TestSuite/ConnectionTests.cs	2005-10-03 15:29:22 UTC (rev 187)
@@ -309,5 +309,18 @@
 			conn2.Close();
 			Assert.IsTrue(conn2.ConnectionString.IndexOf(p) == -1);
 		}
+
+		/// <summary>
+		/// Bug #13658  	connection.state does not update on Ping()
+		/// </summary>
+		[Test]
+		public void PingUpdatesState()
+		{
+			MySqlConnection conn2 = new MySqlConnection(GetConnectionString(true));
+			conn2.Open();
+			KillConnection(conn2);
+			Assert.IsFalse(conn2.Ping());
+			Assert.IsTrue(conn2.State == ConnectionState.Closed);
+		}
 	}
 }

Modified: branches/1.0/TestSuite/StoredProcedure.cs
===================================================================
--- branches/1.0/TestSuite/StoredProcedure.cs	2005-09-27 14:58:59 UTC (rev 186)
+++ branches/1.0/TestSuite/StoredProcedure.cs	2005-10-03 15:29:22 UTC (rev 187)
@@ -452,7 +452,25 @@
 			{
 				c.Close();
 			}
-				
 		}
+
+		/// <summary>
+		/// Bug #13590  	ExecuteScalar returns only Int64 regardless of actual SQL type
+		/// </summary>
+		[Category("NotWorking")]
+		[Test]
+		public void TestSelectingInts()
+		{
+			execSQL("CREATE PROCEDURE spTest() BEGIN DECLARE myVar INT; " +
+				"SET MyVar := 1; SELECT CAST(myVar as INT); END");
+			
+			MySqlCommand cmd = new MySqlCommand("spTest", conn);
+			cmd.CommandType = CommandType.StoredProcedure;
+			object val = cmd.ExecuteScalar();
+			Assert.AreEqual(1, val, "Checking value");
+			Assert.IsTrue(val is System.Int32, "Checking type");
+		}
+
+
 	}
 }

Modified: branches/1.0/mysqlclient/Connection.cs
===================================================================
--- branches/1.0/mysqlclient/Connection.cs	2005-09-27 14:58:59 UTC (rev 186)
+++ branches/1.0/mysqlclient/Connection.cs	2005-10-03 15:29:22 UTC (rev 187)
@@ -268,7 +268,10 @@
 		/// <returns></returns>
 		public bool Ping() 
 		{
-			return driver.Ping();
+			bool result = driver.Ping();
+			if (! result)
+				SetState(ConnectionState.Closed);
+			return result;
 		}
 
 		/// <include file='docs/MySqlConnection.xml' path='docs/Open/*'/>

Thread
Connector/NET commit: r187 - in branches/1.0: TestSuite mysqlclientrburnett3 Oct