mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
fix decimal datatype handling (#1352)
* Revert "Revert query execution changes (#1341)"
This reverts commit cb290cdbb5.
* fix decimal and money
* timestamp
* fix code and tests
* add sql variant test
This commit is contained in:
@@ -44,6 +44,20 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.QueryExecution.DataSt
|
||||
Assert.NotNull(bytes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate GetBytesWithMaxCapacity
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void GetLongDecimalTest()
|
||||
{
|
||||
// SQL Server support up to 38 digits of decimal
|
||||
var storageReader = GetTestStorageDataReader(
|
||||
"SELECT 99999999999999999999999999999999999999");
|
||||
storageReader.DbDataReader.Read();
|
||||
var value = storageReader.GetValue(0);
|
||||
Assert.AreEqual("99999999999999999999999999999999999999", value.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate GetCharsWithMaxCapacity
|
||||
/// </summary>
|
||||
@@ -63,7 +77,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.QueryExecution.DataSt
|
||||
Assert.True(shortName.Length == 2);
|
||||
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => storageReader.GetBytesWithMaxCapacity(0, 0));
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => storageReader.GetCharsWithMaxCapacity(0, 0));
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => storageReader.GetCharsWithMaxCapacity(0, 0));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -94,10 +108,10 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.QueryExecution.DataSt
|
||||
writer.Write(output);
|
||||
Assert.True(writer.ToString().Equals(output));
|
||||
writer.Write('.');
|
||||
Assert.True(writer.ToString().Equals(output + '.'));
|
||||
Assert.True(writer.ToString().Equals(output + '.'));
|
||||
writer.Write(output);
|
||||
writer.Write('.');
|
||||
Assert.True(writer.ToString().Equals(output + '.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user