Skip to content

Commit b6ee791

Browse files
committed
HHH-18069 NullPointerException when unioning partition results
1 parent 9ed1119 commit b6ee791

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,9 +1982,13 @@ public QueryGroup visitQueryGroup(SqmQueryGroup<?> queryGroup) {
19821982
sqmQueryPartStack.push( queryGroup );
19831983
pushProcessingState( processingState );
19841984

1985+
FromClauseIndex firstQueryPartIndex = null;
1986+
SqlAstProcessingState firstPoppedProcessingState = null;
19851987
try {
19861988
newQueryParts.add( visitQueryPart( queryParts.get( 0 ) ) );
19871989

1990+
firstQueryPartIndex = lastPoppedFromClauseIndex;
1991+
firstPoppedProcessingState = lastPoppedProcessingState;
19881992
collector.setSqmAliasedNodeCollector(
19891993
(SqmAliasedNodeCollector) lastPoppedProcessingState.getSqlExpressionResolver()
19901994
);
@@ -2002,6 +2006,8 @@ public QueryGroup visitQueryGroup(SqmQueryGroup<?> queryGroup) {
20022006
finally {
20032007
popProcessingStateStack();
20042008
sqmQueryPartStack.pop();
2009+
lastPoppedFromClauseIndex = firstQueryPartIndex;
2010+
lastPoppedProcessingState = firstPoppedProcessingState;
20052011
}
20062012
}
20072013

0 commit comments

Comments
 (0)