Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] Fix to #29260 - Sqlite: AddTicks translation gives incorrect results #29274

Merged
1 commit merged into from
Oct 6, 2022

Conversation

maumar
Copy link
Contributor

@maumar maumar commented Oct 5, 2022

We were using TimeSpan.TicksPerDay rather than TicksPerSecond in the translation. Fixing the typo and correcting the test.

Fixes #29260

We were using TimeSpan.TicksPerDay rather than TicksPerSecond in the translation. Fixing the typo and correcting the test.

Fixes #29260
@maumar maumar requested a review from roji October 5, 2022 23:28
@ghost
Copy link

ghost commented Oct 5, 2022

Hello @maumar!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@maumar maumar requested a review from bricelam October 5, 2022 23:38
@maumar maumar modified the milestone: 8.0.0 Oct 5, 2022
@maumar maumar changed the title [MQ/8.0] Fix to #29260 - Sqlite: AddTicks translation gives incorrect results [8.0] Fix to #29260 - Sqlite: AddTicks translation gives incorrect results Oct 5, 2022

AssertSql(
@"SELECT rtrim(rtrim(strftime('%Y-%m-%d %H:%M:%f', ""o"".""OrderDate"", CAST((10000 / 864000000000) AS TEXT) || ' seconds'), '0'), '.') AS ""OrderDate""
@"SELECT rtrim(rtrim(strftime('%Y-%m-%d %H:%M:%f', ""o"".""OrderDate"", CAST((100000000 / 10000000) AS TEXT) || ' seconds'), '0'), '.') AS ""OrderDate""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For extra credit, if it's a constant we can perform the calculation during translation and embed the result.

IIRC with @smitpatel at some point we talked about a post-processing thing that would do this in one place.

@ghost ghost merged commit 42df85e into main Oct 6, 2022
@ghost ghost deleted the fix29260 branch October 6, 2022 08:32
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sqlite: AddTicks translation gives incorrect results
2 participants