Skip to content

Commit 49e0f4b

Browse files
Merge pull request #2575 from taozhi8833998/fix-insert-into-union-all
fix: insert into values clause can be union stmt
2 parents 8d8e4d3 + da14067 commit 49e0f4b

16 files changed

Lines changed: 52 additions & 16 deletions

pegjs/athena.pegjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,9 @@ set_item
15081508

15091509
insert_value_clause
15101510
= value_clause
1511-
/ select_stmt_nake
1511+
/ u:union_stmt {
1512+
return u.ast
1513+
}
15121514

15131515
insert_partition
15141516
= KW_PARTITION __ LPAREN __ head:ident_name tail:(__ COMMA __ ident_name)* __ RPAREN {

pegjs/bigquery.pegjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,9 @@ insert_partition
586586

587587
insert_value_clause
588588
= value_clause
589-
/ select_stmt_nake
589+
/ u:union_stmt {
590+
return u.ast
591+
}
590592

591593
on_duplicate_update_stmt
592594
= KW_ON __ 'DUPLICATE'i __ KW_KEY __ KW_UPDATE __ s:set_list {

pegjs/db2.pegjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,9 @@ set_item
14631463
}
14641464
insert_value_clause
14651465
= value_clause
1466-
/ select_stmt_nake
1466+
/ u:union_stmt {
1467+
return u.ast
1468+
}
14671469

14681470
insert_partition
14691471
= KW_PARTITION __ LPAREN __ head:ident_name tail:(__ COMMA __ ident_name)* __ RPAREN {

pegjs/flinksql.pegjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2198,7 +2198,9 @@ returning_stmt
21982198

21992199
insert_value_clause
22002200
= value_clause
2201-
/ select_stmt_nake
2201+
/ u:union_stmt {
2202+
return u.ast
2203+
}
22022204

22032205
insert_partition
22042206
= KW_PARTITION __ LPAREN __ head:ident_name tail:(__ COMMA __ ident_name)* __ RPAREN {

pegjs/hive.pegjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,9 @@ set_item
14491449

14501450
insert_value_clause
14511451
= value_clause
1452-
/ select_stmt_nake
1452+
/ u:union_stmt {
1453+
return u.ast
1454+
}
14531455

14541456
insert_partition
14551457
= KW_PARTITION __ LPAREN __ head:ident_name tail:(__ COMMA __ ident_name)* __ RPAREN {

pegjs/mariadb.pegjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2631,7 +2631,9 @@ returning_stmt
26312631

26322632
insert_value_clause
26332633
= value_clause
2634-
/ select_stmt_nake
2634+
/ u:set_op_stmt {
2635+
return u.ast
2636+
}
26352637

26362638
insert_partition
26372639
= KW_PARTITION __ LPAREN __ head:ident_name tail:(__ COMMA __ ident_name)* __ RPAREN {

pegjs/mysql.pegjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2892,7 +2892,9 @@ set_item
28922892

28932893
insert_value_clause
28942894
= value_clause
2895-
/ select_stmt_nake
2895+
/ u:set_op_stmt {
2896+
return u.ast
2897+
}
28962898

28972899
insert_partition
28982900
= KW_PARTITION __ LPAREN __ head:ident_name tail:(__ COMMA __ ident_name)* __ RPAREN {

pegjs/noql.pegjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3425,7 +3425,9 @@ returning_stmt
34253425

34263426
insert_value_clause
34273427
= value_clause
3428-
/ select_stmt_nake
3428+
/ u:union_stmt {
3429+
return u.ast
3430+
}
34293431

34303432
insert_partition
34313433
= KW_PARTITION __ LPAREN __ head:ident_name tail:(__ COMMA __ ident_name)* __ RPAREN {

pegjs/postgresql.pegjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4124,7 +4124,10 @@ returning_stmt
41244124

41254125
insert_value_clause
41264126
= value_clause
4127-
/ select_stmt_nake
4127+
/ u:union_stmt {
4128+
return u.ast
4129+
}
4130+
41284131

41294132
insert_partition
41304133
= KW_PARTITION __ LPAREN __ head:ident_name tail:(__ COMMA __ ident_name)* __ RPAREN {

pegjs/redshift.pegjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3453,7 +3453,9 @@ returning_stmt
34533453

34543454
insert_value_clause
34553455
= value_clause
3456-
/ select_stmt_nake
3456+
/ u:union_stmt {
3457+
return u.ast
3458+
}
34573459

34583460
insert_partition
34593461
= KW_PARTITION __ LPAREN __ head:ident_name tail:(__ COMMA __ ident_name)* __ RPAREN {

0 commit comments

Comments
 (0)