-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Flatten CASE expressions to avoid error "Case expressions may only be nested to level 10" #12729
Comments
@bradmarder do you actually always return |
EF Triage: We will use this to track flattening CASE statements. |
@divega I just returned |
I am having an issue which I believe may be related to this.. System.Data.SqlClient.SqlException (0x80131904): Case expressions may only be nested to level 10. Is this the same issue, or should I raise a new one? |
duplicate of #2881 |
@smitpatel, it's not really a duplicate. It was fixed in .Net Core 2.2 but appeared again in .Net Core 3.0! You must re-close it (close it again). |
@Yen-David - Stop spamming all the issue linked with this. This issue is fixed in 5.0 milestone hence it will be released in next version of EF Core (which comes after EF Core 3.1). The fix is available in nightly builds. I am not sure from where you are getting idea that it was fixed in .NET Core 2.2. It was never fixed in any release of EF Core upto 3.1 |
@smitpatel, thank you for fixing it in a nightly build. I am currently staying with .Net Core 2.2 just for this to work. I will upgrade to .Net Core 3.1 by skipping .Net Core 3.0, thus avoiding this bug in 3.0. Trust me. I discovered this bug after my upgrade to 3.0, and rolled back to 2.2 for it to work again. The painful experience cannot be mistaken. I'll always remember it! |
@ajcvickers we got a(nother) customer hitting this scenario - should we reconsider this for patch? |
I looked at the SQL generated in the case. It is just used to convert to specific string based on value. Doing that using a client function can easily give the same result. Certainly generates much shorter SQL and negligible perf difference. |
problem is that odata generates that query, and the query string looks fairly innocuous |
@maumar @smitpatel I'll remove from the milestone and we can discuss on Friday. |
Summary of the changes - Added CaseWhenFlatteningExpressionVisitor postprocessor - Recursively collapse relevant CaseExpression
This has not been merged to release/3.1 |
Summary of the changes - Added CaseWhenFlatteningExpressionVisitor postprocessor - Recursively collapse relevant CaseExpression
Summary of the changes - Added CaseWhenFlatteningExpressionVisitor postprocessor - Recursively collapse relevant CaseExpression
This fails on SQL server, but works for in-memory/SQLite.
Steps to reproduce
Further technical details
EF Core version: 2.1.2
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: win10 x64
IDE: Visual Studio 2017 15.8.0 Preview 4.0
The text was updated successfully, but these errors were encountered: