Author: kostat
Date: 2006-11-14 02:40:50 -0500 (Tue, 14 Nov 2006)
New Revision: 67816

Modified:
   trunk/mcs/class/System.Data/System.Data/ChangeLog
   trunk/mcs/class/System.Data/System.Data/DataColumn.cs
   trunk/mcs/class/System.Data/Test/System.Data/ChangeLog
   trunk/mcs/class/System.Data/Test/System.Data/DataColumnTest.cs
   trunk/mcs/class/System.Data/Test/System.Data/DataTableTest.cs
Log:
* DataColumn.cs: consider row version when checking row.IsNull().
* DataColumnTest.cs: Added test for DataColunm.AllowDBNull.
* DataTableTest.cs: removed fixed NotWorkings.



Modified: trunk/mcs/class/System.Data/System.Data/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data/ChangeLog   2006-11-14 07:33:56 UTC 
(rev 67815)
+++ trunk/mcs/class/System.Data/System.Data/ChangeLog   2006-11-14 07:40:50 UTC 
(rev 67816)
@@ -1,3 +1,7 @@
+2006-11-24  Konstantin Triger <[EMAIL PROTECTED]>
+
+       * DataColumn.cs: consider row version wen checking row.IsNull().
+
 2006-10-18  Nagappan A  <[EMAIL PROTECTED]>
 
        * ForeignKeyConstraint.cs (_validateColumns): Parent and child

Modified: trunk/mcs/class/System.Data/System.Data/DataColumn.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data/DataColumn.cs       2006-11-14 
07:33:56 UTC (rev 67815)
+++ trunk/mcs/class/System.Data/System.Data/DataColumn.cs       2006-11-14 
07:40:50 UTC (rev 67816)
@@ -218,7 +218,9 @@
                                                bool nullsFound = false;
                                                for(int r = 0; r < 
_table.Rows.Count; r++) {
                                                        DataRow row = 
_table.Rows[r];
-                                                       if(row.IsNull(this)) {
+                                                       DataRowVersion version 
= row.HasVersion (DataRowVersion.Default) ?
+                                                               
DataRowVersion.Default : DataRowVersion.Original;
+                                                       if(row.IsNull(this, 
version)) {
                                                                nullsFound = 
true;
                                                                break;
                                                        }

Modified: trunk/mcs/class/System.Data/Test/System.Data/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/Test/System.Data/ChangeLog      2006-11-14 
07:33:56 UTC (rev 67815)
+++ trunk/mcs/class/System.Data/Test/System.Data/ChangeLog      2006-11-14 
07:40:50 UTC (rev 67816)
@@ -1,4 +1,8 @@
+2006-11-24  Konstantin Triger <[EMAIL PROTECTED]>
 
+       * DataColumnTest.cs: Added test for DataColunm.AllowDBNull
+       * DataTableTest.cs: removed fixed NotWorkings
+
 2006-10-24  Hagit Yidov <[EMAIL PROTECTED]>
 
        * DataTableReadXmlSchemaTest.cs : More tests for ReadXmlSchema()

Modified: trunk/mcs/class/System.Data/Test/System.Data/DataColumnTest.cs
===================================================================
--- trunk/mcs/class/System.Data/Test/System.Data/DataColumnTest.cs      
2006-11-14 07:33:56 UTC (rev 67815)
+++ trunk/mcs/class/System.Data/Test/System.Data/DataColumnTest.cs      
2006-11-14 07:40:50 UTC (rev 67816)
@@ -98,6 +98,29 @@
                }
 
                [Test]
+               public void AllowDBNull1()
+               {
+                       DataTable tbl = _tbl;
+                       tbl.Columns.Add ("id", typeof (int));
+                       tbl.Columns.Add ("name", typeof (string));
+                       tbl.PrimaryKey = new DataColumn [] { tbl.Columns ["id"] 
};
+                       tbl.Rows.Add (new object [] { 1, "RowState 1" });
+                       tbl.Rows.Add (new object [] { 2, "RowState 2" });
+                       tbl.Rows.Add (new object [] { 3, "RowState 3" });
+                       tbl.AcceptChanges ();
+                       // Update Table with following changes: Row0 
unmodified, 
+                       // Row1 modified, Row2 deleted, Row3 added, Row4 
not-present.
+                       tbl.Rows [1] ["name"] = "Modify 2";
+                       tbl.Rows [2].Delete ();
+
+                       DataColumn col = tbl.Columns ["name"];
+                       col.AllowDBNull = true;
+                       col.AllowDBNull = false;
+
+                       AssertEquals (false, col.AllowDBNull);
+               }
+
+               [Test]
                public void AutoIncrement()
                {
                        DataColumn col = new DataColumn("Auto",typeof(string));

Modified: trunk/mcs/class/System.Data/Test/System.Data/DataTableTest.cs
===================================================================
--- trunk/mcs/class/System.Data/Test/System.Data/DataTableTest.cs       
2006-11-14 07:33:56 UTC (rev 67815)
+++ trunk/mcs/class/System.Data/Test/System.Data/DataTableTest.cs       
2006-11-14 07:40:50 UTC (rev 67816)
@@ -1675,7 +1675,6 @@
                        dtLoad.Load (dtr);
                }
                [Test]
-               [Category ("NotWorking")]
                // Load doesn't have a third overload in System.Data
                // and is commented-out below
                public void Load_IncompatibleEHandlerT () {
@@ -1953,7 +1952,6 @@
 
                [Test]
                [ExpectedException (typeof (VersionNotFoundException))]
-               [Category ("NotWorking")]
                public void Load_RowStateChangesDefaultDelete () {
                        localSetup ();
                        DataTable dtLoad = new DataTable 
("LoadRowStateChanges");
@@ -2026,7 +2024,6 @@
 
                [Test]
                [ExpectedException (typeof (VersionNotFoundException))]
-               [Category ("NotWorking")]
                public void Load_RowStatePreserveChangesDelete () {
                        localSetup ();
                        DataTable dtLoad = new DataTable 
("LoadRowStateChanges");
@@ -2157,7 +2154,6 @@
                }
 
                [Test]
-               [Category ("NotWorking")]
                public void Load_RowStateUpsertDuplicateKey1 () {
                        localSetup ();
                        dt.Rows.Add (new object[] { 4, "mono 4" });
@@ -2210,7 +2206,6 @@
 
                [Test]
                [ExpectedException (typeof (IndexOutOfRangeException))]
-               [Category ("NotWorking")]
                public void Load_RowStateUpsertDuplicateKey2 () {
                        localSetup ();
                        dt.Rows.Add (new object[] { 4, "mono 4" });
@@ -2231,7 +2226,6 @@
 
                [Test]
                [ExpectedException (typeof (VersionNotFoundException))]
-               [Category ("NotWorking")]
                public void Load_RowStateUpsertDelete1 () {
                        localSetup ();
                        DataTable dtLoad = new DataTable 
("LoadRowStateChanges");
@@ -2251,7 +2245,6 @@
 
                [Test]
                [ExpectedException (typeof (VersionNotFoundException))]
-               [Category ("NotWorking")]
                public void Load_RowStateUpsertDelete2 () {
                        localSetup ();
                        DataTable dtLoad = new DataTable 
("LoadRowStateChanges");

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to