List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:August 11 2010 10:09pm
Subject:bzr commit into connector-net-6.0 branch (reggie.burnett:833) Bug#50671
View as plain text  
#At file:///C:/bzr-connector-net/6.0/ based on revid:vvaintroub@stripped

  833 Reggie Burnett	2010-08-11
      - fixed stored procedure enumeration code that would barf if a proc was used in a dataset
        that did not actually return any resultsets (bug #50671)

    modified:
      CHANGES
      MySql.Data/Tests/Source/ScriptExecution.cs
      MySql.VisualStudio/DDEX/StoredProcedureColumnEnumerator.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES	2010-08-06 10:26:14 +0000
+++ b/CHANGES	2010-08-11 22:09:15 +0000
@@ -27,6 +27,8 @@
   database/server with no trouble (bug #33870)
 - added code to default 'respect binary flags' in the visual studio wizard so that older
   versions of MySQL will work when creating/editing stored procedures (bug #55170)
+- fixed stored procedure enumeration code that would barf if a proc was used in a dataset
+  that did not actually return any resultsets (bug #50671)
 
 Version 6.0.6
 - When sending file to server (LOAD DATA INFILE) open the file for read only, not for read/write

=== modified file 'MySql.Data/Tests/Source/ScriptExecution.cs'
--- a/MySql.Data/Tests/Source/ScriptExecution.cs	2010-02-15 21:26:44 +0000
+++ b/MySql.Data/Tests/Source/ScriptExecution.cs	2010-08-11 22:09:15 +0000
@@ -198,7 +198,7 @@
         [Test]
         public void DelimiterInScriptV2()
         {
-            var sql = new StringBuilder();
+            StringBuilder sql = new StringBuilder();
 
             sql.AppendLine("DELIMITER MySuperDelimiter");
             sql.AppendLine("CREATE PROCEDURE TestProcedure1()");
@@ -212,7 +212,7 @@
 
             sql.AppendLine("DELIMITER ;");
 
-            var script = new MySqlScript(conn, sql.ToString());
+            MySqlScript script = new MySqlScript(conn, sql.ToString());
             script.Execute();
         }
 

=== modified file 'MySql.VisualStudio/DDEX/StoredProcedureColumnEnumerator.cs'
--- a/MySql.VisualStudio/DDEX/StoredProcedureColumnEnumerator.cs	2009-05-05 14:20:53 +0000
+++ b/MySql.VisualStudio/DDEX/StoredProcedureColumnEnumerator.cs	2010-08-11 22:09:15 +0000
@@ -58,15 +58,19 @@
                 using (IDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
                 {
                     DataTable dt = reader.GetSchemaTable();
-                    dt.Columns.Add(new DataColumn("RoutineName", typeof(string)));
-                    foreach (DataRow row in dt.Rows)
+                    if (dt == null)
+                        dt = new DataTable();
+                    else
                     {
-                        row["RoutineName"] = restrictions[2];
-                        string basedb = row["BaseSchemaName"] as string;
-                        if (String.IsNullOrEmpty(basedb) || row["BaseSchemaName"] == DBNull.Value)
-                            row["BaseSchemaName"] = cmd.Connection.Database;
+                        dt.Columns.Add(new DataColumn("RoutineName", typeof(string)));
+                        foreach (DataRow row in dt.Rows)
+                        {
+                            row["RoutineName"] = restrictions[2];
+                            string basedb = row["BaseSchemaName"] as string;
+                            if (String.IsNullOrEmpty(basedb) || row["BaseSchemaName"] == DBNull.Value)
+                                row["BaseSchemaName"] = cmd.Connection.Database;
+                        }
                     }
-
                     return new AdoDotNetDataTableReader(dt);
                 }
             }


Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20100811220915-ncmk1c4m9witqcus.bundle
Thread
bzr commit into connector-net-6.0 branch (reggie.burnett:833) Bug#50671Reggie Burnett12 Aug