Modified:
trunk/Driver/Source/ISSchemaProvider.cs
trunk/TestSuite/Source/StoredProcedure.cs
Log:
Bug #29526 syntax error: "show create procedure" with catalog names containing hyphens
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.
Modified: trunk/Driver/Source/ISSchemaProvider.cs
===================================================================
--- trunk/Driver/Source/ISSchemaProvider.cs 2007-07-18 22:04:49 UTC (rev 789)
+++ trunk/Driver/Source/ISSchemaProvider.cs 2007-07-18 22:09:26 UTC (rev 790)
@@ -294,7 +294,7 @@
foreach (DataRow routine in routines.Rows)
{
- string showCreateSql = String.Format("SHOW CREATE {0} {1}.{2}",
+ string showCreateSql = String.Format("SHOW CREATE {0} `{1}`.`{2}`",
routine["ROUTINE_TYPE"], routine["ROUTINE_SCHEMA"],
routine["ROUTINE_NAME"]);
cmd.CommandText = showCreateSql;
Modified: trunk/TestSuite/Source/StoredProcedure.cs
===================================================================
--- trunk/TestSuite/Source/StoredProcedure.cs 2007-07-18 22:04:49 UTC (rev 789)
+++ trunk/TestSuite/Source/StoredProcedure.cs 2007-07-18 22:09:26 UTC (rev 790)
@@ -1328,5 +1328,31 @@
cmd.Parameters.Add(param);
cmd.ExecuteNonQuery();
}
+
+ /// <summary>
+ /// Bug #29526 syntax error: "show create procedure" with catalog names containing hyphens
+ /// </summary>
+ [Test]
+ public void CatalogWithHyphens()
+ {
+ try
+ {
+ suExecSQL("CREATE DATABASE `foo-bar`");
+ string connStr = GetConnectionString(false) + ";database=foo-bar";
+ MySqlConnection c = new MySqlConnection(connStr);
+ c.Open();
+
+ MySqlCommand cmd = new MySqlCommand("CREATE PROCEDURE spTest() BEGIN SELECT 1; END", c);
+ cmd.ExecuteNonQuery();
+
+ cmd.CommandText = "spTest";
+ cmd.CommandType = CommandType.StoredProcedure;
+ Assert.AreEqual(1, cmd.ExecuteScalar());
+ }
+ finally
+ {
+ suExecSQL("DROP DATABASE IF EXISTS `foo-bar`");
+ }
+ }
}
}
| Thread |
|---|
| • Connector/NET commit: r790 - in trunk: Driver/Source TestSuite/Source | rburnett | 19 Jul |