HHH-18069 NullPointerException when unioning partition results

This commit is contained in:
Andrea Boriero 2024-11-27 11:50:01 +01:00 committed by Andrea Boriero
parent 9ed11194a2
commit b6ee7918e7
1 changed files with 6 additions and 0 deletions

View File

@ -1982,9 +1982,13 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
sqmQueryPartStack.push( queryGroup );
pushProcessingState( processingState );
FromClauseIndex firstQueryPartIndex = null;
SqlAstProcessingState firstPoppedProcessingState = null;
try {
newQueryParts.add( visitQueryPart( queryParts.get( 0 ) ) );
firstQueryPartIndex = lastPoppedFromClauseIndex;
firstPoppedProcessingState = lastPoppedProcessingState;
collector.setSqmAliasedNodeCollector(
(SqmAliasedNodeCollector) lastPoppedProcessingState.getSqlExpressionResolver()
);
@ -2002,6 +2006,8 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
finally {
popProcessingStateStack();
sqmQueryPartStack.pop();
lastPoppedFromClauseIndex = firstQueryPartIndex;
lastPoppedProcessingState = firstPoppedProcessingState;
}
}