HHH-16576 Fix column aliases when rendering query part with table reference aliasing emulation

This commit is contained in:
Marco Belladelli 2023-05-11 14:42:26 +02:00
parent 8e21d0eb54
commit f310338198
2 changed files with 2 additions and 4 deletions

View File

@ -2866,7 +2866,8 @@ public abstract class AbstractSqlAstTranslator<T extends JdbcOperation> implemen
if ( currentQueryPart != null && queryPartForRowNumberingClauseDepth != clauseStack.depth() ) {
this.queryPartForRowNumbering = null;
this.queryPartForRowNumberingClauseDepth = -1;
this.needsSelectAliases = false;
// If explicit column aliases were defined we should still use them when rendering the select clause
this.needsSelectAliases = columnAliases != null;
}
// If we are row numbering the current query group, this means that we can't render the
// order by and offset fetch clause, so we must do row counting on the query group level

View File

@ -1892,9 +1892,6 @@ public class FunctionTests {
}
@Test
@SkipForDialect(dialectClass = OracleDialect.class, reason = "HHH-16576")
@SkipForDialect(dialectClass = MariaDBDialect.class, reason = "HHH-16576")
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 5, reason = "HHH-16576")
public void testMaxOverUnion(SessionFactoryScope scope) {
scope.inTransaction(
session -> {