Hi,
I'm using ADO.NET client 10.1.x under .NET 5 windows app. Can anyone explain why there is a mismatch for the returned type reading the result from client and directly from Vertica?
When executing the query
"SELECT COALESCE(NULL::int, 5.21::numeric) AS Result" i receive result 5.21 as expected. (the client is DBeaver).
But when i try connect from code:
[Test]
public async Task TestDirectlyFromConnection()
{
await using var connection = VerticaHelper.OpenLocalVerticaDatabaseConnection();
await using var command = connection.CreateCommand();
command.CommandText = $"SELECT COALESCE(@a, @b) AS Result";
command.Parameters.Add(new VerticaParameter("a", VerticaType.BigInt, DBNull.Value));
command.Parameters.Add(new VerticaParameter("b", VerticaType.Numeric, 5.21m));
DbDataReader reader = await command.ExecuteReaderAsync();
while (await reader.ReadAsync())
{
decimal value = reader.GetDecimal(0);
value.Should().Be(5.21m);
}
}
I get the following error: "Expected value to be 5.21M, but found 5M."
Can anyone tell me what is wrong, or maybe it is a bug?