Skip to content

Commit c3a1aa6

Browse files
authored
Add support for union_with_brackets_and_orderby (#1131)
1 parent 56c2dfe commit c3a1aa6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,6 +2409,12 @@ public void testMultiValueInBinds() throws JSQLParserException {
24092409
assertSqlCanBeParsedAndDeparsed(stmt);
24102410
}
24112411

2412+
@Test
2413+
public void testUnionWithBracketsAndOrderBy() throws JSQLParserException {
2414+
String stmt = "(SELECT a FROM tbl ORDER BY a) UNION DISTINCT (SELECT a FROM tbl ORDER BY a)";
2415+
assertSqlCanBeParsedAndDeparsed(stmt);
2416+
}
2417+
24122418
@Test
24132419
public void testMultiValueNotInBinds() throws JSQLParserException {
24142420
String stmt = "SELECT * FROM mytable WHERE (a, b) NOT IN ((?, ?), (?, ?))";

0 commit comments

Comments
 (0)