Skip to content

Commit 15fc834

Browse files
committed
- additional test case for values
- additional test cases for analytical expressions
1 parent e7dc8d0 commit 15fc834

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/test/java/net/sf/jsqlparser/test/select/SelectTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,16 @@ public void testProblemSqlAnalytic3() throws JSQLParserException {
646646
String stmt = "SELECT a, row_number() OVER (PARTITION BY c ORDER BY a, b) AS n FROM table1";
647647
assertSqlCanBeParsedAndDeparsed(stmt);
648648
}
649+
650+
public void testProblemSqlAnalytic4EmptyOver() throws JSQLParserException {
651+
String stmt = "SELECT a, row_number() OVER () AS n FROM table1";
652+
assertSqlCanBeParsedAndDeparsed(stmt);
653+
}
654+
655+
public void testProblemSqlAnalytic5AggregateColumnValue() throws JSQLParserException {
656+
String stmt = "SELECT a, sum(b) OVER () AS n FROM table1";
657+
assertSqlCanBeParsedAndDeparsed(stmt);
658+
}
649659

650660
public void testOracleJoin() throws JSQLParserException {
651661
String stmt = "SELECT * FROM tabelle1, tabelle2 WHERE tabelle1.a = tabelle2.b(+)";
@@ -790,6 +800,11 @@ public void testValues5() throws JSQLParserException {
790800
String stmt = "SELECT X, Y FROM (VALUES (0, 'a'), (1, 'b')) AS MY_TEMP_TABLE(X, Y)";
791801
assertSqlCanBeParsedAndDeparsed(stmt);
792802
}
803+
804+
public void testValues6BothVariants() throws JSQLParserException {
805+
String stmt = "SELECT I FROM (VALUES 1, 2, 3) AS MY_TEMP_TABLE(I) WHERE I IN (SELECT * FROM (VALUES 1, 2) AS TEST)";
806+
assertSqlCanBeParsedAndDeparsed(stmt);
807+
}
793808

794809
private void assertSqlCanBeParsedAndDeparsed(String statement) throws JSQLParserException {
795810
Statement parsed = parserManager.parse(new StringReader(statement));

0 commit comments

Comments
 (0)