#At file:///C:/work/connector-net/trunk/ based on revid:vvaintroub@stripped
890 Reggie Burnett 2010-07-02 [merge]
merged
added:
MySql.VisualStudio/DDEX/MySqlDataObjectIdentifierConverter.cs
modified:
CHANGES
MySQLClient.sln
MySql.Data/Provider/Source/CommandBuilder.cs
MySql.VisualStudio/DDEX/MySqlConnectionSupport.cs
MySql.VisualStudio/MySql.VisualStudio.csproj
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES 2010-07-01 22:51:18 +0000
+++ b/CHANGES 2010-07-02 18:41:31 +0000
@@ -17,6 +17,9 @@
connection reset (bug #47153)
- fixed bug that caused the web site config wizard to not appear when working with web applications
as opposed to websites (bug #54571)
+- changed DbCommandBuilder and added a MySqlDataObjectIdentifierConverter so we don't output
+ the databasename in our typed datasets. This allows users to move the dataset to a new
+ database/server with no trouble (bug #33870)
Version 6.3.2 (beta 1)
- added feature where sql queries that are longer than 300 chars are normalized and a new
=== modified file 'MySQLClient.sln'
--- a/MySQLClient.sln 2010-04-09 19:38:48 +0000
+++ b/MySQLClient.sln 2010-07-02 18:41:31 +0000
@@ -231,7 +231,6 @@
{A8E799B1-D6AC-42BD-907E-B213D7E9B3C5}.Commercial|x64.ActiveCfg = Release|Any CPU
{A8E799B1-D6AC-42BD-907E-B213D7E9B3C5}.Commercial|x86.ActiveCfg = Release|Any CPU
{A8E799B1-D6AC-42BD-907E-B213D7E9B3C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A8E799B1-D6AC-42BD-907E-B213D7E9B3C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8E799B1-D6AC-42BD-907E-B213D7E9B3C5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{A8E799B1-D6AC-42BD-907E-B213D7E9B3C5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{A8E799B1-D6AC-42BD-907E-B213D7E9B3C5}.Debug|x64.ActiveCfg = Debug|Any CPU
=== modified file 'MySql.Data/Provider/Source/CommandBuilder.cs'
--- a/MySql.Data/Provider/Source/CommandBuilder.cs 2010-04-22 15:36:59 +0000
+++ b/MySql.Data/Provider/Source/CommandBuilder.cs 2010-07-02 18:41:31 +0000
@@ -223,6 +223,17 @@
#endregion
+ protected override DataTable GetSchemaTable(DbCommand sourceCommand)
+ {
+ DataTable schemaTable = base.GetSchemaTable(sourceCommand);
+
+ foreach (DataRow row in schemaTable.Rows)
+ if (row["BaseSchemaName"].Equals(sourceCommand.Connection.Database))
+ row["BaseSchemaName"] = null;
+
+ return schemaTable;
+ }
+
/// <summary>
///
/// </summary>
=== modified file 'MySql.VisualStudio/DDEX/MySqlConnectionSupport.cs'
--- a/MySql.VisualStudio/DDEX/MySqlConnectionSupport.cs 2010-02-12 18:11:12 +0000
+++ b/MySql.VisualStudio/DDEX/MySqlConnectionSupport.cs 2010-07-02 18:36:52 +0000
@@ -67,7 +67,10 @@
{
return new MySqlDataSourceInformation(Site as DataConnection);
}
- else return base.GetServiceImpl(serviceType);
+ else if (serviceType == typeof(DataObjectIdentifierConverter))
+ return new MySqlDataObjectIdentifierConverter(Site as DataConnection);
+ else
+ return base.GetServiceImpl(serviceType);
}
public override bool Open(bool doPromptCheck)
=== added file 'MySql.VisualStudio/DDEX/MySqlDataObjectIdentifierConverter.cs'
--- a/MySql.VisualStudio/DDEX/MySqlDataObjectIdentifierConverter.cs 1970-01-01 00:00:00 +0000
+++ b/MySql.VisualStudio/DDEX/MySqlDataObjectIdentifierConverter.cs 2010-07-02 18:36:52 +0000
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.VisualStudio.Data.AdoDotNet;
+using Microsoft.VisualStudio.Data;
+using System.Data.Common;
+
+namespace MySql.Data.VisualStudio
+{
+ public class MySqlDataObjectIdentifierConverter : AdoDotNetObjectIdentifierConverter
+ {
+ private DataConnection connection;
+
+ public MySqlDataObjectIdentifierConverter(DataConnection c)
+ : base(c)
+ {
+ connection = c;
+ }
+
+ protected override string BuildString(string typeName, string[] identifierParts, bool forDisplay)
+ {
+ string id = String.Empty;
+
+ if (typeName == "Table")
+ {
+ DbConnection c = connection.ConnectionSupport.ProviderObject as DbConnection;
+
+ if (identifierParts.Length == 1)
+ id = identifierParts[0];
+ if (identifierParts.Length == 2 && identifierParts[0] == c.Database)
+ id = identifierParts[1];
+ if (identifierParts.Length == 3 && identifierParts[1] == c.Database)
+ id = identifierParts[2];
+ }
+ if (id == String.Empty || forDisplay)
+ id = base.BuildString(typeName, identifierParts, forDisplay);
+ return id;
+ }
+
+ protected override string FormatPart(string typeName, object identifierPart, bool withQuotes)
+ {
+ DbConnection c = connection.ConnectionSupport.ProviderObject as DbConnection;
+ if (typeName == "Table" && identifierPart.Equals(c.Database))
+ return null;
+ return base.FormatPart(typeName, identifierPart, withQuotes);
+ }
+ }
+}
=== modified file 'MySql.VisualStudio/MySql.VisualStudio.csproj'
--- a/MySql.VisualStudio/MySql.VisualStudio.csproj 2010-06-10 19:27:42 +0000
+++ b/MySql.VisualStudio/MySql.VisualStudio.csproj 2010-07-02 18:41:31 +0000
@@ -143,6 +143,7 @@
<DependentUpon>MySqlDataConnectionPromptDialog.cs</DependentUpon>
</Compile>
<Compile Include="DDEX\MySqlDataObjectEnumerator.cs" />
+ <Compile Include="DDEX\MySqlDataObjectIdentifierConverter.cs" />
<Compile Include="DDEX\MySqlDataObjectSupport.cs" />
<Compile Include="DDEX\MySqlDataSourceInformation.cs" />
<Compile Include="DDEX\MySqlDataSourceSpecializer.cs" />
Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20100702184131-yshdex0glqn0hkwl.bundle
| Thread |
|---|
| • bzr commit into connector-net-trunk branch (reggie.burnett:890) | Reggie Burnett | 2 Jul |