Author: anagappan
Date: 2006-09-26 04:50:59 -0400 (Tue, 26 Sep 2006)
New Revision: 65903
Modified:
trunk/mcs/class/System.Data/Test/ChangeLog
trunk/mcs/class/System.Data/Test/SqlTest.cs
Log:
* SqlTest.cs: Added test for inserting zero-length varbinary.
Modified: trunk/mcs/class/System.Data/Test/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/Test/ChangeLog 2006-09-26 08:47:15 UTC (rev
65902)
+++ trunk/mcs/class/System.Data/Test/ChangeLog 2006-09-26 08:50:59 UTC (rev
65903)
@@ -1,3 +1,6 @@
+2006-07-18 Dean Brettle <[EMAIL PROTECTED]>
+ * SqlTest.cs: Added test for inserting zero-length varbinary.
+
2006-06-09 Juraj Skripsky <[EMAIL PROTECTED]>
* DataTableTest.cs (SelectEscaping): Add tests for calling Select()
Modified: trunk/mcs/class/System.Data/Test/SqlTest.cs
===================================================================
--- trunk/mcs/class/System.Data/Test/SqlTest.cs 2006-09-26 08:47:15 UTC (rev
65902)
+++ trunk/mcs/class/System.Data/Test/SqlTest.cs 2006-09-26 08:50:59 UTC (rev
65903)
@@ -229,6 +229,27 @@
insertCommand.ExecuteNonQuery ();
}
+ // execute SQL INSERT Command using ExecuteNonQuery()
+ static void InsertEdgeCaseData (IDbConnection cnc) {
+
+ IDbCommand insertCommand = cnc.CreateCommand();
+
+ insertCommand.CommandText =
+ "insert into mono_sql_test (" +
+ "varbinary_value " +
+ ") values (" +
+ "@p20 " +
+ ")";
+
+ SqlParameterCollection parameters = ((SqlCommand)
insertCommand).Parameters;
+
+ parameters.Add ("@p20", SqlDbType.VarBinary, 8);
+
+ parameters ["@p20"].Value = new byte[0] {};
+
+ insertCommand.ExecuteNonQuery ();
+ }
+
// execute a SQL SELECT Query using ExecuteReader() to retrieve
// a IDataReader so we retrieve data
static IDataReader SelectData (IDbConnection cnc) {
@@ -640,6 +661,11 @@
InsertData (cnc);
Console.WriteLine ("OK");
+ /* Inserts edge case values */
+ Console.WriteLine ("\t\tInsert values that
require special coding: ");
+ InsertEdgeCaseData (cnc);
+ Console.WriteLine ("OK");
+
/* Select aggregates */
SelectAggregate (cnc, "count(*)");
// FIXME: still having a problem with avg()
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches