File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/create Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -4959,10 +4959,7 @@ CreateTable CreateTable():
49594959 // see https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_7002.htm#i2126725
49604960 // table properties , all these are optional
49614961 [ rowMovement = RowMovement() { createTable.setRowMovement(rowMovement); }]
4962- [
4963- <K_AS> ( LOOKAHEAD("(" SelectWithWithItems( ) ")") "(" select = SelectWithWithItems( ) { createTable.setSelect(select, true); } ")"
4964- | select = SelectWithWithItems( ) { createTable.setSelect(select, false); } )
4965- ]
4962+ [<K_AS> select = SelectWithWithItems( ) { createTable.setSelect(select, false); }]
49664963 [
49674964 <K_LIKE> ( LOOKAHEAD("(" Table() ")") "(" likeTable=Table() { createTable.setLikeTable(likeTable, true); } ")"
49684965 | likeTable=Table() { createTable.setLikeTable(likeTable, false); } )
Original file line number Diff line number Diff line change @@ -434,6 +434,12 @@ public void testCreateUnitonIssue402_2() throws JSQLParserException {
434434 "CREATE TABLE temp.abc AS (SELECT sku FROM temp.a UNION SELECT sku FROM temp.b)" );
435435 }
436436
437+ @ Test
438+ public void testCreateUnionIssue () throws JSQLParserException {
439+ assertSqlCanBeParsedAndDeparsed (
440+ "CREATE TABLE temp.abc AS (SELECT c FROM t1) UNION (SELECT c FROM t2)" );
441+ }
442+
437443 @ Test
438444 public void testTimestampWithTimezone () throws JSQLParserException {
439445 assertSqlCanBeParsedAndDeparsed (
You can’t perform that action at this time.
0 commit comments