Skip to content

Cosmos: TimeOnly arithmetic is translated incorrectly #35311

@roji

Description

@roji

The following test:

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task TimeOnly_subtract_TimeOnly(bool async)
    => AssertQuery(
        async,
        ss => ss.Set<BasicTypesEntity>().Where(b => b.TimeOnly - new TimeOnly(10, 0, 0) == new TimeSpan(0, 0, 15, 50, 500)));

... generates the following SQL:

SELECT VALUE c
FROM root c
WHERE ((c["TimeOnly"] - "10:00:00") = "00:15:50.5000000")

We should either correct the translation or block it. Check arithmetic over other temporal types to make sure we're doing the right thing.

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions