List:Commits« Previous MessageNext Message »
From:rburnett Date:April 28 2008 9:34pm
Subject:Connector/NET commit: r1264 - in branches/5.1: . Driver/Source TestSuite/Source
View as plain text  
Modified:
   branches/5.1/CHANGES
   branches/5.1/Driver/Source/Field.cs
   branches/5.1/TestSuite/Source/DataTypeTests.cs
Log:
 - Fixed data type processing so that geometry fields are returned as binary.  (bug
#36081)      


Modified: branches/5.1/CHANGES
===================================================================
--- branches/5.1/CHANGES	2008-04-28 16:51:29 UTC (rev 1263)
+++ branches/5.1/CHANGES	2008-04-28 19:34:45 UTC (rev 1264)
@@ -18,6 +18,7 @@
    It actually works now  :) (bug #36157)
  - Fixed documentation that still stated that setting port to -1 was necessary for
    a named pipe connection (bug #35356)      
+ - Fixed data type processing so that geometry fields are returned as binary.  (bug
#36081)      
       
 Version 5.1.5 - 
   - Fixed problem with membership provider where FindUserByEmail would fail trying to add

Modified: branches/5.1/Driver/Source/Field.cs
===================================================================
--- branches/5.1/Driver/Source/Field.cs	2008-04-28 16:51:29 UTC (rev 1263)
+++ branches/5.1/Driver/Source/Field.cs	2008-04-28 19:34:45 UTC (rev 1264)
@@ -337,6 +337,7 @@
                 case MySqlDbType.LongText:
                 case (MySqlDbType) Field_Type.NULL:
                     return new MySqlString(type, true);
+                case MySqlDbType.Geometry:
                 case MySqlDbType.Blob:
                 case MySqlDbType.MediumBlob:
                 case MySqlDbType.LongBlob:

Modified: branches/5.1/TestSuite/Source/DataTypeTests.cs
===================================================================
--- branches/5.1/TestSuite/Source/DataTypeTests.cs	2008-04-28 16:51:29 UTC (rev 1263)
+++ branches/5.1/TestSuite/Source/DataTypeTests.cs	2008-04-28 19:34:45 UTC (rev 1264)
@@ -880,5 +880,27 @@
             Assert.AreEqual(1, dt.Rows[1][2]);
             Assert.AreEqual(DBNull.Value, dt.Rows[2][2]);
         }
+
+        /// <summary>
+        /// Bug #36081 Get Unknown Datatype in C# .Net 
+        /// </summary>
+        [Test]
+        public void GeometryType()
+        {
+            if (version < new Version(5, 0)) return;
+
+            execSQL("DROP TABLE IF EXISTS Test");
+            execSQL(@"CREATE TABLE Test (ID int(11) NOT NULL,
+                ogc_geom geometry NOT NULL default '',
+                PRIMARY KEY  (`ID`))");
+            execSQL(@"INSERT INTO Test VALUES (1, 
+                GeomFromText('GeometryCollection(Point(1 1), LineString(2 2, 3 3))'))");
+
+            MySqlCommand cmd = new MySqlCommand("SELECT * FROM Test", conn);
+            using (MySqlDataReader reader = cmd.ExecuteReader())
+            {
+                reader.Read();
+            }
+        }
 	}
 }

Thread
Connector/NET commit: r1264 - in branches/5.1: . Driver/Source TestSuite/Sourcerburnett28 Apr