HHH-16655 Fix parse error for HQL window frames

This commit is contained in:
Christian Beikov 2023-05-21 13:28:16 +02:00
parent 4bb0740010
commit 023e08581d
2 changed files with 16 additions and 5 deletions

View File

@ -1211,9 +1211,9 @@ frameClause
* The start of the window content
*/
frameStart
: UNBOUNDED PRECEDING
: CURRENT ROW
| UNBOUNDED PRECEDING
| expression PRECEDING
| CURRENT ROW
| expression FOLLOWING
;
@ -1221,10 +1221,10 @@ frameStart
* The end of the window content
*/
frameEnd
: expression PRECEDING
| CURRENT ROW
| expression FOLLOWING
: CURRENT ROW
| UNBOUNDED FOLLOWING
| expression PRECEDING
| expression FOLLOWING
;
/**

View File

@ -211,4 +211,15 @@ public class WindowFunctionTest {
}
} );
}
@Test
@Jira( "https://hibernate.atlassian.net/browse/HHH-16655" )
public void testParseWindowFrame(SessionFactoryScope scope) {
scope.inTransaction( session -> {
session.createQuery(
"select rank() over (order by theInt rows between current row and unbounded following) from EntityOfBasics",
Long.class
);
} );
}
}