Skip to content

Sql Server v13+ Datetime subtraction issue fix #214

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

Merged
merged 1 commit into from
Jan 28, 2022

Conversation

alex-kulakov
Copy link
Contributor

Previous movement to DATEDIFF_BIG (#198) appeared to have problems with some DateTime values.

This PR tries to keep better performance of less calculations while not sacrificing full range of dates to be supported. It brings back previous formula of date diff calculation for some scenarios (DATEDIFF_BIG can't handle diff in nanoseconds fully, more info here), while using relatively lightweight date diff calculation for the most part.

@AlexUstinov
Copy link
Contributor

Is there a test for the overflow case? Could you please add one if it doesn't exist?

@alex-kulakov
Copy link
Contributor Author

alex-kulakov commented Jan 24, 2022

There is a test called IssueJira0556_ArithmeticExceptionWhenSubstractionOfDates.cs , I added it long ago. I didn't notice it became failed so this PR fixes my mistake in #198.

@alex-kulakov alex-kulakov merged commit 1df8aea into 7.0 Jan 28, 2022
@alex-kulakov alex-kulakov deleted the 7.0-mssql-datediffbig-issue-fix branch January 28, 2022 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants