List:Commits« Previous MessageNext Message »
From:rburnett Date:December 11 2006 10:52pm
Subject:Connector/NET commit: r489 - in trunk: . TestSuite mysqlclient/core
View as plain text  
Modified:
   trunk/CHANGES
   trunk/TestSuite/StoredProcedure.cs
   trunk/mysqlclient/core/CommandBuilder.cs
Log:
  Improved CommandBuilder.DeriveParameters to use the procedure cache if possible


Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES	2006-12-08 20:54:42 UTC (rev 488)
+++ trunk/CHANGES	2006-12-11 21:52:43 UTC (rev 489)
@@ -4,11 +4,13 @@
   ----------
   Bug #23687 Deleting a connection to a disconnected server causes a failed assertion 
   Bug #24565 Inferring DbType fails when reusing commands and the first time the value is
nul 
+  Bug #24661 mysql-connector-net-5.0.2-beta Driver.IsTooOld() Error.... 
 
   Other changes
   -------------
   SSL now working.  [Thanks Alessandro Muzzetta]
   Fixed ViewColumns GetSchema collection
+  Improved CommandBuilder.DeriveParameters to use the procedure cache if possible
 
 Version 5.0.2 11-3-2006
 

Modified: trunk/TestSuite/StoredProcedure.cs
===================================================================
--- trunk/TestSuite/StoredProcedure.cs	2006-12-08 20:54:42 UTC (rev 488)
+++ trunk/TestSuite/StoredProcedure.cs	2006-12-11 21:52:43 UTC (rev 489)
@@ -40,7 +40,7 @@
 		[TestFixtureSetUp]
 		public void FixtureSetup()
 		{
-			csAdditions = ";pooling=false;procedure cache size=0";
+			csAdditions = ";pooling=false;procedure cache size=0;";
 			Open();
 		}
 

Modified: trunk/mysqlclient/core/CommandBuilder.cs
===================================================================
--- trunk/mysqlclient/core/CommandBuilder.cs	2006-12-08 20:54:42 UTC (rev 488)
+++ trunk/mysqlclient/core/CommandBuilder.cs	2006-12-11 21:52:43 UTC (rev 489)
@@ -92,24 +92,14 @@
 			if (!command.Connection.driver.Version.isAtLeast(5,0,0))
 				throw new MySqlException("DeriveParameters is not supported on versions " +
 					"prior to 5.0");
-            StoredProcedure sp = new StoredProcedure(command.Connection, "");
 
-            string schema = command.Connection.Database;
+            // retrieve the proc definitino from the cache.
             string spName = command.CommandText;
-            int dotIndex = spName.IndexOf('.');
-            if (dotIndex != -1)
-            {
-                schema = spName.Substring(0, dotIndex);
-                spName = spName.Substring(dotIndex + 1);
-            }
+            if (spName.IndexOf(".") == -1)
+                spName = command.Connection.Database + "." + spName;
+            DataSet ds =
command.Connection.ProcedureCache.GetProcedure(command.Connection, spName);
 
-            // now retrieve the paramters using GetSchema
-            string[] restrictions = new string[5];
-            restrictions[1] = schema;
-            restrictions[2] = spName;
-            DataTable parameters = command.Connection.GetSchema(
-                "procedure parameters", restrictions);
-
+            DataTable parameters = ds.Tables["Procedure Parameters"];
             command.Parameters.Clear();
             foreach (DataRow row in parameters.Rows)
             {

Thread
Connector/NET commit: r489 - in trunk: . TestSuite mysqlclient/corerburnett11 Dec