List:Commits« Previous MessageNext Message »
From:rburnett Date:July 7 2009 5:37pm
Subject:Connector/NET commit: r1670 - in branches/6.0: . MySql.Data/Provider/Properties MySql.Data/Provider/Source MySql.Data/Tests/Source
View as plain text  
Modified:
   branches/6.0/CHANGES
   branches/6.0/MySql.Data/Provider/Properties/Resources.Designer.cs
   branches/6.0/MySql.Data/Provider/Properties/Resources.resx
   branches/6.0/MySql.Data/Provider/Source/CommandBuilder.cs
   branches/6.0/MySql.Data/Tests/Source/StoredProcedure.cs
Log:
- we are now throwing an exception when DeriveParameters is unable to successfully populate
  the parameters array.  This exception explains what is wrong (bug #45952)  


Modified: branches/6.0/CHANGES
===================================================================
--- branches/6.0/CHANGES	2009-07-07 13:40:06 UTC (rev 1669)
+++ branches/6.0/CHANGES	2009-07-07 17:37:24 UTC (rev 1670)
@@ -1,6 +1,8 @@
 Version 6.0.5
 - fixed bug where our internal driver was using a batched command even if the user had added
   'allow batch=false' to their connection string (bug #45502)
+- we are now throwing an exception when DeriveParameters is unable to successfully populate
+  the parameters array.  This exception explains what is wrong (bug #45952)  
   
 Version 6.0.4
 - fixed regression where using stored procs with datasets (bug #44460)

Modified: branches/6.0/MySql.Data/Provider/Properties/Resources.Designer.cs
===================================================================
--- branches/6.0/MySql.Data/Provider/Properties/Resources.Designer.cs	2009-07-07 13:40:06 UTC (rev 1669)
+++ branches/6.0/MySql.Data/Provider/Properties/Resources.Designer.cs	2009-07-07 17:37:24 UTC (rev 1670)
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.20506.1
+//     Runtime Version:2.0.50727.3053
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -19,7 +19,7 @@
     // class via a tool like ResGen or Visual Studio.
     // To add or remove a member, edit your .ResX file then rerun ResGen
     // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     public class Resources {
@@ -700,6 +700,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Unable to derive stored routine parameters.  The &apos;Parameters&apos; information schema table is not available and access to the stored procedure body has been disabled..
+        /// </summary>
+        public static string UnableToDeriveParameters {
+            get {
+                return ResourceManager.GetString("UnableToDeriveParameters", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to An error occured attempting to enumerate the user-defined functions.  Do you have SELECT privileges on the mysql.func table?.
         /// </summary>
         public static string UnableToEnumerateUDF {

Modified: branches/6.0/MySql.Data/Provider/Properties/Resources.resx
===================================================================
--- branches/6.0/MySql.Data/Provider/Properties/Resources.resx	2009-07-07 13:40:06 UTC (rev 1669)
+++ branches/6.0/MySql.Data/Provider/Properties/Resources.resx	2009-07-07 17:37:24 UTC (rev 1670)
@@ -334,7 +334,10 @@
 	<data name="ValueNotSupportedForGuid" xml:space="preserve">
     <value>The requested column value could not be treated as or conveted to a Guid.</value>
   </data>
-	<data name="UnableToRetrieveParameters" xml:space="preserve">
+  <data name="UnableToDeriveParameters" xml:space="preserve">
+    <value>Unable to derive stored routine parameters.  The 'Parameters' information schema table is not available and access to the stored procedure body has been disabled.</value>
+  </data>
+  <data name="UnableToRetrieveParameters" xml:space="preserve">
     <value>Unable to retrieve stored routine parameters.  Either grant access to the routine or add the 'Use Procedure Bodies=false' option to your connection string.</value>
   </data>
 	<data name="UnableToEnumerateUDF" xml:space="preserve">    

Modified: branches/6.0/MySql.Data/Provider/Source/CommandBuilder.cs
===================================================================
--- branches/6.0/MySql.Data/Provider/Source/CommandBuilder.cs	2009-07-07 13:40:06 UTC (rev 1669)
+++ branches/6.0/MySql.Data/Provider/Source/CommandBuilder.cs	2009-07-07 17:37:24 UTC (rev 1670)
@@ -108,6 +108,8 @@
             if (spName.IndexOf(".") == -1)
                 spName = command.Connection.Database + "." + spName;
             DataSet ds = command.Connection.ProcedureCache.GetProcedure(command.Connection, spName);
+            if (!ds.Tables.Contains("Procedure Parameters"))
+                throw new MySqlException(Resources.UnableToDeriveParameters);
 
             DataTable parameters = ds.Tables["Procedure Parameters"];
             DataTable procTable = ds.Tables["Procedures"];

Modified: branches/6.0/MySql.Data/Tests/Source/StoredProcedure.cs
===================================================================
--- branches/6.0/MySql.Data/Tests/Source/StoredProcedure.cs	2009-07-07 13:40:06 UTC (rev 1669)
+++ branches/6.0/MySql.Data/Tests/Source/StoredProcedure.cs	2009-07-07 17:37:24 UTC (rev 1670)
@@ -1263,5 +1263,25 @@
                 Assert.AreEqual("World", dt.Rows[0]["P2"]);
             }
         }
+
+        [Test]
+        public void DeriveParameters()
+        {
+            if (Version < new Version(5, 0)) return;
+            if (Version > new Version(6, 0, 6)) return;
+
+            execSQL(@"CREATE  PROCEDURE spTest (id INT, name VARCHAR(20))
+                    BEGIN SELECT name; END");
+            MySqlCommand cmd = new MySqlCommand("spTest", conn);
+            cmd.CommandType = CommandType.StoredProcedure;
+            try
+            {
+                MySqlCommandBuilder.DeriveParameters(cmd);
+                Assert.Fail("This should have failed");
+            }
+            catch (MySqlException ex)
+            {
+            }
+        }
     }
 }

Thread
Connector/NET commit: r1670 - in branches/6.0: . MySql.Data/Provider/Properties MySql.Data/Provider/Source MySql.Data/Tests/Sourcerburnett7 Jul