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


Modified: branches/1.0/CHANGES
===================================================================
--- branches/1.0/CHANGES	2006-12-11 21:52:43 UTC (rev 489)
+++ branches/1.0/CHANGES	2006-12-11 21:58:34 UTC (rev 490)
@@ -18,6 +18,7 @@
     Added 'Ignore Prepare' connection string option for disabling prepared
          statements application-wide    
     A nicer exception is displayed if you have added a parameter without the parameter marker.
+    Improved CommandBuilder.DeriveParameters to use the procedure cache if possible
     
 Version 1.0.8 RC
 

Modified: branches/1.0/TestSuite/StoredProcedure.cs
===================================================================
--- branches/1.0/TestSuite/StoredProcedure.cs	2006-12-11 21:52:43 UTC (rev 489)
+++ branches/1.0/TestSuite/StoredProcedure.cs	2006-12-11 21:58:34 UTC (rev 490)
@@ -40,7 +40,7 @@
 		[TestFixtureSetUp]
 		public void FixtureSetup()
 		{
-			csAdditions = ";pooling=false;procedure cache size=0";
+			csAdditions = ";pooling=false;procedure cache size=0;";
 			Open();
 		}
 

Modified: branches/1.0/mysqlclient/CommandBuilder.cs
===================================================================
--- branches/1.0/mysqlclient/CommandBuilder.cs	2006-12-11 21:52:43 UTC (rev 489)
+++ branches/1.0/mysqlclient/CommandBuilder.cs	2006-12-11 21:58:34 UTC (rev 490)
@@ -139,17 +139,15 @@
 		public static void DeriveParameters(MySqlCommand command)
 		{
 			if (!command.Connection.driver.Version.isAtLeast(5, 0, 0))
-				throw new MySqlException("DeriveParameters is not supported on versions " +
+				throw new MySqlException("DeriveParameters is not supported on MySQL versions " +
 					"prior to 5.0");
-			StoredProcedure sp = new StoredProcedure(command.Connection);
 
-			string spName = command.CommandText;
-			int dotIndex = spName.IndexOf('.');
-			if (dotIndex == -1)
-				spName = command.Connection.Database + "." + spName;
+            // retrieve the proc definitino from the cache.
+            string spName = command.CommandText;
+            if (spName.IndexOf(".") == -1)
+                spName = command.Connection.Database + "." + spName;
+            ArrayList parameters = command.Connection.ProcedureCache.GetProcedure(command.Connection, spName);
 
-			ArrayList parameters = sp.DiscoverParameters(spName);
-
 			command.Parameters.Clear();
 			foreach (MySqlParameter p in parameters)
 				command.Parameters.Add(p);

Thread
Connector/NET commit: r490 - in branches/1.0: . TestSuite mysqlclientrburnett11 Dec