HHH-18681 InterpretationException executing subquery in case-when : o.h.query.sqm.tree.select.SqmSelection.getExpressible() is null

This commit is contained in:
Andrea Boriero 2024-10-14 17:00:17 +02:00 committed by Andrea Boriero
parent 1e4b1137ac
commit 122d1806c7
1 changed files with 4 additions and 2 deletions

View File

@ -5259,9 +5259,11 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
final List<SqmSelection<?>> selections = subQuery.getQuerySpec().getSelectClause().getSelections(); final List<SqmSelection<?>> selections = subQuery.getQuerySpec().getSelectClause().getSelections();
if ( selections.size() == 1 ) { if ( selections.size() == 1 ) {
subQuery.applyInferableType( selections.get( 0 ).getExpressible().getSqmType() ); final SqmExpressible<?> expressible = selections.get( 0 ).getExpressible();
if ( expressible != null ) {
subQuery.applyInferableType( expressible.getSqmType() );
}
} }
return subQuery; return subQuery;
} }
finally { finally {