dolt icon indicating copy to clipboard operation
dolt copied to clipboard

support `INSERT INTO ... (VALUES ROW(...))` statement

Open jycor opened this issue 2 years ago • 0 comments

We're missing support for this syntax

CREATE TABLE xy (x INT, y INT);
INSERT INTO xy (VALUES ROW(1, 1)); -- syntax error

Other variations that should work

INSERT INTO xy VALUES ROW(1, 1);
INSERT INTO xy VALUES ROW(1, 1), ROW(2, 2);
INSERT INTO xy VALUES (ROW((1), (1)));
INSERT INTO xy (((VALUES ROW((1), (1)))));
INSERT INTO xy VALUES ROW(); --inserts (NULL, NULL)

Some variations that should fail

INSERT INTO xy VALUES (1, 1), ROW(2, 2);
INSERT INTO xy VALUES ROW(1, 1), (2, 2);
INSERT INTO xy VALUES ROW(());

There's a skipped test for one of these in gms/enginetest/queries/logic_test_scripts.go

jycor avatar Oct 19 '23 19:10 jycor