From: rburnett Date: November 5 2007 6:14pm Subject: Connector/NET commit: r1063 - in branches/5.0: . Driver/Source TestSuite/Source List-Archive: http://lists.mysql.com/commits/37117 X-Bug: 32093 Message-Id: <200711051814.lA5IE98p029643@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: branches/5.0/CHANGES branches/5.0/Driver/Source/parameter.cs branches/5.0/TestSuite/Source/ParameterTests.cs Log: fixed problem where old code was preventing creating parameter objects with non-input direction using just a constructor (Bug #32093) Modified: branches/5.0/CHANGES =================================================================== --- branches/5.0/CHANGES 2007-11-05 18:05:36 UTC (rev 1062) +++ branches/5.0/CHANGES 2007-11-05 18:14:09 UTC (rev 1063) @@ -22,6 +22,8 @@ - fixed MySqlDateTime.ToString() to properly return the date value (Bug #32010) - 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 5.0.8 8/16/2007 Modified: branches/5.0/Driver/Source/parameter.cs =================================================================== --- branches/5.0/Driver/Source/parameter.cs 2007-11-05 18:05:36 UTC (rev 1062) +++ branches/5.0/Driver/Source/parameter.cs 2007-11-05 18:14:09 UTC (rev 1063) @@ -122,8 +122,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; @@ -149,9 +147,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; Modified: branches/5.0/TestSuite/Source/ParameterTests.cs =================================================================== --- branches/5.0/TestSuite/Source/ParameterTests.cs 2007-11-05 18:05:36 UTC (rev 1062) +++ branches/5.0/TestSuite/Source/ParameterTests.cs 2007-11-05 18:14:09 UTC (rev 1063) @@ -547,5 +547,20 @@ da.Fill(dt); Assert.AreEqual("1234567890", dt.Rows[1][0]); } + + /// + /// Bug #32093 MySqlParameter Constructor does not allow Direction of anything other than Input + /// + [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); + } } }