Conditionals in Select are too permissive

Description

The fix for NH-3801: AddJoinsReWriter disassociates Select expressions and GroupBy key expressionsClosed included allowing case statements in Select clauses to directly generate HQL. However, this solution is too permissive.

The HQL generator for conditional statements wraps the case statement in a cast.
So if the type of the conditional statement is not something that NHibernate.Hql.Ast.HqlIdent can handle, the expression fails.

This could be corrected by either limiting conditional handling in the select statement to Ident types only (is there a known list, or helper to check somewhere?), or (possibly) skipping the unnecessary cast in the HQL tree.

This also seems to be related to NH-3005: NHibernate.Hql.Ast.HqlIdent..ctor throws Don't currently support idents of type DateResolved

Environment

None

Activity

Show:

Alex ZaytsevMay 1, 2017 at 3:42 AM

Closing issues resolved in 4.1.0

Alex ZaytsevAugust 12, 2015 at 11:48 PM

thanks! I have some minor comment on the pull request.

Duncan MunroAugust 12, 2015 at 10:05 PM

Alex ZaytsevAugust 12, 2015 at 5:37 AM

you can check the grammar.

Duncan MunroAugust 11, 2015 at 11:08 PM

Other than looking in HqlIdent, is there some way to tell that a type can be an Ident node?

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created August 11, 2015 at 7:00 PM
Updated May 1, 2017 at 3:42 AM
Resolved September 4, 2015 at 9:42 AM
Who's Looking?