Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions crates/squawk_parser/tests/data/regression_suite/merge.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ WHEN MATCHED THEN
--
-- Errors
--
MERGE INTO target t RANDOMWORD
USING source AS s
ON t.tid = s.sid
WHEN MATCHED THEN
UPDATE SET balance = 0;
-- MERGE INTO target t RANDOMWORD
-- USING source AS s
-- ON t.tid = s.sid
-- WHEN MATCHED THEN
-- UPDATE SET balance = 0;
-- MATCHED/INSERT error
MERGE INTO target t
USING source AS s
Expand All @@ -60,41 +60,41 @@ ON t.tid = s.sid
WHEN NOT MATCHED BY SOURCE THEN
INSERT DEFAULT VALUES;
-- incorrectly specifying INTO target
MERGE INTO target t
USING source AS s
ON t.tid = s.sid
WHEN NOT MATCHED THEN
INSERT INTO target DEFAULT VALUES;
-- MERGE INTO target t
-- USING source AS s
-- ON t.tid = s.sid
-- WHEN NOT MATCHED THEN
-- INSERT INTO target DEFAULT VALUES;
-- Multiple VALUES clause
MERGE INTO target t
USING source AS s
ON t.tid = s.sid
WHEN NOT MATCHED THEN
INSERT VALUES (1,1), (2,2);
-- MERGE INTO target t
-- USING source AS s
-- ON t.tid = s.sid
-- WHEN NOT MATCHED THEN
-- INSERT VALUES (1,1), (2,2);
-- SELECT query for INSERT
MERGE INTO target t
USING source AS s
ON t.tid = s.sid
WHEN NOT MATCHED THEN
INSERT SELECT (1, 1);
-- MERGE INTO target t
-- USING source AS s
-- ON t.tid = s.sid
-- WHEN NOT MATCHED THEN
-- INSERT SELECT (1, 1);
-- NOT MATCHED/UPDATE
MERGE INTO target t
USING source AS s
ON t.tid = s.sid
WHEN NOT MATCHED THEN
UPDATE SET balance = 0;
-- MERGE INTO target t
-- USING source AS s
-- ON t.tid = s.sid
-- WHEN NOT MATCHED THEN
-- UPDATE SET balance = 0;
-- NOT MATCHED BY TARGET/UPDATE
MERGE INTO target t
USING source AS s
ON t.tid = s.sid
WHEN NOT MATCHED BY TARGET THEN
UPDATE SET balance = 0;
-- MERGE INTO target t
-- USING source AS s
-- ON t.tid = s.sid
-- WHEN NOT MATCHED BY TARGET THEN
-- UPDATE SET balance = 0;
-- UPDATE tablename
MERGE INTO target t
USING source AS s
ON t.tid = s.sid
WHEN MATCHED THEN
UPDATE target SET balance = 0;
-- MERGE INTO target t
-- USING source AS s
-- ON t.tid = s.sid
-- WHEN MATCHED THEN
-- UPDATE target SET balance = 0;
-- source and target names the same
MERGE INTO target
USING target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,4 @@
source: crates/squawk_parser/tests/tests.rs
input_file: crates/squawk_parser/tests/data/regression_suite/merge.sql
---
ERROR@1199: expected USING_KW
ERROR@1209: expected ON_KW
ERROR@1210: expected an expression, found USING_KW
ERROR@1215: expected an expression
ERROR@1215: expected WHEN_KW
ERROR@1215: expected MATCHED, or NOT MATCHED
ERROR@1215: expected THEN_KW
ERROR@1215: expected INSERT, UPDATE, DELETE, or DO NOTHING
ERROR@1215: expected SEMICOLON
ERROR@1216: expected command, found SOURCE_KW
ERROR@1223: expected command, found AS_KW
ERROR@1226: expected command, found IDENT
ERROR@1228: expected command, found ON_KW
ERROR@1231: expected command, found IDENT
ERROR@1232: expected command, found DOT
ERROR@1233: expected command, found IDENT
ERROR@1237: expected command, found EQ
ERROR@1239: expected command, found IDENT
ERROR@1240: expected command, found DOT
ERROR@1241: expected command, found IDENT
ERROR@1245: expected command, found WHEN_KW
ERROR@1250: expected command, found MATCHED_KW
ERROR@1258: expected command, found THEN_KW
ERROR@1282: expected SET_KW
ERROR@1282: expected name
ERROR@1680: expected VALUES or DEFAULT VALUES
ERROR@1680: expected SEMICOLON
ERROR@1681: expected command, found INTO_KW
ERROR@1686: expected command, found TARGET_KW
ERROR@1693: expected command, found DEFAULT_KW
ERROR@1707: expected L_PAREN
ERROR@1735: expected L_PAREN
ERROR@1741: expected L_PAREN
ERROR@1746: expected L_PAREN
ERROR@1753: expected L_PAREN
ERROR@1755: expected L_PAREN
ERROR@1761: expected L_PAREN
ERROR@1768: expected L_PAREN
ERROR@1771: expected L_PAREN
ERROR@1773: expected L_PAREN
ERROR@1776: expected L_PAREN
ERROR@1777: expected L_PAREN
ERROR@1778: expected L_PAREN
ERROR@1782: expected L_PAREN
ERROR@1784: expected L_PAREN
ERROR@1785: expected L_PAREN
ERROR@1786: expected L_PAREN
ERROR@1790: expected L_PAREN
ERROR@1795: expected L_PAREN
ERROR@1799: expected L_PAREN
ERROR@1807: expected L_PAREN
ERROR@1813: expected L_PAREN
ERROR@1820: expected L_PAREN
ERROR@1952: expected VALUES or DEFAULT VALUES
ERROR@1952: expected SEMICOLON
ERROR@2336: expected SET_KW
ERROR@2343: expected EQ
ERROR@2347: expected SEMICOLON
ERROR@2348: expected command, found IDENT
ERROR@2356: expected command, found EQ
ERROR@2358: expected command, found INT_NUMBER

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
source: crates/squawk_parser/tests/tests.rs
expression: "out.join(\"\\n\")"
---
tests/snapshots/tests__regression_merge.snap:61
tests/snapshots/tests__regression_strings.snap:49
tests/snapshots/tests__regression_xml.snap:382
Loading