List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:July 2 2010 6:39pm
Subject:bzr commit into connector-net-6.1 branch (reggie.burnett:824)
View as plain text  
#At file:///C:/work/connector-net/6.1/ based on revid:vvaintroub@stripped

  824 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:48:45 +0000
+++ b/CHANGES	2010-07-02 18:39:01 +0000
@@ -13,6 +13,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.1.4
 - SessionProvider : Avoid SQLNullValueException if lockId returned by select is 

=== modified file 'MySQLClient.sln'
--- a/MySQLClient.sln	2010-01-14 22:35:44 +0000
+++ b/MySQLClient.sln	2010-07-02 18:39:01 +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
@@ -255,7 +254,6 @@
 		{77EC4E20-293A-48BA-8415-D0AD869D91FA}.Commercial|x64.ActiveCfg = Release|Any CPU
 		{77EC4E20-293A-48BA-8415-D0AD869D91FA}.Commercial|x86.ActiveCfg = Release|Any CPU
 		{77EC4E20-293A-48BA-8415-D0AD869D91FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{77EC4E20-293A-48BA-8415-D0AD869D91FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{77EC4E20-293A-48BA-8415-D0AD869D91FA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
 		{77EC4E20-293A-48BA-8415-D0AD869D91FA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
 		{77EC4E20-293A-48BA-8415-D0AD869D91FA}.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:30:24 +0000
+++ b/MySql.Data/Provider/Source/CommandBuilder.cs	2010-07-02 18:39:01 +0000
@@ -189,6 +189,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	2009-11-12 12:38:55 +0000
+++ b/MySql.VisualStudio/MySql.VisualStudio.csproj	2010-07-02 18:39:01 +0000
@@ -142,6 +142,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-20100702183901-moja9gyw81vkypu8.bundle
Thread
bzr commit into connector-net-6.1 branch (reggie.burnett:824) Reggie Burnett2 Jul