Skip to content

Commit 3a6e63d

Browse files
committed
Add support for INSERT INTO ... VALUES ROW(...)
1 parent eaa5f03 commit 3a6e63d

3 files changed

Lines changed: 408 additions & 400 deletions

File tree

parse_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,14 @@ var (
687687
input: "insert /* bool in on duplicate */ into a values (1, 2, 3) on duplicate key update b = values(a.b), c = d",
688688
}, {
689689
input: "insert /* bool expression on duplicate */ into a values (1, 2) on duplicate key update b = func(a), c = a > d",
690+
}, {
691+
input: "insert into t1(c1, c2, c3) values row(1, 2, 3), row(4, 5, 6), row(7, 8, 9)",
692+
output: "insert into t1(c1, c2, c3) values (1, 2, 3), (4, 5, 6), (7, 8, 9)",
693+
}, {
694+
input: "insert into t1(c1, c2) values (1, 2), row(3, 4)",
695+
output: "insert into t1(c1, c2) values (1, 2), (3, 4)",
696+
}, {
697+
input: "insert into t1 values ()",
690698
}, {
691699
input: "values row(1)",
692700
}, {
@@ -2447,6 +2455,7 @@ func TestCreateTable(t *testing.T) {
24472455
"alter table tbl_ren2 add column col_c int null, rename column col_a to col_b",
24482456
"alter table tbl_attr_a add column col_a int default 0 not null",
24492457
"alter table tbl_attr_b modify column col_b int default 0 not null",
2458+
"alter table tbl_attr_json modify column col_json json",
24502459
"alter table tbl_attr_c change column col_old col_new int default 0 not null",
24512460
"alter table tbl_vis_a add column col_a int invisible",
24522461
"alter table tbl_vis_b modify column col_b int visible not null default 0",

0 commit comments

Comments
 (0)