HHH-17769 Ignore query options limit when rendering cte definitions

This commit is contained in:
Marco Belladelli 2024-02-27 11:58:41 +01:00
parent 69aee62231
commit 38ad704ea2
No known key found for this signature in database
GPG Key ID: D1D0C3030AE3AA35
1 changed files with 6 additions and 0 deletions

View File

@ -1930,8 +1930,11 @@ public abstract class AbstractSqlAstTranslator<T extends JdbcOperation> implemen
protected void visitCteDefinition(CteStatement cte) {
final CteStatement oldCteStatement = currentCteStatement;
currentCteStatement = cte;
final Limit oldLimit = limit;
limit = null;
cte.getCteDefinition().accept( this );
currentCteStatement = oldCteStatement;
limit = oldLimit;
}
/**
@ -5571,11 +5574,14 @@ public abstract class AbstractSqlAstTranslator<T extends JdbcOperation> implemen
true,
null
);
final Limit oldLimit = limit;
limit = null;
statementStack.push( cteDefinition );
renderPrimaryTableReference( queryPartTableGroup, lockMode );
if ( queryPartTableGroup.isLateral() && !dialect.supportsLateral() ) {
addAdditionalWherePredicate( determineLateralEmulationPredicate( queryPartTableGroup ) );
}
limit = oldLimit;
statementStack.pop();
}