From: Reggie Burnett Date: June 22 2011 3:57pm Subject: bzr commit into connector-net-6.4 branch (reggie.burnett:1008) List-Archive: http://lists.mysql.com/commits/139696 Message-Id: <201106221557.p5MFveUg023785@acsmt357.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///C:/Users/Reggie/work/connector-net/6.4/ based on revid:reggie.burnett@stripped 1008 Reggie Burnett 2011-06-22 [merge] merged modified: MySQLClient.sln Source/MySql.Data.Entity/MySql.Data.Entity.csproj Source/MySql.Data/MySql.Data.csproj Source/MySql.VisualStudio/DDEX/MySqlDataObjectEnumerator.cs Source/MySql.VisualStudio/DDEX/MySqlDataObjectSupport.xml Source/MySql.VisualStudio/MySql.VisualStudio.csproj Source/MySql.Web/MySql.Web.csproj package.proj === modified file 'MySQLClient.sln' === modified file 'MySQLClient.sln' --- a/MySQLClient.sln 2011-06-22 03:09:40 +0000 +++ b/MySQLClient.sln 2011-06-22 15:56:52 +0000 @@ -206,6 +206,7 @@ {DC3517FF-AC26-4755-9B7A-EF658FF69593}.Release|x64.ActiveCfg = Release|Any CPU {DC3517FF-AC26-4755-9B7A-EF658FF69593}.Release|x86.ActiveCfg = Release|Any CPU {F533FC43-6C05-4A64-8AF6-72B690EB06C3}.Commercial|Any CPU.ActiveCfg = Commercial|x86 + {F533FC43-6C05-4A64-8AF6-72B690EB06C3}.Commercial|Any CPU.Build.0 = Commercial|x86 {F533FC43-6C05-4A64-8AF6-72B690EB06C3}.Commercial|Mixed Platforms.ActiveCfg = Commercial|x86 {F533FC43-6C05-4A64-8AF6-72B690EB06C3}.Commercial|Mixed Platforms.Build.0 = Commercial|x86 {F533FC43-6C05-4A64-8AF6-72B690EB06C3}.Commercial|x64.ActiveCfg = Commercial|x86 === modified file 'Source/MySql.Data.Entity/MySql.Data.Entity.csproj' --- a/Source/MySql.Data.Entity/MySql.Data.Entity.csproj 2011-06-21 18:51:27 +0000 +++ b/Source/MySql.Data.Entity/MySql.Data.Entity.csproj 2011-06-22 14:06:05 +0000 @@ -37,7 +37,7 @@ full false bin\Debug\ - DEBUG;TRACE + TRACE;DEBUG;CLR4 prompt 4 AllRules.ruleset @@ -46,7 +46,7 @@ pdbonly true bin\Release\ - TRACE + TRACE;CLR4 prompt 4 AllRules.ruleset === modified file 'Source/MySql.Data/MySql.Data.csproj' --- a/Source/MySql.Data/MySql.Data.csproj 2011-06-21 19:32:35 +0000 +++ b/Source/MySql.Data/MySql.Data.csproj 2011-06-22 15:57:37 +0000 @@ -33,7 +33,7 @@ full false bin\Debug\ - DEBUG;TRACE + DEBUG;TRACE;CLR4 prompt 4 AllRules.ruleset @@ -42,7 +42,7 @@ pdbonly true bin\Release\ - TRACE + TRACE;CLR4 prompt 4 AllRules.ruleset === modified file 'Source/MySql.VisualStudio/DDEX/MySqlDataObjectEnumerator.cs' --- a/Source/MySql.VisualStudio/DDEX/MySqlDataObjectEnumerator.cs 2011-02-14 17:19:36 +0000 +++ b/Source/MySql.VisualStudio/DDEX/MySqlDataObjectEnumerator.cs 2011-06-22 15:56:36 +0000 @@ -75,20 +75,60 @@ if (typeName == null) throw new ArgumentNullException("typeName"); - Debug.Assert(typeName == String.Empty); - - DbConnection conn = (DbConnection)Connection.GetLockedProviderObject(); - DataTable table = new DataTable(); - table.Columns.Add("SERVER_NAME"); - table.Columns.Add("CATALOG_NAME"); - table.Columns.Add("SCHEMA_NAME"); - DataRow row = table.NewRow(); - row["SERVER_NAME"] = conn.DataSource; - row["SCHEMA_NAME"] = conn.Database; - table.Rows.Add(row); - Connection.UnlockProviderObject(); - - return new AdoDotNetDataTableReader(table); + if (typeName == String.Empty) + return EnumerateRoot(); + else return EnumerateSchemaObjects(parameters[0] as string, restrictions); + } + + private DataReader EnumerateRoot() + { + DbConnection conn = (DbConnection)Connection.GetLockedProviderObject(); + try + { + DataTable table = new DataTable(); + table.Columns.Add("SERVER_NAME"); + table.Columns.Add("CATALOG_NAME"); + table.Columns.Add("SCHEMA_NAME"); + DataRow row = table.NewRow(); + row["SERVER_NAME"] = conn.DataSource; + row["SCHEMA_NAME"] = conn.Database; + table.Rows.Add(row); + return new AdoDotNetDataTableReader(table); + } + finally + { + Connection.UnlockProviderObject(); + } + } + + private DataReader EnumerateSchemaObjects(string typeName, object[] restrictions) + { + DbConnection conn = (DbConnection)Connection.GetLockedProviderObject(); + try + { + string[] rest; + DataTable tables = null; + + if (restrictions != null) + { + int i = 0; + rest = new string[restrictions.Length]; + foreach (object o in restrictions) + rest[i++] = (string)o; + tables = conn.GetSchema(typeName, rest); + } + else + tables = conn.GetSchema(typeName); + + foreach (DataRow row in tables.Rows) + row["TABLE_CATALOG"] = DBNull.Value; + return new AdoDotNetDataTableReader(tables); + } + finally + { + Connection.UnlockProviderObject(); + } + } /* // Chose restricitions array @@ -132,7 +172,6 @@ // Enumerete objects in to DataReader return new AdoDotNetDataTableReader(table);*/ - } #region Connection wrapper /// === modified file 'Source/MySql.VisualStudio/DDEX/MySqlDataObjectSupport.xml' --- a/Source/MySql.VisualStudio/DDEX/MySqlDataObjectSupport.xml 2011-02-14 17:19:36 +0000 +++ b/Source/MySql.VisualStudio/DDEX/MySqlDataObjectSupport.xml 2011-06-22 15:56:36 +0000 @@ -84,10 +84,9 @@ - - - + + + @@ -166,7 +165,7 @@ - + @@ -300,7 +299,7 @@ - + === modified file 'Source/MySql.VisualStudio/MySql.VisualStudio.csproj' --- a/Source/MySql.VisualStudio/MySql.VisualStudio.csproj 2011-06-21 19:16:59 +0000 +++ b/Source/MySql.VisualStudio/MySql.VisualStudio.csproj 2011-06-22 15:57:37 +0000 @@ -41,7 +41,7 @@ full false bin\Debug\ - DEBUG;TRACE + TRACE;DEBUG;CLR4 prompt 4 false @@ -51,7 +51,7 @@ pdbonly true bin\Release\ - TRACE + TRACE;CLR4 prompt 4 AllRules.ruleset === modified file 'Source/MySql.Web/MySql.Web.csproj' --- a/Source/MySql.Web/MySql.Web.csproj 2011-06-21 18:51:27 +0000 +++ b/Source/MySql.Web/MySql.Web.csproj 2011-06-22 14:06:05 +0000 @@ -41,7 +41,7 @@ full false bin\Debug\ - DEBUG;TRACE + TRACE;DEBUG;CLR4 prompt 4 1699 @@ -53,7 +53,7 @@ pdbonly true bin\Release\ - TRACE + TRACE;CLR4 prompt 4 1699 === modified file 'package.proj' --- a/package.proj 2011-04-22 14:29:34 +0000 +++ b/package.proj 2011-06-22 15:56:52 +0000 @@ -28,7 +28,7 @@ - + - - - - - + + + + + - - + + + + No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).