List:Commits« Previous MessageNext Message »
From:rburnett Date:November 5 2007 7:16pm
Subject:Connector/NET commit: r1064 - in branches/1.0: . TestSuite mysqlclient
View as plain text  
Modified:
   branches/1.0/CHANGES
   branches/1.0/TestSuite/ParameterTests.cs
   branches/1.0/mysqlclient/parameter.cs
Log:
fixed problem where old code was preventing creating parameter objects with non-input
direction using just a constructor (Bug #32093)  

Modified: branches/1.0/CHANGES
===================================================================
--- branches/1.0/CHANGES	2007-11-05 18:14:09 UTC (rev 1063)
+++ branches/1.0/CHANGES	2007-11-05 18:16:21 UTC (rev 1064)
@@ -10,7 +10,9 @@
     change handler would work in the case that the new state is open        
   - fixed problem where string parameters who have their size set after their value could
cause exceptions
     (Bug #32094) 
-            
+  - fixed problem where old code was preventing creating parameter objects with non-input
direction using
+    just a constructor (Bug #32093)  
+                
 Version 1.0.10
     Bugs
     ----

Modified: branches/1.0/TestSuite/ParameterTests.cs
===================================================================
--- branches/1.0/TestSuite/ParameterTests.cs	2007-11-05 18:14:09 UTC (rev 1063)
+++ branches/1.0/TestSuite/ParameterTests.cs	2007-11-05 18:16:21 UTC (rev 1064)
@@ -513,5 +513,20 @@
 			da.Fill(dt);
 			Assert.AreEqual("1234567890", dt.Rows[1][0]);
 		}    
+
+		/// <summary>
+		/// Bug #32093 MySqlParameter Constructor does not allow Direction of anything other
than Input 
+		/// </summary>
+		[Test]
+		public void NonInputParametersToCtor()
+		{
+			MySqlParameter p = new MySqlParameter("?p1", MySqlDbType.VarChar, 20, 
+				ParameterDirection.InputOutput, true, 0, 0, "id", DataRowVersion.Current, 0);
+			Assert.AreEqual(ParameterDirection.InputOutput, p.Direction);
+
+			MySqlParameter p1 = new MySqlParameter("?p1", MySqlDbType.VarChar, 20,
+				ParameterDirection.Output, true, 0, 0, "id", DataRowVersion.Current, 0);
+			Assert.AreEqual(ParameterDirection.Output, p1.Direction);
+		}
 	}
 }

Modified: branches/1.0/mysqlclient/parameter.cs
===================================================================
--- branches/1.0/mysqlclient/parameter.cs	2007-11-05 18:14:09 UTC (rev 1063)
+++ branches/1.0/mysqlclient/parameter.cs	2007-11-05 18:16:21 UTC (rev 1064)
@@ -116,8 +116,6 @@
 			DataRowVersion ver, object val)
 			: this(name, type)
 		{
-			if (direction != ParameterDirection.Input)
-				throw new ArgumentException("Only input parameters are supported by MySql");
 			direction = dir;
 			sourceColumn = col;
 			sourceVersion = ver;
@@ -143,9 +141,6 @@
 			object value)
 			: this(parameterName, dbType, size, sourceColumn)
 		{
-			if (direction != ParameterDirection.Input)
-				throw new ArgumentException("Only input parameters are supported by MySql");
-
 			this.direction = direction;
 			this.sourceVersion = sourceVersion;
 			Value = value;

Thread
Connector/NET commit: r1064 - in branches/1.0: . TestSuite mysqlclientrburnett5 Nov