Skip to content

Commit 0e17dc1

Browse files
dreab8mbellade
authored andcommitted
HHH-18069 NullPointerException when unioning partition results
1 parent d428041 commit 0e17dc1

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
@@ -1990,9 +1990,13 @@ public QueryGroup visitQueryGroup(SqmQueryGroup<?> queryGroup) {
19901990
sqmQueryPartStack.push( queryGroup );
19911991
pushProcessingState( processingState );
19921992

1993+
FromClauseIndex firstQueryPartIndex = null;
1994+
SqlAstProcessingState firstPoppedProcessingState = null;
19931995
try {
19941996
newQueryParts.add( visitQueryPart( queryParts.get( 0 ) ) );
19951997

1998+
firstQueryPartIndex = lastPoppedFromClauseIndex;
1999+
firstPoppedProcessingState = lastPoppedProcessingState;
19962000
collector.setSqmAliasedNodeCollector(
19972001
(SqmAliasedNodeCollector) lastPoppedProcessingState.getSqlExpressionResolver()
19982002
);
@@ -2010,6 +2014,8 @@ public QueryGroup visitQueryGroup(SqmQueryGroup<?> queryGroup) {
20102014
finally {
20112015
popProcessingStateStack();
20122016
sqmQueryPartStack.pop();
2017+
lastPoppedFromClauseIndex = firstQueryPartIndex;
2018+
lastPoppedProcessingState = firstPoppedProcessingState;
20132019
}
20142020
}
20152021

0 commit comments

Comments
 (0)