List:Commits« Previous MessageNext Message »
From:rburnett Date:May 5 2009 7:30pm
Subject:Connector/NET commit: r1598 - in branches/5.2: . MySql.Data/Provider/Source/Types
View as plain text  
Modified:
   branches/5.2/CHANGES
   branches/5.2/MySql.Data/Provider/Source/Types/MySqlString.cs
Log:
Added "nvarchar" and "nchar" to possible data types returned by the DataSourceInformation
  schema collection so procs that use those types with parameters will work (bug #39409)

Modified: branches/5.2/CHANGES
===================================================================
--- branches/5.2/CHANGES	2009-05-05 15:20:53 UTC (rev 1597)
+++ branches/5.2/CHANGES	2009-05-05 19:30:41 UTC (rev 1598)
@@ -1,6 +1,8 @@
 Version 5.2.7
 - fixed procedure parameters collection so that an exception is thrown if we can't get the 
   parameters.  Also used this to optimize the procedure cache optimization
+- Added "nvarchar" and "nchar" to possible data types returned by the DataSourceInformation
+  schema collection so procs that use those types with parameters will work (bug #39409)
 - fixed problem where the connector would incorrectly report the length of utf8 columns on servers
   6.0 and later.  This was caused by 6.0 now using 4 bytes for utf8 columns  
   

Modified: branches/5.2/MySql.Data/Provider/Source/Types/MySqlString.cs
===================================================================
--- branches/5.2/MySql.Data/Provider/Source/Types/MySqlString.cs	2009-05-05 15:20:53 UTC (rev 1597)
+++ branches/5.2/MySql.Data/Provider/Source/Types/MySqlString.cs	2009-05-05 19:30:41 UTC (rev 1598)
@@ -123,11 +123,12 @@
 
 		internal static void SetDSInfo(DataTable dsTable)
 		{
-			string[] types = new string[] { "CHAR", "VARCHAR", "SET", "ENUM", 
-                "TINYTEXT", "TEXT", "MEDIUMTEXT", "LONGTEXT" };
-			MySqlDbType[] dbtype = new MySqlDbType[] { MySqlDbType.String, 
-                MySqlDbType.VarChar, MySqlDbType.Set, MySqlDbType.Enum, MySqlDbType.TinyText,
-                MySqlDbType.Text, MySqlDbType.MediumText, MySqlDbType.LongText };
+			string[] types = new string[] { "CHAR", "NCHAR", "VARCHAR", "NVARCHAR", "SET", 
+                "ENUM", "TINYTEXT", "TEXT", "MEDIUMTEXT", "LONGTEXT" };
+            MySqlDbType[] dbtype = new MySqlDbType[] { MySqlDbType.String, MySqlDbType.String,
+                MySqlDbType.VarChar, MySqlDbType.VarChar, MySqlDbType.Set, MySqlDbType.Enum, 
+                MySqlDbType.TinyText, MySqlDbType.Text, MySqlDbType.MediumText, 
+                MySqlDbType.LongText };
 
 			// we use name indexing because this method will only be called
 			// when GetSchema is called for the DataSourceInformation 
@@ -138,8 +139,8 @@
 				row["TypeName"] = types[x];
 				row["ProviderDbType"] = dbtype[x];
 				row["ColumnSize"] = 0;
-                row["CreateFormat"] = x < 2 ? types[x] + "({0})" : types[x];
-				row["CreateParameters"] = x < 2 ? "size" : null;
+                row["CreateFormat"] = x < 4 ? types[x] + "({0})" : types[x];
+				row["CreateParameters"] = x < 4 ? "size" : null;
 				row["DataType"] = "System.String";
 				row["IsAutoincrementable"] = false;
 				row["IsBestMatch"] = true;

Thread
Connector/NET commit: r1598 - in branches/5.2: . MySql.Data/Provider/Source/Typesrburnett5 May