File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -3196,7 +3196,8 @@ AnalyticExpression AnalyticExpression(Function function) :
31963196
31973197 "("
31983198 [<K_PARTITION> <K_BY>
3199- (LOOKAHEAD(3) expressionList=SimpleExpressionList() | "(" {partitionByBrackets = true;} expressionList=SimpleExpressionList() ")" )
3199+ (LOOKAHEAD(ComplexExpressionList()) expressionList=ComplexExpressionList()
3200+ | "(" {partitionByBrackets = true;} expressionList=ComplexExpressionList() ")" )
32003201 ]
32013202 [olist=OrderByElements() ]
32023203 [windowElement = WindowElement() ]
Original file line number Diff line number Diff line change @@ -1900,6 +1900,16 @@ public void testAnalyticFunctionIssue670() throws JSQLParserException {
19001900 public void testAnalyticFunctionFilterIssue866 () throws JSQLParserException {
19011901 assertSqlCanBeParsedAndDeparsed ("SELECT COUNT(*) FILTER (WHERE name = 'Raj') OVER (PARTITION BY name ) FROM table" );
19021902 }
1903+
1904+ @ Test
1905+ public void testAnalyticPartitionBooleanExpressionIssue864 () throws JSQLParserException {
1906+ assertSqlCanBeParsedAndDeparsed ("SELECT COUNT(*) OVER (PARTITION BY (event = 'admit' OR event = 'family visit') ORDER BY day ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) family_visits FROM patients" );
1907+ }
1908+
1909+ @ Test
1910+ public void testAnalyticPartitionBooleanExpressionIssue864_2 () throws JSQLParserException {
1911+ assertSqlCanBeParsedAndDeparsed ("SELECT COUNT(*) OVER (PARTITION BY (event = 'admit' OR event = 'family visit') ) family_visits FROM patients" );
1912+ }
19031913
19041914 @ Test
19051915 public void testFunctionLeft () throws JSQLParserException {
You can’t perform that action at this time.
0 commit comments