Translations to LEAST/GREATEST, Math.Min/Max#32338
Merged
roji merged 2 commits intodotnet:mainfrom Nov 28, 2023
Merged
Conversation
e080f41 to
a85f8ed
Compare
maumar
reviewed
Nov 27, 2023
src/EFCore.SqlServer/Query/Internal/SqlServerMethodCallTranslatorProvider.cs
Outdated
Show resolved
Hide resolved
Closes dotnet#27794 Closes dotnet#31681 Closes dotnet#32332
Contributor
|
@roji should we also recognize Math.Max(x, Math.Max(y, z)) and convert to GREATEST and same for min? |
maumar
approved these changes
Nov 27, 2023
Member
Author
|
I love it! |
Member
Author
|
@maumar pushed another commit to do this, take a look. |
roji
added a commit
to roji/efcore
that referenced
this pull request
Nov 30, 2023
roji
added a commit
to roji/efcore
that referenced
this pull request
Nov 30, 2023
roji
added a commit
to roji/efcore
that referenced
this pull request
Jul 22, 2024
roji
added a commit
to roji/efcore
that referenced
this pull request
Jul 22, 2024
Member
Author
|
See nullability-related follow-up work in #32458 |
roji
added a commit
to roji/efcore
that referenced
this pull request
Jul 22, 2024
roji
added a commit
to roji/efcore
that referenced
this pull request
Jul 22, 2024
roji
added a commit
that referenced
this pull request
Jul 23, 2024
This was referenced Jan 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
new[] { x, y }.Max()), simplifying the translation via LEAST/GREATEST (#32332). This is done conditional on the SQL Server compatibility level.Design notes:
LEAST/GREATEST require SQL Server 2022; when introducing the SQL Server compatibility level, we decided to make it 2022 by default. This means that this PR breaks users of older databases who don't have their compatibility level set explicitly (change 3 specifically). We may want to revisit the default.(revisited, changed to 2019)Closes #27794
Closes #31681
Closes #32332