mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-22 09:35:38 -05:00
Fix Edit Data exceptions on spatial types (#619)
* Fix Edit Data exceptions on spatial types * One more code convention cleanup.
This commit is contained in:
@@ -420,23 +420,26 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
|
||||
private void ExtendResultMetadata(List<DbColumn[]> columnSchemas, List<ResultSet> results)
|
||||
{
|
||||
if (columnSchemas.Count != results.Count) return;
|
||||
if (columnSchemas.Count != results.Count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i = 0; i < results.Count; i++)
|
||||
for (int i = 0; i < results.Count; i++)
|
||||
{
|
||||
ResultSet result = results[i];
|
||||
DbColumn[] columnSchema = columnSchemas[i];
|
||||
if(result.Columns.Length > columnSchema.Length)
|
||||
if (result.Columns.Length > columnSchema.Length)
|
||||
{
|
||||
throw new InvalidOperationException("Did not receive enough metadata columns.");
|
||||
}
|
||||
|
||||
for(int j = 0; j < result.Columns.Length; j++)
|
||||
for (int j = 0; j < result.Columns.Length; j++)
|
||||
{
|
||||
DbColumnWrapper resultCol = result.Columns[j];
|
||||
DbColumn schemaCol = columnSchema[j];
|
||||
|
||||
if(!string.Equals(resultCol.DataTypeName, schemaCol.DataTypeName)
|
||||
if (!string.Equals(resultCol.DataTypeName, schemaCol.DataTypeName, StringComparison.OrdinalIgnoreCase)
|
||||
|| (!string.Equals(resultCol.ColumnName, schemaCol.ColumnName)
|
||||
&& !string.IsNullOrEmpty(schemaCol.ColumnName)
|
||||
&& !string.Equals(resultCol, SR.QueryServiceColumnNull)))
|
||||
|
||||
Reference in New Issue
Block a user