-
Notifications
You must be signed in to change notification settings - Fork 934
NH-3801 #436
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
NH-3801 #436
Conversation
PleasantD
commented
Jul 7, 2015
- Conditional statements are now generated in SQL for select clauses
- Case statements in the select clause don't generate unexpected or implicit joins for the test expression
- Combined the logic from SelectJoinDetector and ResultOperatorAndOrderByJoinDetector, also handles case statement join logic
- Removed most of the changes from NH-3797 (pull request NH 3797 #432) as they are now unnecessary because the select clause now does the right thing
…uld produce joins
…lauses - Conditional statements are now generated in SQL for select clauses - Case statements in the select clause don't generate unexpected or implicit joins for the test expression - Combined the logic from SelectJoinDetector and ResultOperatorAndOrderByJoinDetector, also handles case statement join logic - Removed most of the changes from NH-3797 (pull request nhibernate#432) as they are now unnecessary because the select clause now does the right thing
Please include in milestone 4.1.0, and as usual, let me know if there are any problems or missing tests |
I think this pull request will have merge issues with #434, which I can fix once one of them has been merged. |
@PleasantD which should be merged first? |
In GroupByTests.GroupByComputedValue instead of having that SQL generated
We should wrap case into subselect, so this will allow this query to work on some databases (SQL Server via ODBC, Firebird, Sql Server CE). What do you think? Also there are few test failing for Oracle: *** Tests new (failed) since last recorded results *** *** Tests broken since last recorded results *** |
I'd maybe recommend merging this first, then I'll fix #434. That's what I did locally to build a prerelease. |
Yes, ideally we need to wrap the case into a subselect. On Tue, Jul 7, 2015 at 2:47 PM, Alexander Zaytsev notifications@github.com
Duncan Munro, Software Developer |
I did not check the solution yet, and do not really know how exactly does it work, but, probably, in that case we shall not flatten subquery if we have |
There might be a reason why I left them separated. |
The oracle issue seems to be that the parameter doesn't match the charset of the DB. Although that seems to only affect the Oracle Managed build. Could that be a configuration issue? |
The SelectJoinDetector and ResultOperatorAndOrderByJoinDetector used to have (slightly) different logic. But as I was adding the modifications to allow the SelectJoinDetector to bypass joins for the conditional test expression, I found that the logic basically began to overlap. By unifying it you get a JoinDetector that can decide on a more granular level if it needs to create joins for entities. |
No |
The problem that case got casted to the default type of string, which is NVARCHAR2(255) in this case. |
Merged, thanks |
@PleasantD the oracle fails are related to https://nhibernate.jira.com/browse/NH-3787 |