mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-11 18:48:36 -05:00
fixed the oe integration test failing in appveyor (#339)
* fixed the oe integration test failing in appveyor
This commit is contained in:
@@ -298,6 +298,10 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Logger.Write(LogLevel.Error, $"Failed populating oe children error:{ex.Message} {ex.Source}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
EndChildrenInit();
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
internal async Task<ObjectExplorerSession> DoCreateSession(ConnectionDetails connectionDetails, string uri)
|
||||
{
|
||||
ObjectExplorerSession session;
|
||||
|
||||
connectionDetails.PersistSecurityInfo = true;
|
||||
ConnectParams connectParams = new ConnectParams() { OwnerUri = uri, Connection = connectionDetails };
|
||||
|
||||
ConnectionCompleteParams connectionResult = await Connect(connectParams);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Microsoft.SqlServer.Management.Smo;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
{
|
||||
@@ -55,19 +56,26 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
|
||||
private static string GetCustomizedLabel(Column column, UserDefinedDataTypeCollection uddts)
|
||||
{
|
||||
if (column.Computed)
|
||||
try
|
||||
{
|
||||
return GetComutedColumnLabel(column, uddts);
|
||||
if (column.Computed)
|
||||
{
|
||||
return GetComputedColumnLabel(column, uddts);
|
||||
}
|
||||
else if (column.IsColumnSet)
|
||||
{
|
||||
return GetColumnSetLabel(column, uddts);
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetSimpleColumnLabel(column, uddts);
|
||||
}
|
||||
}
|
||||
else if (column.IsColumnSet)
|
||||
catch(Exception ex)
|
||||
{
|
||||
return GetColumnSetLabel(column, uddts);
|
||||
Logger.Write(LogLevel.Error, $"Failed to get customized column name. error:{ex.Message}");
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetSimpleColumnLabel(column, uddts);
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private static string GetTypeSpecifierLabel(DataType dataType, UserDefinedDataTypeCollection uddts)
|
||||
@@ -88,10 +96,16 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
|
||||
}
|
||||
|
||||
if(dataType.SqlDataType == SqlDataType.UserDefinedDataType && uddts != null && uddts.Contains(dataType.Name))
|
||||
if(dataType.SqlDataType == SqlDataType.UserDefinedDataType && uddts != null)
|
||||
{
|
||||
var uddt = uddts[dataType.Name];
|
||||
typeName += $"({uddt.SystemType})";
|
||||
foreach (UserDefinedDataType item in uddts)
|
||||
{
|
||||
if(item.Name == dataType.Name)
|
||||
{
|
||||
typeName += $"({item.SystemType})";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// These types support Length
|
||||
@@ -214,7 +228,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
isNullable);
|
||||
}
|
||||
|
||||
private static string GetComutedColumnLabel(Column column, UserDefinedDataTypeCollection uddts)
|
||||
private static string GetComputedColumnLabel(Column column, UserDefinedDataTypeCollection uddts)
|
||||
{
|
||||
string columnType = null;
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Failed to run OE test. uri:{uri} error:{ex.Message}");
|
||||
Console.WriteLine($"Failed to run OE test. uri:{uri} error:{ex.Message} {ex.StackTrace}");
|
||||
Assert.False(true, ex.Message);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
NodeType: Table Label: dbo.tableWithColumnset
|
||||
NodeType: Column Label: i (int, null)
|
||||
NodeType: Column Label: cs (Column Set, null)
|
||||
NodeType: Table Label: Employee_Temporal (System-Versioned)
|
||||
NodeType: Column Label: BusinessEntityID (PK, int, not null)
|
||||
NodeType: Column Label: NationalIDNumber (nvarchar(15), not null)
|
||||
|
||||
@@ -389,4 +389,6 @@
|
||||
[LoginID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
|
||||
/****** Column Set ***/
|
||||
CREATE TABLE tableWithColumnset (i int SPARSE, cs xml column_set FOR ALL_SPARSE_COLUMNS);
|
||||
Reference in New Issue
Block a user