-
Couldn't load subscription status.
- Fork 3.3k
Use SQL Server 2025 JSON_VALUE() RETURNING clause #36456
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
Conversation
4997eeb to
6b62059
Compare
| SqlServerEngineType.SqlServer when SqlServerCompatibilityLevel >= 170 => true, | ||
| SqlServerEngineType.AzureSql when AzureSqlCompatibilityLevel >= 170 => true, | ||
| SqlServerEngineType.AzureSynapse => false, | ||
| _ => false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't UnreachableException make more sense here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is that there's an Unknown value in the SqlServerEngineType enum - any idea in what situation we can get it or what it means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Unknown will never pass through the validation, so it can be ignored here. It's there purely for ConfigureSqlEngine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks - I'll switch to UnreachableException then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it reachable when the compatibility level is below 170?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah of course :/ Thanks @stevendarby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this to throw UnreachableException when an unknown enum label is encountered, but not otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cincuranet the tests failed for me because... in SqlServerSingletonOptions the Engine is Unknown. I'm changing the code to return false for Unknown for now so as to not block on this, but this is something we should fix (opened #36477 to track).
src/EFCore.SqlServer/Query/Internal/SqlServerJsonPostprocessor.cs
Outdated
Show resolved
Hide resolved
6b62059 to
9437369
Compare
|
@cincuranet @stevendarby rebased on latest main and did a couple fixes, should be ready for another review and merge. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Based on top of #36442, review last commit only.
Note: disabling this specifically when UseAzureSql() is used, as RETURNING isn't supported there yet (but should be supported very soon).
Closes #35729