[Mono-devel-list] [PATCH] System.Data.DataSet.cs compatebility with ms.net

Eran Domb erand at mainsoft.com
Tue Feb 3 07:58:45 EST 2004


Hello,

I found that in MS.Net the method GetSchemaSerializable return null 
(This is an undocumented method).
Also I found that when VisualStudio.Net generates TypedDataSet they 
override this method and in the implementation
they call WriteXmlSchema. This thing is causing an infinite loop in MONO 
implementation : WriteXmlSchema calls DoWriteXmlSchema which calls 
GetSchemaSerializable that calls again to WriteXmlSchema. This ends with 
stack overflow.
The patch solves this problem.

If no one objects I will commit.

Index: DataSet.cs
===================================================================
RCS file: /cvs/public/mcs/class/System.Data/System.Data/DataSet.cs,v
retrieving revision 1.61
diff -u -r1.61 DataSet.cs
--- DataSet.cs    2 Feb 2004 09:01:23 -0000    1.61
+++ DataSet.cs    3 Feb 2004 12:29:10 -0000
@@ -926,7 +926,7 @@
        
         protected virtual System.Xml.Schema.XmlSchema 
GetSchemaSerializable ()
         {
-            return BuildSchema ();
+            return null;
         }
        
         protected virtual void ReadXmlSerializable (XmlReader reader)
@@ -1473,7 +1473,7 @@
 
         private void DoWriteXmlSchema (XmlWriter writer)
         {
-            GetSchemaSerializable ().Write (writer);
+            BuildSchema ().Write (writer);
         }
        
         ///<summary>




More information about the Mono-devel-list mailing list