handle UDT type (#1424)

This commit is contained in:
Alan Ren
2022-03-11 18:10:08 -08:00
committed by GitHub
parent d62b0f7609
commit b495ea7475
2 changed files with 11 additions and 1 deletions

View File

@@ -182,7 +182,11 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage
else
{
Type type;
if (!sqlDBTypeMap.TryGetValue(column.SqlDbType, out type))
if (column.SqlDbType == SqlDbType.Udt)
{
type = column.DataType;
}
else if (!sqlDBTypeMap.TryGetValue(column.SqlDbType, out type))
{
type = typeof(SqlString);
}

View File

@@ -190,6 +190,12 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.QueryExecution
await ExecuteAndVerifyResult("SELECT CAST('<ABC>1234</ABC>' AS XML)", "<ABC>1234</ABC>");
}
[Test]
public async Task GeometryTypeTest()
{
await ExecuteAndVerifyResult("SELECT geometry::STGeomFromText('POINT (-96.70 40.84)',4326) [Geo]", "0xE6100000010CCDCCCCCCCC2C58C0EC51B81E856B4440");
}
private async Task ExecuteAndVerifyResult(string queryText, string expectedValue)
{
// Given a connection to a live database