#At file:///C:/work/connector-net/6.1/ based on revid:reggie.burnett@stripped
831 Reggie Burnett 2010-07-27 [merge]
merged
modified:
MySql.VisualStudio/DDEX/MySqlConnectionProperties.cs
MySql.VisualStudio/Nodes/StoredProcedureNode.cs
=== modified file 'MySql.VisualStudio/DDEX/MySqlConnectionProperties.cs'
=== modified file 'MySql.VisualStudio/DDEX/MySqlConnectionProperties.cs'
--- a/MySql.VisualStudio/DDEX/MySqlConnectionProperties.cs 2010-07-27 19:31:53 +0000
+++ b/MySql.VisualStudio/DDEX/MySqlConnectionProperties.cs 2010-07-27 19:42:46 +0000
@@ -36,7 +36,6 @@
/// </summary>
public MySqlConnectionProperties() : base(InvariantName)
{
- ConnectionStringBuilder["Respect Binary Flags"] = false;
}
/// <summary>
=== modified file 'MySql.VisualStudio/Nodes/StoredProcedureNode.cs'
--- a/MySql.VisualStudio/Nodes/StoredProcedureNode.cs 2009-04-23 14:37:37 +0000
+++ b/MySql.VisualStudio/Nodes/StoredProcedureNode.cs 2010-07-27 19:42:46 +0000
@@ -121,21 +121,44 @@
{
try
{
- DataTable dt = GetDataTable(String.Format("SHOW CREATE {0} `{1}`.`{2}`",
- IsFunction ? "FUNCTION" : "PROCEDURE", Database, Name));
-
- sql_mode = dt.Rows[0][1] as string;
- string sql = dt.Rows[0][2] as string;
+ string sql = GetStoredProcedureBody(String.Format(
+ "SHOW CREATE {0} `{1}`.`{2}`",
+ IsFunction ? "FUNCTION" : "PROCEDURE", Database, Name), out sql_mode);
editor.Text = ChangeSqlTypeTo(sql, "ALTER");
Dirty = false;
}
catch (Exception ex)
{
- MessageBox.Show("Unable to load object with error: " + ex.Message);
+ MessageBox.Show("Unable to load the stored procedure for editing");
}
}
}
+ private string GetStoredProcedureBody(string sql, out string sql_mode)
+ {
+ string body = null;
+
+ DbConnection conn = (DbConnection)HierarchyAccessor.Connection.GetLockedProviderObject();
+ try
+ {
+
+ DbCommand cmd = MySqlProviderObjectFactory.Factory.CreateCommand();
+ cmd.Connection = conn;
+ cmd.CommandText = sql;
+ using (DbDataReader reader = cmd.ExecuteReader())
+ {
+ reader.Read();
+ sql_mode = reader.GetString(1);
+ body = reader.GetString(2);
+ }
+ return body;
+ }
+ finally
+ {
+ HierarchyAccessor.Connection.UnlockProviderObject();
+ }
+ }
+
/// <summary>
/// We override save here so we can change the sql from create to alter on
/// first save
Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20100727194328-9d2yck7m4wfae7tw.bundle
| Thread |
|---|
| • bzr commit into connector-net-6.1 branch (reggie.burnett:831) | Reggie Burnett | 27 Jul |