mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-15 17:23:32 -05:00
Getting rid of new methods in favor of just assigning the base (#198)
This change is a refactor of the DbColumnWrapper class. This fixes a huge oversight/gotcha in the DbColumnWrapper where treating the DbColumnWrapper as a DbColumn (ie, polymorphism) would result in almost all the fields of the column being null. This is a highly unexpected behavior. This change fixes that.
This commit is contained in:
@@ -140,12 +140,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ci.IsLong)
|
||||
{
|
||||
// not a long field
|
||||
values[i] = reader.GetValue(i);
|
||||
}
|
||||
else
|
||||
if (ci.IsLong.HasValue && ci.IsLong.Value)
|
||||
{
|
||||
// this is a long field
|
||||
if (ci.IsBytes)
|
||||
@@ -169,6 +164,11 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage
|
||||
Debug.Assert(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// not a long field
|
||||
values[i] = reader.GetValue(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage
|
||||
|
||||
// Read the columns into a set of wrappers
|
||||
Columns = DbDataReader.GetColumnSchema().Select(column => new DbColumnWrapper(column)).ToArray();
|
||||
HasLongColumns = Columns.Any(column => column.IsLong);
|
||||
HasLongColumns = Columns.Any(column => column.IsLong.HasValue && column.IsLong.Value);
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
Reference in New Issue
Block a user