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():
4959
4959
// see https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_7002.htm#i2126725
4960
4960
// table properties , all these are optional
4961
4961
[ 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); }]
4966
4963
[
4967
4964
<K_LIKE> ( LOOKAHEAD("(" Table() ")") "(" likeTable=Table() { createTable.setLikeTable(likeTable, true); } ")"
4968
4965
| 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 {
434
434
"CREATE TABLE temp.abc AS (SELECT sku FROM temp.a UNION SELECT sku FROM temp.b)" );
435
435
}
436
436
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
+
437
443
@ Test
438
444
public void testTimestampWithTimezone () throws JSQLParserException {
439
445
assertSqlCanBeParsedAndDeparsed (
You can’t perform that action at this time.
0 commit comments