Skip to content

[Bug]: datetime types incorrectly handled for MsSql #1637

@ayush3797

Description

@ayush3797

Currently, we are incorrectly handling the datetime datatypes. A snippet from BaseSqlQueryStructure class:

image

As evident from the highlighted portion, even for DateTime .NET type, we are parsing it with DateTimeOffset which is wrong. Just for an example, if you execute a GET request on the stocks_price table which has (categoryid,pieceid,instant) as PK, you would not get any result back even when the record exists for that PK in the table. Why? Because even though instant is a datetime column, it gets parsed as datetimeoffset column. This is shown in the next 2 images.

image image

Also, in the current situation, even if you pass a datetime2/datetimeoffset value for a column which has date type, you would still go all the way to the database and get the exception. Ideally, in such a scenario, an exception should be thrown much earlier when DAB parses the value. This is again because we are parsing these values as DateTimeOffset as shown in the very first attachment.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingmssqlan issue thats specific to mssql

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions