List:Commits« Previous MessageNext Message »
From:rburnett Date:July 10 2007 5:56pm
Subject:Connector/NET commit: r780 - in branches/5.0: . Driver/Source TestSuite/Source
View as plain text  
Modified:
   branches/5.0/CHANGES
   branches/5.0/Driver/Source/Statement.cs
   branches/5.0/TestSuite/Source/ParameterTests.cs
Log:
Bug #29312  	System.FormatException if parameter not found

Fixed problem where a statement that has parameters that is executed without
defining those parameters would throw a System.FormatException rather than
a MySqlException (bug #29312)    


Modified: branches/5.0/CHANGES
===================================================================
--- branches/5.0/CHANGES	2007-07-09 21:37:18 UTC (rev 779)
+++ branches/5.0/CHANGES	2007-07-10 15:56:19 UTC (rev 780)
@@ -18,6 +18,9 @@
   - Fixed problem with calling stored procedures in databases that have hyphens
     in their names.  We were not using backticks to quote the database and sproc name
     when querying for metadata. (Bug #29526)
+  - Fixed problem where a statement that has parameters that is executed without
+    defining those parameters would throw a System.FormatException rather than
+    a MySqlException (bug #29312)    
     
 Version 5.0.7 5/16/2007
 

Modified: branches/5.0/Driver/Source/Statement.cs
===================================================================
--- branches/5.0/Driver/Source/Statement.cs	2007-07-09 21:37:18 UTC (rev 779)
+++ branches/5.0/Driver/Source/Statement.cs	2007-07-10 15:56:19 UTC (rev 780)
@@ -167,7 +167,7 @@
                 if (Connection.Settings.UseOldSyntax)
                     return false;
                 throw new MySqlException(
-                    String.Format(Resources.ParameterMustBeDefined));
+                    String.Format(Resources.ParameterMustBeDefined, parmName));
             }
 
             parameter.Serialize(stream, false);

Modified: branches/5.0/TestSuite/Source/ParameterTests.cs
===================================================================
--- branches/5.0/TestSuite/Source/ParameterTests.cs	2007-07-09 21:37:18 UTC (rev 779)
+++ branches/5.0/TestSuite/Source/ParameterTests.cs	2007-07-10 15:56:19 UTC (rev 780)
@@ -508,5 +508,25 @@
             cmd.Parameters.RemoveAt("?id1");
             MySqlParameter p = cmd.Parameters["?id6"];
         }
+
+        /// <summary>
+        /// Bug #29312  	System.FormatException if parameter not found
+        /// </summary>
+        [Test]
+        public void MissingParameter()
+        {
+            MySqlCommand cmd = new MySqlCommand("INSERT INTO test(id) VALUES (?id)",
conn);
+            try
+            {
+                cmd.ExecuteNonQuery();
+            }
+            catch (MySqlException)
+            {
+            }
+            catch (Exception ex)
+            {
+                Assert.Fail(ex.Message);
+            }
+        }
     }
 }

Thread
Connector/NET commit: r780 - in branches/5.0: . Driver/Source TestSuite/Sourcerburnett10 Jul