List:Commits« Previous MessageNext Message »
From:rburnett Date:March 27 2007 8:41pm
Subject:Connector/NET commit: r650 - in branches/5.0: . Driver/Source/Types TestSuite
View as plain text  
Modified:
   branches/5.0/CHANGES
   branches/5.0/Driver/Source/Types/MySqlString.cs
   branches/5.0/TestSuite/GetSchemaTests.cs
Log:
Bug #25947 CreateFormat/CreateParameters Column of DataTypes collection incorrect for CHAR


Changed what was being reported for CreateFormat for string and decimal types.  Also,
fixed problem where varchar and char were being reported as fixed length.

Modified: branches/5.0/CHANGES
===================================================================
--- branches/5.0/CHANGES	2007-03-27 14:52:34 UTC (rev 649)
+++ branches/5.0/CHANGES	2007-03-27 18:41:22 UTC (rev 650)
@@ -6,7 +6,8 @@
   Bug #27289 Transaction is not rolledback when connection close 
   Bug #26147 "User Id" problem during connection creation 
   Bug #27240 Property value characterset not retrieved/fetched in conn wizard 
-  
+  Bug #25947 CreateFormat/CreateParameters Column of DataTypes collection incorrect for
CHAR 
+   
   Other changes
   -------------
   Installer now works if XML comments are found in machine.config

Modified: branches/5.0/Driver/Source/Types/MySqlString.cs
===================================================================
--- branches/5.0/Driver/Source/Types/MySqlString.cs	2007-03-27 14:52:34 UTC (rev 649)
+++ branches/5.0/Driver/Source/Types/MySqlString.cs	2007-03-27 18:41:22 UTC (rev 650)
@@ -143,13 +143,13 @@
 				row["TypeName"] = types[x];
 				row["ProviderDbType"] = dbtype[x];
 				row["ColumnSize"] = 0;
-				row["CreateFormat"] = types[x];
-				row["CreateParameters"] = null;
+                row["CreateFormat"] = x < 2 ? types[x] + "({0})" : types[x];
+				row["CreateParameters"] = x < 2 ? "size" : null;
 				row["DataType"] = "System.String";
 				row["IsAutoincrementable"] = false;
 				row["IsBestMatch"] = true;
 				row["IsCaseSensitive"] = false;
-				row["IsFixedLength"] = true;
+				row["IsFixedLength"] = false;
 				row["IsFixedPrecisionScale"] = true;
 				row["IsLong"] = false;
 				row["IsNullable"] = true;

Modified: branches/5.0/TestSuite/GetSchemaTests.cs
===================================================================
--- branches/5.0/TestSuite/GetSchemaTests.cs	2007-03-27 14:52:34 UTC (rev 649)
+++ branches/5.0/TestSuite/GetSchemaTests.cs	2007-03-27 18:41:22 UTC (rev 650)
@@ -70,6 +70,7 @@
 
         /// <summary>
         /// Bug #25907 DataType Column of DataTypes collection does'nt contain the
correct CLR Datatype 
+        /// Bug #25947 CreateFormat/CreateParameters Column of DataTypes collection
incorrect for CHAR 
         /// </summary>
         [Test]
         public void DataTypes()
@@ -92,9 +93,15 @@
                         Assert.AreEqual(typeof(System.Byte[]), systemType);
                     else if (type == "TIME")
                         Assert.AreEqual(typeof(System.TimeSpan), systemType);
-                    else if (type == "CHAR" || type == "SET" || 
-                             type == "VARCHAR" || type == "ENUM")
+                    else if (type == "CHAR" || type == "VARCHAR")
+                    {
                         Assert.AreEqual(typeof(System.String), systemType);
+                        Assert.IsFalse(Convert.ToBoolean(row["IsFixedLength"]));
+                        string format = type + "({0})";
+                        Assert.AreEqual(format, row["CreateFormat"].ToString());
+                    }
+                    else if (type == "SET" || type == "ENUM")
+                        Assert.AreEqual(typeof(System.String), systemType);
                     else if (type == "DOUBLE")
                         Assert.AreEqual(typeof(System.Double), systemType);
                     else if (type == "SINGLE")
@@ -128,7 +135,10 @@
                             Assert.AreEqual(typeof(System.Int64), systemType);
                     }
                     else if (type == "DECIMAL")
+                    {
                         Assert.AreEqual(typeof(System.Decimal), systemType);
+                        Assert.AreEqual("DECIMAL({0},{1})",
row["CreateFormat"].ToString());
+                    }
                     else if (type == "TINYINT")
                         Assert.AreEqual(typeof(System.Byte), systemType);
                 }

Thread
Connector/NET commit: r650 - in branches/5.0: . Driver/Source/Types TestSuiterburnett27 Mar