From 9273e8fc0292e294fa505c6577c72d27a61fa1c1 Mon Sep 17 00:00:00 2001 From: Steve Dignam Date: Thu, 29 May 2025 22:38:42 -0400 Subject: [PATCH] parser: pg test suite burn down part 2 --- PLAN.md | 10 + .../src/generated/syntax_kind.rs | 1 + crates/squawk_parser/src/grammar.rs | 100 +- crates/squawk_parser/src/lib.rs | 7 + .../tests/data/ok/create_function.sql | 6 +- .../tests/data/ok/create_table.sql | 4 + .../tests/data/ok/select_casts.sql | 2 + .../tests/data/regression_suite/psql.sql | 1113 ----------------- .../data/regression_suite/psql_crosstab.sql | 121 -- .../data/regression_suite/psql_pipeline.sql | 295 ----- .../snapshots/tests__create_function_ok.snap | 57 +- .../snapshots/tests__create_table_err.snap | 1 - .../snapshots/tests__create_table_ok.snap | 68 +- .../tests__create_table_pg17_ok.snap | 1 - .../tests__regression_alter_generic.snap | 17 - .../snapshots/tests__regression_arrays.snap | 9 - .../tests__regression_btree_index.snap | 36 - .../snapshots/tests__regression_cluster.snap | 23 - .../tests__regression_collate.icu.utf8.snap | 37 - .../tests__regression_collate.linux.utf8.snap | 16 - .../tests__regression_create_aggregate.snap | 49 - ...tests__regression_create_function_sql.snap | 19 - .../tests__regression_generated_stored.snap | 21 - .../tests__regression_generated_virtual.snap | 17 - .../snapshots/tests__regression_interval.snap | 6 - .../snapshots/tests__regression_json.snap | 16 - .../snapshots/tests__regression_jsonb.snap | 12 - .../snapshots/tests__regression_matview.snap | 1 - .../snapshots/tests__regression_numeric.snap | 9 - .../tests__regression_privileges.snap | 15 - .../snapshots/tests__regression_psql.snap | 747 ----------- .../tests__regression_psql_crosstab.snap | 119 -- .../tests__regression_psql_pipeline.snap | 653 ---------- .../tests__regression_suite_errors.snap | 25 +- .../snapshots/tests__select_casts_ok.snap | 27 +- .../squawk_syntax/src/ast/generated/nodes.rs | 41 + crates/squawk_syntax/src/postgresql.ungram | 4 +- crates/xtask/src/download_regression_tests.rs | 4 + 38 files changed, 296 insertions(+), 3413 deletions(-) delete mode 100644 crates/squawk_parser/tests/data/regression_suite/psql.sql delete mode 100644 crates/squawk_parser/tests/data/regression_suite/psql_crosstab.sql delete mode 100644 crates/squawk_parser/tests/data/regression_suite/psql_pipeline.sql delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_alter_generic.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_arrays.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_cluster.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_create_aggregate.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_create_function_sql.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_generated_stored.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_interval.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_json.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_jsonb.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_numeric.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_psql.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_psql_crosstab.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_psql_pipeline.snap diff --git a/PLAN.md b/PLAN.md index 73947000..1aad7b8f 100644 --- a/PLAN.md +++ b/PLAN.md @@ -715,6 +715,16 @@ type: string https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide +### VSCode Syntax Highlighting + +Aka a non-semantic version + +### Monaco Support + +- Monaco Syntax Highlighting + +### Codemirror Support + ### Show Syntax Tree Command replicate what we have in WASM in IDE diff --git a/crates/squawk_parser/src/generated/syntax_kind.rs b/crates/squawk_parser/src/generated/syntax_kind.rs index 10dd19e9..29d8c8a7 100644 --- a/crates/squawk_parser/src/generated/syntax_kind.rs +++ b/crates/squawk_parser/src/generated/syntax_kind.rs @@ -817,6 +817,7 @@ pub enum SyntaxKind { NOTIFY, NOT_DEFERRABLE, NOT_DEFERRABLE_CONSTRAINT_OPTION, + NOT_ILIKE, NOT_IN, NOT_LIKE, NOT_NULL_CONSTRAINT, diff --git a/crates/squawk_parser/src/grammar.rs b/crates/squawk_parser/src/grammar.rs index f7df0190..95ae19dd 100644 --- a/crates/squawk_parser/src/grammar.rs +++ b/crates/squawk_parser/src/grammar.rs @@ -1776,6 +1776,13 @@ fn opt_interval_trailing(p: &mut Parser<'_>) { (SECOND_KW, _) => { interval_second(p); } + (L_PAREN, _) => { + p.bump(L_PAREN); + if opt_numeric_literal(p).is_none() { + p.error("expected number") + } + p.bump(R_PAREN); + } _ => (), } } @@ -1795,6 +1802,12 @@ fn name_ref_(p: &mut Parser<'_>) -> Option { p.expect(ZONE_KW); } } else if p.eat(INTERVAL_KW) { + if p.eat(L_PAREN) { + if opt_numeric_literal(p).is_none() { + p.error("expected number"); + } + p.expect(R_PAREN); + } is_interval_cast = true; } else { p.bump_any(); @@ -2055,8 +2068,12 @@ fn current_op(p: &Parser<'_>, r: &Restrictions) -> (u8, SyntaxKind, Associativit OVERLAPS_KW => (7, OVERLAPS_KW, Left), // like LIKE_KW => (6, LIKE_KW, Left), + // ilike + ILIKE_KW => (6, ILIKE_KW, Left), // not like NOT_KW if !r.not_disabled && p.at(NOT_LIKE) => (6, NOT_LIKE, Left), + // not ilike + NOT_KW if !r.not_disabled && p.at(NOT_ILIKE) => (6, NOT_ILIKE, Left), // not in NOT_KW if !r.not_disabled && p.at(NOT_IN) => (6, NOT_IN, Left), // is distinct from @@ -2713,7 +2730,7 @@ fn data_source(p: &mut Parser<'_>) { json_table_fn(p); opt_alias(p); } - ROWS_KW => { + ROWS_KW if p.nth_at(1, FROM_KW) => { p.bump(ROWS_KW); p.expect(FROM_KW); p.expect(L_PAREN); @@ -3301,8 +3318,18 @@ fn opt_constraint_inner(p: &mut Parser<'_>) -> Option { p.expect(ALWAYS_KW); } p.expect(AS_KW); - p.expect(IDENTITY_KW); - opt_sequence_options(p); + if p.eat(L_PAREN) { + if expr(p).is_none() { + p.error("expected an expression"); + } + p.expect(R_PAREN); + if !p.eat(STORED_KW) && !p.eat(VIRTUAL_KW) { + p.error("expected STORED or VIRTUAL"); + } + } else { + p.expect(IDENTITY_KW); + opt_sequence_options(p); + } GENERATED_CONSTRAINT } else { p.error("expected generated type"); @@ -8264,7 +8291,7 @@ fn create_materialized_view(p: &mut Parser<'_>) -> CompletedMarker { }, ); match statement.map(|x| x.kind()) { - Some(SELECT | TABLE | VALUES) => (), + Some(SELECT | SELECT_INTO | COMPOUND_SELECT | TABLE | VALUES) => (), Some(kind) => { p.error(format!( "expected SELECT, TABLE, or VALUES statement, got {:?}", @@ -8373,7 +8400,7 @@ fn operator_class_option(p: &mut Parser<'_>) { } if p.eat(L_PAREN) { type_name(p); - if p.eat(COMMA) { + while !p.at(EOF) && p.eat(COMMA) { type_name(p); } p.expect(R_PAREN); @@ -8400,7 +8427,7 @@ fn operator_drop_class_option(p: &mut Parser<'_>) { } if p.eat(L_PAREN) { type_name(p); - if p.eat(COMMA) { + while !p.at(EOF) && !p.at(R_PAREN) && p.eat(COMMA) { type_name(p); } p.expect(R_PAREN); @@ -10045,14 +10072,13 @@ fn grant(p: &mut Parser<'_>) -> CompletedMarker { // ALL [ PRIVILEGES ] if p.eat(ALL_KW) { p.eat(PRIVILEGES_KW); + opt_column_list(p); } else if !p.at(TO_KW) { revoke_command(p); while !p.at(EOF) && p.eat(COMMA) { revoke_command(p); } } - // [ ( column_name [, ...] ) ] - opt_column_list(p); // ON { [ TABLE ] table_name [, ...] // | ALL TABLES IN SCHEMA schema_name [, ...] } // ON { SEQUENCE sequence_name [, ...] @@ -10295,16 +10321,17 @@ const REVOKE_COMMAND_FIRST: TokenSet = TokenSet::new(&[ ]); fn revoke_command(p: &mut Parser<'_>) { - if opt_role(p) { - return; - } - if p.eat(ALTER_KW) { - p.expect(SYSTEM_KW); - } else if p.at_ts(REVOKE_COMMAND_FIRST) { - p.bump_any(); - } else { - p.error(format!("expected command name, got {:?}", p.current())) + if !opt_role(p) { + if p.eat(ALTER_KW) { + p.expect(SYSTEM_KW); + } else if p.at_ts(REVOKE_COMMAND_FIRST) { + p.bump_any(); + } else { + p.error(format!("expected command name, got {:?}", p.current())) + } } + // [ ( column_name [, ...] ) ] + opt_column_list(p); } // where role_specification can be: @@ -10913,11 +10940,7 @@ fn opt_temp(p: &mut Parser<'_>) -> bool { p.eat(TEMP_KW) || p.eat(TEMPORARY_KW) } -// DO [ LANGUAGE lang_name ] code -fn do_(p: &mut Parser<'_>) -> CompletedMarker { - assert!(p.at(DO_KW)); - let m = p.start(); - p.bump(DO_KW); +fn opt_language(p: &mut Parser<'_>) { if p.eat(LANGUAGE_KW) { if p.at_ts(NON_RESERVED_WORD) { p.bump_any(); @@ -10925,7 +10948,16 @@ fn do_(p: &mut Parser<'_>) -> CompletedMarker { string_literal(p); } } +} + +// DO [ LANGUAGE lang_name ] code +fn do_(p: &mut Parser<'_>) -> CompletedMarker { + assert!(p.at(DO_KW)); + let m = p.start(); + p.bump(DO_KW); + opt_language(p); string_literal(p); + opt_language(p); m.complete(p, DO) } @@ -12155,6 +12187,9 @@ fn param(p: &mut Parser<'_>) { // foo(8) // ^ L_PAREN => true, + // text[] + // ^ + L_BRACK => true, // float8 order by // ^ ORDER_KW => true, @@ -12163,7 +12198,7 @@ fn param(p: &mut Parser<'_>) { _ => false, }; if at_type { - name_or_type.complete(p, PATH_TYPE); + type_mods(p, name_or_type, true, PATH_TYPE); } else { name_or_type.complete(p, NAME); if !param_mode_seen { @@ -12347,12 +12382,19 @@ fn opt_function_option(p: &mut Parser<'_>) -> bool { if p.eat(SEMICOLON) { continue; } - stmt( - p, - &StmtRestrictions { - begin_end_allowed: false, - }, - ); + // sql standard + if p.eat(RETURN_KW) { + if expr(p).is_none() { + p.error("expected expr") + } + } else { + stmt( + p, + &StmtRestrictions { + begin_end_allowed: false, + }, + ); + } if p.at(END_KW) { p.expect(SEMICOLON); } diff --git a/crates/squawk_parser/src/lib.rs b/crates/squawk_parser/src/lib.rs index 8de02ca3..5e8b9b17 100644 --- a/crates/squawk_parser/src/lib.rs +++ b/crates/squawk_parser/src/lib.rs @@ -263,6 +263,13 @@ impl<'t> Parser<'t> { m.complete(self, SyntaxKind::NOT_LIKE); return true; } + SyntaxKind::NOT_ILIKE => { + let m = self.start(); + self.bump(SyntaxKind::NOT_KW); + self.bump(SyntaxKind::ILIKE_KW); + m.complete(self, SyntaxKind::NOT_ILIKE); + return true; + } SyntaxKind::NOT_IN => { let m = self.start(); self.bump(SyntaxKind::NOT_KW); diff --git a/crates/squawk_parser/tests/data/ok/create_function.sql b/crates/squawk_parser/tests/data/ok/create_function.sql index 72a1ef01..0928f5f8 100644 --- a/crates/squawk_parser/tests/data/ok/create_function.sql +++ b/crates/squawk_parser/tests/data/ok/create_function.sql @@ -405,5 +405,7 @@ create function f(int8) returns void as '' language sql; - - +-- array type +create function f (internal, text[], bool) +returns void +as '' language sql; diff --git a/crates/squawk_parser/tests/data/ok/create_table.sql b/crates/squawk_parser/tests/data/ok/create_table.sql index 7d30d4c0..cec462f5 100644 --- a/crates/squawk_parser/tests/data/ok/create_table.sql +++ b/crates/squawk_parser/tests/data/ok/create_table.sql @@ -316,6 +316,10 @@ create table t partition of foo.bar for values from ('bar') to ('buzz'); +create table t partition of u ( + c generated always as (b * 2) stored +) for values from ('2016-09-01') to ('2016-10-01'); + -- missing entries create table t (); diff --git a/crates/squawk_parser/tests/data/ok/select_casts.sql b/crates/squawk_parser/tests/data/ok/select_casts.sql index da273c94..c10ba845 100644 --- a/crates/squawk_parser/tests/data/ok/select_casts.sql +++ b/crates/squawk_parser/tests/data/ok/select_casts.sql @@ -87,6 +87,8 @@ select '10 days'::interval year; select '10 days'::interval month; +select '10 days'::interval(0); + select '10 days'::interval day; select '10 days'::interval hour; diff --git a/crates/squawk_parser/tests/data/regression_suite/psql.sql b/crates/squawk_parser/tests/data/regression_suite/psql.sql deleted file mode 100644 index dc0e9dd3..00000000 --- a/crates/squawk_parser/tests/data/regression_suite/psql.sql +++ /dev/null @@ -1,1113 +0,0 @@ --- --- Tests for psql features that aren't closely connected to any --- specific server features --- - --- \set - --- fail: invalid name --- fail: invalid value for special variable --- check handling of built-in boolean variable - --- \g and \gx - -SELECT 1 as one, 2 as two \g -SELECT 3 as three, 4 as four \gx - --- \gx should work in FETCH_COUNT mode too - -SELECT 1 as one, 2 as two \g -SELECT 3 as three, 4 as four \gx - - --- \g/\gx with pset options - -SELECT 1 as one, 2 as two \g (format=csv csv_fieldsep='\t') -SELECT 1 as one, 2 as two \gx (title='foo bar') - --- \parse (extended query protocol) -SELECT 1 \parse '' -SELECT 2 \parse stmt1 -SELECT $1 \parse stmt2 -SELECT $1, $2 \parse stmt3 - --- \bind_named (extended query protocol) --- Repeated calls. The second call generates an error, cleaning up the --- statement name set by the first call. --- Last \bind_named wins --- Multiple \g calls mean multiple executions - --- \close (extended query protocol) -SELECT name, statement FROM pg_prepared_statements ORDER BY name; - --- \bind (extended query protocol) -SELECT 1 \bind \g -SELECT $1 \bind 'foo' \g -SELECT $1, $2 \bind 'foo' 'bar' \g - --- last \bind wins -select $1::int as col \bind 'foo' \bind 2 \g --- Multiple \g calls mean multiple executions -select $1::int as col \bind 1 \g \bind 2 \g - --- errors --- parse error -SELECT foo \bind \g --- tcop error -SELECT 1 \; SELECT 2 \bind \g --- bind error -SELECT $1, $2 \bind 'foo' \g --- bind_named error - --- ; - -select 10 as test01, 20 as test02, 'Hello' as test03 ; pref01_ - - --- should fail: bad variable name -select 10 as "bad name" - -select 97 as "EOF", 'ok' as _foo ; IGNORE - --- multiple backslash commands in one line -select 1 as x, 2 as y ; pref01_ \\ \echo 'pref01_x' -select 3 as x, 4 as y ; pref01_ \echo 'pref01_x' \echo 'pref01_y' -select 5 as x, 6 as y ; pref01_ \\ \g \echo 'pref01_x' 'pref01_y' -select 7 as x, 8 as y \g ; pref01_ \echo 'pref01_x' 'pref01_y' - --- NULL should unset the variable -select 1 as var1, NULL as var2, 3 as var3 ; - --- ; requires just one tuple -select 10 as test01, 20 as test02 from generate_series(1,3) ; -select 10 as test01, 20 as test02 from generate_series(1,0) ; - --- ; returns no tuples -select a from generate_series(1, 10) as a where a = 11 ; - --- ; should work in FETCH_COUNT mode too - -select 1 as x, 2 as y ; pref01_ \\ \echo 'pref01_x' -select 3 as x, 4 as y ; pref01_ \echo 'pref01_x' \echo 'pref01_y' -select 10 as test01, 20 as test02 from generate_series(1,3) ; -select 10 as test01, 20 as test02 from generate_series(1,0) ; - - --- \gdesc - -SELECT - NULL AS zero, - 1 AS one, - 2.0 AS two, - 'three' AS three, - $1 AS four, - sin($2) as five, - 'foo'::varchar(4) as six, - CURRENT_DATE AS now - --- should work with tuple-returning utilities, such as EXECUTE -PREPARE test AS SELECT 1 AS first, 2 AS second; -EXECUTE test \gdesc -EXPLAIN EXECUTE test \gdesc - --- should fail cleanly - syntax error -SELECT 1 + \gdesc - --- check behavior with empty results -SELECT \gdesc -CREATE TABLE bububu(a int) \gdesc - --- subject command should not have executed -TABLE bububu; -- fail - --- query buffer should remain unchanged -SELECT 1 AS x, 'Hello', 2 AS y, true AS "dirty\name" - --- all on one line -SELECT 3 AS x, 'Hello', 4 AS y, true AS "dirty\name" \gdesc \g - --- test for server bug #17983 with empty statement in aborted transaction -set search_path = default; -begin; -bogus; -; -rollback; - --- \gexec - -create temporary table gexec_test(a int, b text, c date, d float); -select format('create index on gexec_test(%I)', attname) -from pg_attribute -where attrelid = 'gexec_test'::regclass and attnum > 0 -order by attnum - --- \gexec should work in FETCH_COUNT mode too --- (though the fetch limit applies to the executed queries not the meta query) - -select 'select 1 as ones', 'select x.y, x.y*2 as double from generate_series(1,4) as x(y)' -union all -select 'drop table gexec_test', NULL -union all -select 'drop table gexec_test', 'select ''2000-01-01''::date as party_over' - - --- \setenv, \getenv - --- ensure MYVAR isn't set --- in which case, reading it doesn't change the target --- now set it - --- show all pset options - --- test multi-line headers, wrapping, and newline indicators --- in aligned, unaligned, and wrapped formats -prepare q as select array_to_string(array_agg(repeat('x',2*n)),E'\n') as "ab - -c", array_to_string(array_agg(repeat('y',20-2*n)),E'\n') as "a -bc" from generate_series(1,10) as n(n) group by n>1 order by n>1; - - - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - - - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - -deallocate q; - --- test single-line header and data -prepare q as select repeat('x',2*n) as "0123456789abcdef", repeat('y',20-2*n) as "0123456789" from generate_series(1,10) as n; - - - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - - - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - -execute q; -execute q; -execute q; - -deallocate q; - - --- support table for output-format tests (useful to create a footer) - -create table psql_serial_tab (id serial); - --- test header/footer/tuples_only behavior in aligned/unaligned/wrapped cases - - --- empty table is a special case for this format -select 1 where false; - - - - - --- check conditional am display - -CREATE SCHEMA tableam_display; -CREATE ROLE regress_display_role; -ALTER SCHEMA tableam_display OWNER TO regress_display_role; -SET search_path TO tableam_display; -CREATE ACCESS METHOD heap_psql TYPE TABLE HANDLER heap_tableam_handler; -SET ROLE TO regress_display_role; --- Use only relations with a physical size of zero. -CREATE TABLE tbl_heap_psql(f1 int, f2 char(100)) using heap_psql; -CREATE TABLE tbl_heap(f1 int, f2 char(100)) using heap; -CREATE VIEW view_heap_psql AS SELECT f1 from tbl_heap_psql; -CREATE MATERIALIZED VIEW mat_view_heap_psql USING heap_psql AS SELECT f1 from tbl_heap_psql; --- AM is displayed for tables, indexes and materialized views. --- But not for views and sequences. --- \d with 'x' enables expanded mode, but only without a pattern -RESET ROLE; -RESET search_path; -DROP SCHEMA tableam_display CASCADE; -DROP ACCESS METHOD heap_psql; -DROP ROLE regress_display_role; - --- test numericlocale (as best we can without control of psql's locale) - - -select n, -n as m, n * 111 as x, '1e90'::float8 as f -from generate_series(0,3) n; - - --- test asciidoc output format - - - -prepare q as - select 'some|text' as "a|title", ' ' as "empty ", n as int - from generate_series(1,2) as n; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -deallocate q; - --- test csv output format - - - -prepare q as - select 'some"text' as "a""title", E' \n' as "junk", - ' ' as "empty", n as int - from generate_series(1,2) as n; - -execute q; - -execute q; - -deallocate q; - --- special cases -select 'comma,comma' as comma, 'semi;semi' as semi; -select 'comma,comma' as comma, 'semi;semi' as semi; -select '\.' as data; -select '\' as d1, '' as d2; - --- illegal csv separators - - --- test html output format - - - -prepare q as - select 'some"text' as "a&title", E' \n' as "junk", - ' ' as "empty", n as int - from generate_series(1,2) as n; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -deallocate q; - --- test latex output format - - - -prepare q as - select 'some\more_text' as "a$title", E' #%&^~|\n{bar}' as "junk", - ' ' as "empty", n as int - from generate_series(1,2) as n; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -deallocate q; - --- test latex-longtable output format - - - -prepare q as - select 'some\more_text' as "a$title", E' #%&^~|\n{bar}' as "junk", - ' ' as "empty", n as int - from generate_series(1,2) as n; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -deallocate q; - --- test troff-ms output format - - - -prepare q as - select 'some\text' as "a\title", E' \n' as "junk", - ' ' as "empty", n as int - from generate_series(1,2) as n; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -execute q; - -deallocate q; - --- check ambiguous format requests - - --- clean up after output format tests - -drop table psql_serial_tab; - - --- \echo and allied features - - - - - --- tests for \if ... \endif - - select 'okay'; - select 'still okay'; - not okay; - still not okay - --- at this point query buffer should still have last valid line - --- \if should work okay on part of a query -select - \if true - 42 - \else - (bogus - \endif - forty_two; - -select \if false \\ (bogus \else \\ 42 \endif \\ forty_two; - --- test a large nested if using a variety of true-equivalents - \if 1 - \if yes - \if on - \echo 'all true' - \else - \echo 'should not print #1-1' - \endif - \else - \echo 'should not print #1-2' - \endif - \else - \echo 'should not print #1-3' - \endif - \echo 'should not print #1-4' - --- test a variety of false-equivalents in an if/elif/else structure - \echo 'should not print #2-1' - \echo 'should not print #2-2' - \echo 'should not print #2-3' - \echo 'should not print #2-4' - \echo 'all false' - --- test true-false elif after initial true branch - \echo 'should print #2-5' - \echo 'should not print #2-6' - \echo 'should not print #2-7' - \echo 'should not print #2-8' - --- test simple true-then-else - \echo 'first thing true' - \echo 'should not print #3-1' - --- test simple false-true-else - \echo 'should not print #4-1' - \echo 'second thing true' - \echo 'should not print #5-1' - --- invalid boolean expressions are false - \echo 'will not print #6-1' - \echo 'will print anyway #6-2' - --- test un-matched endif - --- test un-matched else - --- test un-matched elif - --- test double-else error - --- test elif out-of-order - --- test if-endif matching in a false branch - \if false - \echo 'should not print #7-1' - \else - \echo 'should not print #7-2' - \endif - \echo 'should not print #7-3' - \echo 'should print #7-4' - --- show that vars and backticks are not expanded when ignoring extra args - --- show that vars and backticks are not expanded and commands are ignored --- when in a false if-branch - 'try_to_quit' - \echo `nosuchcommand` 'foo' 'foo' :"foo" - \pset fieldsep | `nosuchcommand` 'foo' 'foo' :"foo" - \a - SELECT $1 \bind 1 \g - \bind_named stmt1 1 2 \g - \C arg1 - \c arg1 arg2 arg3 arg4 - \cd arg1 - \close stmt1 - \conninfo - \copy arg1 arg2 arg3 arg4 arg5 arg6 - \copyright - SELECT 1 as one, 2, 3 \crosstabview - \dt arg1 - \e arg1 arg2 - \ef whole_line - \ev whole_line - \echo arg1 arg2 arg3 arg4 arg5 - \echo arg1 - \encoding arg1 - \endpipeline - \errverbose - \f arg1 - \flush - \flushrequest - \g arg1 - \gx arg1 - \gexec - \getresults - SELECT 1 AS one ; - \h - \? - \html - \i arg1 - \ir arg1 - \l arg1 - \lo arg1 arg2 - \lo_list - \o arg1 - \p - SELECT 1 \parse - \password arg1 - \prompt arg1 arg2 - \pset arg1 arg2 - \q - \reset - \s arg1 - \sendpipeline - \set arg1 arg2 arg3 arg4 arg5 arg6 arg7 - \setenv arg1 arg2 - \sf whole_line - \sv whole_line - \startpipeline - \syncpipeline - \t arg1 - \T arg1 - \timing arg1 - \unset arg1 - \w arg1 - \watch arg1 arg2 - \x arg1 - -- \else here is eaten as part of OT_FILEPIPE argument - \w |/no/such/file \else - -- \endif here is eaten as part of whole-line argument - \! whole_line \endif - \z - \echo 'should print #8-1' - --- :{?...} defined variable test - \echo '#9-1 ok, variable i is defined' - \echo 'should not print #9-2' - - \echo 'should not print #10-1' - \echo '#10-2 ok, variable no_such_variable is not defined' - -SELECT :{?i} AS i_is_defined; - -SELECT NOT :{?no_such_var} AS no_such_var_is_not_defined; - --- SHOW_CONTEXT - -do $$ -begin - raise notice 'foo'; - raise exception 'bar'; -end $$; - -do $$ -begin - raise notice 'foo'; - raise exception 'bar'; -end $$; - -do $$ -begin - raise notice 'foo'; - raise exception 'bar'; -end $$; - --- test printing and clearing the query buffer -SELECT 1; -SELECT 2 \r -SELECT 3 \p -UNION SELECT 4 \p -UNION SELECT 5 -ORDER BY 1; - --- tests for special result variables - --- working query, 2 rows selected -SELECT 1 AS stuff UNION SELECT 2; - --- syntax error -SELECT 1 UNION; - --- empty query -; --- must have kept previous values - --- other query error -DROP TABLE this_table_does_not_exist; - --- nondefault verbosity error settings (except verbose, which is too unstable) -SELECT 1 UNION; - -SELECT 1/0; - - --- working \gdesc -SELECT 3 AS three, 4 AS four \gdesc - --- \gdesc with an error -SELECT 4 AS \gdesc - --- check row count for a query with chunked results -select unique2 from tenk1 order by unique2 limit 19; - --- chunked results with an error after the first chunk --- (we must disable parallel query here, else the behavior is timing-dependent) -set debug_parallel_query = off; -select 1/(15-unique2) from tenk1 order by unique2 limit 19; -reset debug_parallel_query; - - -create schema testpart; -create role regress_partitioning_role; - -alter schema testpart owner to regress_partitioning_role; - -set role to regress_partitioning_role; - --- run test inside own schema and hide other partitions -set search_path to testpart; - -create table testtable_apple(logdate date); -create table testtable_orange(logdate date); -create index testtable_apple_index on testtable_apple(logdate); -create index testtable_orange_index on testtable_orange(logdate); - -create table testpart_apple(logdate date) partition by range(logdate); -create table testpart_orange(logdate date) partition by range(logdate); - -create index testpart_apple_index on testpart_apple(logdate); -create index testpart_orange_index on testpart_orange(logdate); - --- only partition related object should be displayed - -drop table testtable_apple; -drop table testtable_orange; -drop table testpart_apple; -drop table testpart_orange; - -create table parent_tab (id int) partition by range (id); -create index parent_index on parent_tab (id); -create table child_0_10 partition of parent_tab - for values from (0) to (10); -create table child_10_20 partition of parent_tab - for values from (10) to (20); -create table child_20_30 partition of parent_tab - for values from (20) to (30); -insert into parent_tab values (generate_series(0,29)); -create table child_30_40 partition of parent_tab -for values from (30) to (40) - partition by range(id); -create table child_30_35 partition of child_30_40 - for values from (30) to (35); -create table child_35_40 partition of child_30_40 - for values from (35) to (40); -insert into parent_tab values (generate_series(30,39)); - - - - -drop table parent_tab cascade; - -drop schema testpart; - -set search_path to default; - -set role to default; -drop role regress_partitioning_role; - --- \d on toast table (use pg_statistic's toast table, which has a known name) - --- check printing info about access methods - --- check \dconfig -set work_mem = 10240; -reset work_mem; - --- check \df, \do with argument specifications - --- check \df+ --- we have to use functions with a predictable owner name, so make a role -create role regress_psql_user superuser; -begin; -set session authorization regress_psql_user; - -create function psql_df_internal (float8) - returns float8 - language internal immutable parallel safe strict - as 'dsin'; -create function psql_df_sql (x integer) - returns integer - security definer - begin atomic select x + 1; end; -create function psql_df_plpgsql () - returns void - language plpgsql - as $$ begin return; end; $$; -comment on function psql_df_plpgsql () is 'some comment'; - -rollback; -drop role regress_psql_user; - --- check \sf - --- AUTOCOMMIT - -CREATE TABLE ac_test (a int); - -INSERT INTO ac_test VALUES (1); -COMMIT; -SELECT * FROM ac_test; -COMMIT; - -INSERT INTO ac_test VALUES (2); -ROLLBACK; -SELECT * FROM ac_test; -COMMIT; - -BEGIN; -INSERT INTO ac_test VALUES (3); -COMMIT; -SELECT * FROM ac_test; -COMMIT; - -BEGIN; -INSERT INTO ac_test VALUES (4); -ROLLBACK; -SELECT * FROM ac_test; -COMMIT; - -DROP TABLE ac_test; -SELECT * FROM ac_test; -- should be gone now - --- ON_ERROR_ROLLBACK - -CREATE TABLE oer_test (a int); - -BEGIN; -INSERT INTO oer_test VALUES (1); -INSERT INTO oer_test VALUES ('foo'); -INSERT INTO oer_test VALUES (3); -COMMIT; -SELECT * FROM oer_test; - -BEGIN; -INSERT INTO oer_test VALUES (4); -ROLLBACK; -SELECT * FROM oer_test; - -BEGIN; -INSERT INTO oer_test VALUES (5); -COMMIT AND CHAIN; -INSERT INTO oer_test VALUES (6); -COMMIT; -SELECT * FROM oer_test; - -DROP TABLE oer_test; - --- ECHO errors -SELECT * FROM notexists; - --- --- combined queries --- -CREATE FUNCTION warn(msg TEXT) RETURNS BOOLEAN LANGUAGE plpgsql -AS $$ - BEGIN RAISE NOTICE 'warn %', msg ; RETURN TRUE ; END -$$; - --- show both -SELECT 1 AS one \; SELECT warn('1.5') \; SELECT 2 AS two ; --- ; applies to last query only -SELECT 3 AS three \; SELECT warn('3.5') \; SELECT 4 AS four ; --- syntax error stops all processing -SELECT 5 \; SELECT 6 + \; SELECT warn('6.5') \; SELECT 7 ; --- with aborted transaction, stop on first error -BEGIN \; SELECT 8 AS eight \; SELECT 9/0 AS nine \; ROLLBACK \; SELECT 10 AS ten ; --- close previously aborted transaction -ROLLBACK; - --- miscellaneous SQL commands --- (non SELECT output is sent to stderr, thus is not shown in expected results) -SELECT 'ok' AS "begin" \; -CREATE TABLE psql_comics(s TEXT) \; -INSERT INTO psql_comics VALUES ('Calvin'), ('hobbes') \; - -SELECT 1 AS one \; SELECT warn('1.5') \; SELECT 2 AS two ; - -DROP FUNCTION warn(TEXT); - --- --- \g with file --- - -CREATE TEMPORARY TABLE reload_output( - lineno int NOT NULL GENERATED ALWAYS AS IDENTITY, - line text -); - -SELECT 1 AS a \g 'g_out_file' -COPY reload_output(line) FROM 'g_out_file'; -SELECT 2 AS b\; SELECT 3 AS c\; SELECT 4 AS d \g 'g_out_file' -COPY reload_output(line) FROM 'g_out_file'; -COPY (SELECT 'foo') TO STDOUT \; COPY (SELECT 'bar') TO STDOUT \g 'g_out_file' -COPY reload_output(line) FROM 'g_out_file'; - -SELECT line FROM reload_output ORDER BY lineno; -TRUNCATE TABLE reload_output; - --- --- \o with file --- - -SELECT max(unique1) FROM onek; -SELECT 1 AS a\; SELECT 2 AS b\; SELECT 3 AS c; - --- COPY TO file --- The data goes to 'g_out_file' and the status to 'o_out_file' -COPY (SELECT unique1 FROM onek ORDER BY unique1 LIMIT 10) TO 'g_out_file'; --- DML command status -UPDATE onek SET unique1 = unique1 WHERE false; - --- Check the contents of the files generated. -COPY reload_output(line) FROM 'g_out_file'; -SELECT line FROM reload_output ORDER BY lineno; -TRUNCATE TABLE reload_output; -COPY reload_output(line) FROM 'o_out_file'; -SELECT line FROM reload_output ORDER BY lineno; -TRUNCATE TABLE reload_output; - --- Multiple COPY TO STDOUT with output file --- The data goes to 'o_out_file' with no status generated. -COPY (SELECT 'foo1') TO STDOUT \; COPY (SELECT 'bar1') TO STDOUT; --- Combination of \o and \g file with multiple COPY queries. -COPY (SELECT 'foo2') TO STDOUT \; COPY (SELECT 'bar2') TO STDOUT \g 'g_out_file' - --- Check the contents of the files generated. -COPY reload_output(line) FROM 'g_out_file'; -SELECT line FROM reload_output ORDER BY lineno; -TRUNCATE TABLE reload_output; -COPY reload_output(line) FROM 'o_out_file'; -SELECT line FROM reload_output ORDER BY lineno; - -DROP TABLE reload_output; - --- --- AUTOCOMMIT and combined queries --- --- BEGIN is now implicit - -CREATE TABLE foo(s TEXT) \; -ROLLBACK; - -CREATE TABLE foo(s TEXT) \; -INSERT INTO foo(s) VALUES ('hello'), ('world') \; -COMMIT; - -DROP TABLE foo \; -ROLLBACK; - --- table foo is still there -SELECT * FROM foo ORDER BY 1 \; -DROP TABLE foo \; -COMMIT; - --- BEGIN now explicit for multi-statement transactions - -BEGIN \; -CREATE TABLE foo(s TEXT) \; -INSERT INTO foo(s) VALUES ('hello'), ('world') \; -COMMIT; - -BEGIN \; -DROP TABLE foo \; -ROLLBACK \; - --- implicit transactions -SELECT * FROM foo ORDER BY 1 \; -DROP TABLE foo; - --- --- test ON_ERROR_ROLLBACK and combined queries --- -CREATE FUNCTION psql_error(msg TEXT) RETURNS BOOLEAN AS $$ - BEGIN - RAISE EXCEPTION 'error %', msg; - END; -$$ LANGUAGE plpgsql; - - -BEGIN; -CREATE TABLE bla(s NO_SUCH_TYPE); -- fails -CREATE TABLE bla(s TEXT); -- succeeds -SELECT psql_error('oops!'); -- fails -INSERT INTO bla VALUES ('Calvin'), ('Hobbes'); -COMMIT; - -SELECT * FROM bla ORDER BY 1; - -BEGIN; -INSERT INTO bla VALUES ('Susie'); -- succeeds --- now with combined queries -INSERT INTO bla VALUES ('Rosalyn') \; -- will rollback -SELECT 'before error' AS show \; -- will show nevertheless! - SELECT psql_error('boum!') \; -- failure - SELECT 'after error' AS noshow; -- hidden by preceding error -INSERT INTO bla(s) VALUES ('Moe') \; -- will rollback - SELECT psql_error('bam!'); -INSERT INTO bla VALUES ('Miss Wormwood'); -- succeeds -COMMIT; -SELECT * FROM bla ORDER BY 1; - --- some with autocommit off - --- implicit BEGIN -INSERT INTO bla VALUES ('Dad'); -- succeeds -SELECT psql_error('bad!'); -- implicit partial rollback - -INSERT INTO bla VALUES ('Mum') \; -- will rollback -SELECT COUNT(*) AS "#mum" -FROM bla WHERE s = 'Mum' \; -- but be counted here -SELECT psql_error('bad!'); -- implicit partial rollback -COMMIT; - -SELECT COUNT(*) AS "#mum" -FROM bla WHERE s = 'Mum' \; -- no mum here -SELECT * FROM bla ORDER BY 1; -COMMIT; - --- reset all -DROP TABLE bla; -DROP FUNCTION psql_error; - --- check describing invalid multipart names - --- check that dots within quoted name segments are not counted - --- again, but with dotted schema qualifications. - --- again, but with current database and dotted schema qualifications. - --- again, but with dotted database and dotted schema qualifications. - --- check \drg and \du -CREATE ROLE regress_du_role0; -CREATE ROLE regress_du_role1; -CREATE ROLE regress_du_role2; -CREATE ROLE regress_du_admin; - -GRANT regress_du_role0 TO regress_du_admin WITH ADMIN TRUE; -GRANT regress_du_role1 TO regress_du_admin WITH ADMIN TRUE; -GRANT regress_du_role2 TO regress_du_admin WITH ADMIN TRUE; - -GRANT regress_du_role0 TO regress_du_role1 WITH ADMIN TRUE, INHERIT TRUE, SET TRUE GRANTED BY regress_du_admin; -GRANT regress_du_role0 TO regress_du_role2 WITH ADMIN TRUE, INHERIT FALSE, SET FALSE GRANTED BY regress_du_admin; -GRANT regress_du_role1 TO regress_du_role2 WITH ADMIN TRUE , INHERIT FALSE, SET TRUE GRANTED BY regress_du_admin; -GRANT regress_du_role0 TO regress_du_role1 WITH ADMIN FALSE, INHERIT TRUE, SET FALSE GRANTED BY regress_du_role1; -GRANT regress_du_role0 TO regress_du_role2 WITH ADMIN FALSE, INHERIT TRUE , SET TRUE GRANTED BY regress_du_role1; -GRANT regress_du_role0 TO regress_du_role1 WITH ADMIN FALSE, INHERIT FALSE, SET TRUE GRANTED BY regress_du_role2; -GRANT regress_du_role0 TO regress_du_role2 WITH ADMIN FALSE, INHERIT FALSE, SET FALSE GRANTED BY regress_du_role2; - - -DROP ROLE regress_du_role0; -DROP ROLE regress_du_role1; -DROP ROLE regress_du_role2; -DROP ROLE regress_du_admin; - --- Test display of empty privileges. -BEGIN; --- Create an owner for tested objects because output contains owner name. -CREATE ROLE regress_zeropriv_owner; -SET LOCAL ROLE regress_zeropriv_owner; - -CREATE DOMAIN regress_zeropriv_domain AS int; -REVOKE ALL ON DOMAIN regress_zeropriv_domain FROM CURRENT_USER, PUBLIC; - -CREATE PROCEDURE regress_zeropriv_proc() LANGUAGE sql AS ''; -REVOKE ALL ON PROCEDURE regress_zeropriv_proc() FROM CURRENT_USER, PUBLIC; - -CREATE TABLE regress_zeropriv_tbl (a int); -REVOKE ALL ON TABLE regress_zeropriv_tbl FROM CURRENT_USER; - -CREATE TYPE regress_zeropriv_type AS (a int); -REVOKE ALL ON TYPE regress_zeropriv_type FROM CURRENT_USER, PUBLIC; - -ROLLBACK; - --- Test display of default privileges with \pset null. -CREATE TABLE defprivs (a int); -DROP TABLE defprivs; diff --git a/crates/squawk_parser/tests/data/regression_suite/psql_crosstab.sql b/crates/squawk_parser/tests/data/regression_suite/psql_crosstab.sql deleted file mode 100644 index 1043149a..00000000 --- a/crates/squawk_parser/tests/data/regression_suite/psql_crosstab.sql +++ /dev/null @@ -1,121 +0,0 @@ --- --- \crosstabview --- - -CREATE TABLE ctv_data (v, h, c, i, d) AS -VALUES - ('v1','h2','foo', 3, '2015-04-01'::date), - ('v2','h1','bar', 3, '2015-01-02'), - ('v1','h0','baz', NULL, '2015-07-12'), - ('v0','h4','qux', 4, '2015-07-15'), - ('v0','h4','dbl', -3, '2014-12-15'), - ('v0',NULL,'qux', 5, '2014-07-15'), - ('v1','h2','quux',7, '2015-04-04'); - --- make plans more stable -ANALYZE ctv_data; - --- running \crosstabview after query uses query in buffer -SELECT v, EXTRACT(year FROM d), count(*) - FROM ctv_data - GROUP BY 1, 2 - ORDER BY 1, 2; --- basic usage with 3 columns - \crosstabview - --- ordered months in horizontal header, quoted column name -SELECT v, to_char(d, 'Mon') AS "month name", EXTRACT(month FROM d) AS num, - count(*) FROM ctv_data GROUP BY 1,2,3 ORDER BY 1 - \crosstabview v "month name" 4 num - --- ordered months in vertical header, ordered years in horizontal header -SELECT EXTRACT(year FROM d) AS year, to_char(d,'Mon') AS """month"" name", - EXTRACT(month FROM d) AS month, - format('sum=%s avg=%s', sum(i), avg(i)::numeric(2,1)) - FROM ctv_data - GROUP BY EXTRACT(year FROM d), to_char(d,'Mon'), EXTRACT(month FROM d) -ORDER BY month - --- combine contents vertically into the same cell (V/H duplicates) -SELECT v, h, string_agg(c, E'\n') FROM ctv_data GROUP BY v, h ORDER BY 1,2,3 - \crosstabview 1 2 3 - --- horizontal ASC order from window function -SELECT v,h, string_agg(c, E'\n') AS c, row_number() OVER(ORDER BY h) AS r -FROM ctv_data GROUP BY v, h ORDER BY 1,3,2 - \crosstabview v h c r - --- horizontal DESC order from window function -SELECT v, h, string_agg(c, E'\n') AS c, row_number() OVER(ORDER BY h DESC) AS r -FROM ctv_data GROUP BY v, h ORDER BY 1,3,2 - \crosstabview v h c r - --- horizontal ASC order from window function, NULLs pushed rightmost -SELECT v,h, string_agg(c, E'\n') AS c, row_number() OVER(ORDER BY h NULLS LAST) AS r -FROM ctv_data GROUP BY v, h ORDER BY 1,3,2 - \crosstabview v h c r - --- only null, no column name, 2 columns: error -SELECT null,null \crosstabview - --- only null, no column name, 3 columns: works -SELECT null,null,null \crosstabview - --- null display -SELECT v,h, string_agg(i::text, E'\n') AS i FROM ctv_data -GROUP BY v, h ORDER BY h,v - \crosstabview v h i - --- refer to columns by position -SELECT v,h,string_agg(i::text, E'\n'), string_agg(c, E'\n') -FROM ctv_data GROUP BY v, h ORDER BY h,v - \crosstabview 2 1 4 - --- refer to columns by positions and names mixed -SELECT v,h, string_agg(i::text, E'\n') AS i, string_agg(c, E'\n') AS c -FROM ctv_data GROUP BY v, h ORDER BY h,v - \crosstabview 1 "h" 4 - --- refer to columns by quoted names, check downcasing of unquoted name -SELECT 1 as "22", 2 as b, 3 as "Foo" - \crosstabview "22" B "Foo" - --- error: bad column name -SELECT v,h,c,i FROM ctv_data - \crosstabview v h j - --- error: need to quote name -SELECT 1 as "22", 2 as b, 3 as "Foo" - \crosstabview 1 2 Foo - --- error: need to not quote name -SELECT 1 as "22", 2 as b, 3 as "Foo" - \crosstabview 1 "B" "Foo" - --- error: bad column number -SELECT v,h,i,c FROM ctv_data - \crosstabview 2 1 5 - --- error: same H and V columns -SELECT v,h,i,c FROM ctv_data - \crosstabview 2 h 4 - --- error: too many columns -SELECT a,a,1 FROM generate_series(1,3000) AS a - \crosstabview - --- error: only one column -SELECT 1 \crosstabview - -DROP TABLE ctv_data; - --- check error reporting (bug #14476) -CREATE TABLE ctv_data (x int, y int, v text); - -INSERT INTO ctv_data SELECT 1, x, '*' || x FROM generate_series(1,10) x; -SELECT * FROM ctv_data \crosstabview - -INSERT INTO ctv_data VALUES (1, 10, '*'); -- duplicate data to cause error -SELECT * FROM ctv_data \crosstabview - -DROP TABLE ctv_data; diff --git a/crates/squawk_parser/tests/data/regression_suite/psql_pipeline.sql b/crates/squawk_parser/tests/data/regression_suite/psql_pipeline.sql deleted file mode 100644 index de651281..00000000 --- a/crates/squawk_parser/tests/data/regression_suite/psql_pipeline.sql +++ /dev/null @@ -1,295 +0,0 @@ --- --- Tests using psql pipelining --- - -CREATE TABLE psql_pipeline(a INTEGER PRIMARY KEY, s TEXT); - --- Single query -SELECT $1 \bind 'val1' \sendpipeline -SELECT 'val1'; - --- Multiple queries -SELECT $1 \bind 'val1' \sendpipeline -SELECT $1, $2 \bind 'val2' 'val3' \sendpipeline -SELECT $1, $2 \bind 'val2' 'val3' \sendpipeline -SELECT 'val4'; -SELECT 'val5', 'val6'; - --- Multiple queries in single line, separated by semicolons -SELECT 1; SELECT 2; SELECT 3 -; - --- Test \flush -SELECT $1 \bind 'val1' \sendpipeline -SELECT $1, $2 \bind 'val2' 'val3' \sendpipeline -SELECT $1, $2 \bind 'val2' 'val3' \sendpipeline -SELECT 'val4'; -SELECT 'val5', 'val6'; - --- Send multiple syncs -SELECT $1 \bind 'val1' \sendpipeline -SELECT $1, $2 \bind 'val2' 'val3' \sendpipeline -SELECT $1, $2 \bind 'val4' 'val5' \sendpipeline -SELECT 'val7'; -SELECT 'val8'; -SELECT 'val9'; - --- Query terminated with a semicolon replaces an unnamed prepared --- statement. -SELECT $1 \parse '' -SELECT 1; - --- Extended query is appended to pipeline by a semicolon after a --- newline. -SELECT $1 \bind 1 -; -SELECT 2; - --- \startpipeline should not have any effect if already in a pipeline. -SELECT $1 \bind 'val1' \sendpipeline - --- Convert an implicit transaction block to an explicit transaction block. -INSERT INTO psql_pipeline VALUES ($1) \bind 1 \sendpipeline -BEGIN \bind \sendpipeline -INSERT INTO psql_pipeline VALUES ($1) \bind 2 \sendpipeline -ROLLBACK \bind \sendpipeline - --- Multiple explicit transactions -BEGIN \bind \sendpipeline -INSERT INTO psql_pipeline VALUES ($1) \bind 1 \sendpipeline -ROLLBACK \bind \sendpipeline -BEGIN \bind \sendpipeline -INSERT INTO psql_pipeline VALUES ($1) \bind 1 \sendpipeline -COMMIT \bind \sendpipeline - --- COPY FROM STDIN --- with \sendpipeline and \bind -SELECT $1 \bind 'val1' \sendpipeline --- with semicolon -SELECT 'val1'; - --- COPY FROM STDIN with \flushrequest + \getresults --- with \sendpipeline and \bind -SELECT $1 \bind 'val1' \sendpipeline --- with semicolon -SELECT 'val1'; - --- COPY FROM STDIN with \syncpipeline + \getresults --- with \bind and \sendpipeline -SELECT $1 \bind 'val1' \sendpipeline --- with semicolon -SELECT 'val1'; - --- COPY TO STDOUT --- with \bind and \sendpipeline -SELECT $1 \bind 'val1' \sendpipeline -copy psql_pipeline TO STDOUT \bind \sendpipeline --- with semicolon -SELECT 'val1'; -copy psql_pipeline TO STDOUT; - --- COPY TO STDOUT with \flushrequest + \getresults --- with \bind and \sendpipeline -SELECT $1 \bind 'val1' \sendpipeline -copy psql_pipeline TO STDOUT \bind \sendpipeline --- with semicolon -SELECT 'val1'; -copy psql_pipeline TO STDOUT; - --- COPY TO STDOUT with \syncpipeline + \getresults --- with \bind and \sendpipeline -SELECT $1 \bind 'val1' \sendpipeline -copy psql_pipeline TO STDOUT \bind \sendpipeline --- with semicolon -SELECT 'val1'; -copy psql_pipeline TO STDOUT; - --- Use \parse and \bind_named -SELECT $1 \parse '' -SELECT $1, $2 \parse '' -SELECT $2 \parse pipeline_1 - --- \getresults displays all results preceding a \flushrequest. -SELECT $1 \bind 1 \sendpipeline -SELECT $1 \bind 2 \sendpipeline - --- \getresults displays all results preceding a \syncpipeline. -SELECT $1 \bind 1 \sendpipeline -SELECT $1 \bind 2 \sendpipeline - --- \getresults immediately returns if there is no result to fetch. -SELECT $1 \bind 2 \sendpipeline - --- \getresults only fetches results preceding a \flushrequest. -SELECT $1 \bind 2 \sendpipeline -SELECT $1 \bind 2 \sendpipeline - --- \getresults only fetches results preceding a \syncpipeline. -SELECT $1 \bind 2 \sendpipeline -SELECT $1 \bind 2 \sendpipeline - --- Use pipeline with chunked results for both \getresults and \endpipeline. -SELECT $1 \bind 2 \sendpipeline -SELECT $1 \bind 2 \sendpipeline - --- \getresults with specific number of requested results. -SELECT $1 \bind 1 \sendpipeline -SELECT $1 \bind 2 \sendpipeline -SELECT $1 \bind 3 \sendpipeline -SELECT $1 \bind 4 \sendpipeline - --- \syncpipeline count as one command to fetch for \getresults. -SELECT $1 \bind 1 \sendpipeline - --- \getresults 0 should get all the results. -SELECT $1 \bind 1 \sendpipeline -SELECT $1 \bind 2 \sendpipeline -SELECT $1 \bind 3 \sendpipeline - --- --- Pipeline errors --- - --- \endpipeline outside of pipeline should fail - --- After an aborted pipeline, commands after a \syncpipeline should be --- displayed. -SELECT $1 \bind \sendpipeline -SELECT $1 \bind 1 \sendpipeline - --- For an incorrect number of parameters, the pipeline is aborted and --- the following queries will not be executed. -SELECT \bind 'val1' \sendpipeline -SELECT $1 \bind 'val1' \sendpipeline - --- Using a semicolon with a parameter triggers an error and aborts --- the pipeline. -SELECT $1; -SELECT 1; - --- An explicit transaction with an error needs to be rollbacked after --- the pipeline. -BEGIN \bind \sendpipeline -INSERT INTO psql_pipeline VALUES ($1) \bind 1 \sendpipeline -ROLLBACK \bind \sendpipeline -ROLLBACK; - --- \watch is not allowed in a pipeline. -SELECT \bind \sendpipeline - --- \gdesc should fail as synchronous commands are not allowed in a pipeline, --- and the pipeline should still be usable. -SELECT $1 \bind 1 \gdesc -SELECT $1 \bind 1 \sendpipeline - --- ; is not allowed in a pipeline, pipeline should still be usable. -SELECT $1 as i, $2 as j \parse '' -SELECT $1 as k, $2 as l \parse 'second' - --- \g and \gx are not allowed, pipeline should still be usable. -SELECT $1 \bind 1 \g -SELECT $1 \bind 1 \g (format=unaligned tuples_only=on) -SELECT $1 \bind 1 \gx -SELECT $1 \bind 1 \gx (format=unaligned tuples_only=on) -SELECT $1 \bind 1 \sendpipeline - --- \g and \gx warnings should be emitted in an aborted pipeline, with --- pipeline still usable. -SELECT $1 \bind \sendpipeline -SELECT $1 \bind 1 \g -SELECT $1 \bind 1 \gx - --- \sendpipeline is not allowed outside of a pipeline -SELECT $1 \bind 1 \sendpipeline - --- \sendpipeline is not allowed if not preceded by \bind or \bind_named -SELECT 1 \sendpipeline - --- \gexec is not allowed, pipeline should still be usable. -SELECT 'INSERT INTO psql_pipeline(a) SELECT generate_series(1, 10)' \parse 'insert_stmt' -SELECT COUNT(*) FROM psql_pipeline \bind \sendpipeline - --- After an error, pipeline is aborted and requires \syncpipeline to be --- reusable. -SELECT $1 \bind \sendpipeline -SELECT $1 \bind 1 \sendpipeline -SELECT $1 \parse a --- Pipeline is aborted. -SELECT $1 \bind 1 \sendpipeline -SELECT $1 \parse a --- Sync allows pipeline to recover. -SELECT $1 \bind 1 \sendpipeline -SELECT $1 \parse a - --- In an aborted pipeline, \getresults 1 aborts commands one at a time. -SELECT $1 \bind \sendpipeline -SELECT $1 \bind 1 \sendpipeline -SELECT $1 \parse a - --- Test chunked results with an aborted pipeline. -SELECT $1 \bind \sendpipeline -SELECT $1 \bind \sendpipeline - --- \getresults returns an error when an incorrect number is provided. - --- \getresults when there is no result should not impact the next --- query executed. -select 1; - --- Error messages accumulate and are repeated. -SELECT 1 \bind \sendpipeline - --- --- Pipelines and transaction blocks --- - --- SET LOCAL will issue a warning when modifying a GUC outside of a --- transaction block. The change will still be valid as a pipeline --- runs within an implicit transaction block. Sending a sync will --- commit the implicit transaction block. The first command after a --- sync will not be seen as belonging to a pipeline. -SET LOCAL statement_timeout='1h' \bind \sendpipeline -SHOW statement_timeout \bind \sendpipeline -SHOW statement_timeout \bind \sendpipeline -SET LOCAL statement_timeout='2h' \bind \sendpipeline -SHOW statement_timeout \bind \sendpipeline - --- REINDEX CONCURRENTLY fails if not the first command in a pipeline. -SELECT $1 \bind 1 \sendpipeline -REINDEX TABLE CONCURRENTLY psql_pipeline \bind \sendpipeline -SELECT $1 \bind 2 \sendpipeline - --- REINDEX CONCURRENTLY works if it is the first command in a pipeline. -REINDEX TABLE CONCURRENTLY psql_pipeline \bind \sendpipeline -SELECT $1 \bind 2 \sendpipeline - --- Subtransactions are not allowed in a pipeline. -SAVEPOINT a \bind \sendpipeline -SELECT $1 \bind 1 \sendpipeline -ROLLBACK TO SAVEPOINT a \bind \sendpipeline -SELECT $1 \bind 2 \sendpipeline - --- LOCK fails as the first command in a pipeline, as not seen in an --- implicit transaction block. -LOCK psql_pipeline \bind \sendpipeline -SELECT $1 \bind 2 \sendpipeline - --- LOCK succeeds as it is not the first command in a pipeline, --- seen in an implicit transaction block. -SELECT $1 \bind 1 \sendpipeline -LOCK psql_pipeline \bind \sendpipeline -SELECT $1 \bind 2 \sendpipeline - --- VACUUM works as the first command in a pipeline. -VACUUM psql_pipeline \bind \sendpipeline - --- VACUUM fails when not the first command in a pipeline. -SELECT 1 \bind \sendpipeline -VACUUM psql_pipeline \bind \sendpipeline - --- VACUUM works after a \syncpipeline. -SELECT 1 \bind \sendpipeline -VACUUM psql_pipeline \bind \sendpipeline - --- Clean up -DROP TABLE psql_pipeline; diff --git a/crates/squawk_parser/tests/snapshots/tests__create_function_ok.snap b/crates/squawk_parser/tests/snapshots/tests__create_function_ok.snap index 06c19cca..694e355e 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_function_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_function_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/create_function.sql -snapshot_kind: text --- SOURCE_FILE COMMENT "-- create_func_with_in_out" @@ -3035,4 +3034,58 @@ SOURCE_FILE WHITESPACE " " SQL_KW "sql" SEMICOLON ";" - WHITESPACE "\n\n\n\n" + WHITESPACE "\n\n" + COMMENT "-- array type" + WHITESPACE "\n" + CREATE_FUNCTION + CREATE_KW "create" + WHITESPACE " " + FUNCTION_KW "function" + WHITESPACE " " + PATH + PATH_SEGMENT + NAME + IDENT "f" + WHITESPACE " " + PARAM_LIST + L_PAREN "(" + PARAM + PATH_TYPE + IDENT "internal" + COMMA "," + WHITESPACE " " + PARAM + ARRAY_TYPE + PATH_TYPE + TEXT_KW "text" + L_BRACK "[" + R_BRACK "]" + COMMA "," + WHITESPACE " " + PARAM + PATH_TYPE + IDENT "bool" + R_PAREN ")" + WHITESPACE " \n" + RET_TYPE + RETURNS_KW "returns" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "void" + WHITESPACE "\n" + FUNC_OPTION_LIST + AS_FUNC_OPTION + AS_KW "as" + WHITESPACE " " + LITERAL + STRING "''" + WHITESPACE " " + LANGUAGE_FUNC_OPTION + LANGUAGE_KW "language" + WHITESPACE " " + SQL_KW "sql" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/squawk_parser/tests/snapshots/tests__create_table_err.snap b/crates/squawk_parser/tests/snapshots/tests__create_table_err.snap index ce9a9e0a..db4ae5e5 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_table_err.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_table_err.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/err/create_table.sql -snapshot_kind: text --- SOURCE_FILE CREATE_TABLE diff --git a/crates/squawk_parser/tests/snapshots/tests__create_table_ok.snap b/crates/squawk_parser/tests/snapshots/tests__create_table_ok.snap index c978c294..edd5beaf 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_table_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_table_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/create_table.sql -snapshot_kind: text --- SOURCE_FILE CREATE_TABLE @@ -3003,6 +3002,73 @@ SOURCE_FILE R_PAREN ")" SEMICOLON ";" WHITESPACE "\n\n" + CREATE_TABLE + CREATE_KW "create" + WHITESPACE " " + TABLE_KW "table" + WHITESPACE " " + PATH + PATH_SEGMENT + NAME + IDENT "t" + WHITESPACE " " + PARTITION_KW "partition" + WHITESPACE " " + OF_KW "of" + WHITESPACE " " + PATH + PATH_SEGMENT + NAME_REF + IDENT "u" + WHITESPACE " " + TABLE_ARGS + L_PAREN "(" + WHITESPACE "\n " + COLUMN + NAME_REF + IDENT "c" + WHITESPACE " " + GENERATED_CONSTRAINT + GENERATED_KW "generated" + WHITESPACE " " + ALWAYS_KW "always" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + L_PAREN "(" + BIN_EXPR + NAME_REF + IDENT "b" + WHITESPACE " " + STAR "*" + WHITESPACE " " + LITERAL + INT_NUMBER "2" + R_PAREN ")" + WHITESPACE " " + STORED_KW "stored" + WHITESPACE "\n" + R_PAREN ")" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + VALUES_KW "values" + WHITESPACE " " + FROM_KW "from" + WHITESPACE " " + L_PAREN "(" + LITERAL + STRING "'2016-09-01'" + R_PAREN ")" + WHITESPACE " " + TO_KW "to" + WHITESPACE " " + L_PAREN "(" + LITERAL + STRING "'2016-10-01'" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n\n" CREATE_TABLE COMMENT "-- missing entries" WHITESPACE "\n" diff --git a/crates/squawk_parser/tests/snapshots/tests__create_table_pg17_ok.snap b/crates/squawk_parser/tests/snapshots/tests__create_table_pg17_ok.snap index 60052d80..b63ee692 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_table_pg17_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_table_pg17_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/create_table_pg17.sql -snapshot_kind: text --- SOURCE_FILE CREATE_TABLE diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_alter_generic.snap b/crates/squawk_parser/tests/snapshots/tests__regression_alter_generic.snap deleted file mode 100644 index 40d5a19e..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_alter_generic.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/alter_generic.sql ---- -ERROR@15151: expected R_PAREN -ERROR@15152: expected OPERATOR, or FUNCTION -ERROR@15152: expected SEMICOLON -ERROR@15153: expected command, found IDENT -ERROR@15157: expected command, found R_PAREN -ERROR@21020: expected type name -ERROR@21020: expected R_PAREN -ERROR@21020: expected SEMICOLON -ERROR@21020: expected command, found L_BRACK -ERROR@21021: expected command, found R_BRACK -ERROR@21022: expected command, found COMMA -ERROR@21024: expected command, found IDENT -ERROR@21028: expected command, found R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_arrays.snap b/crates/squawk_parser/tests/snapshots/tests__regression_arrays.snap deleted file mode 100644 index 9d6d5bb4..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_arrays.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/arrays.sql ---- -ERROR@10382: expected SEMICOLON -ERROR@10383: expected command, found LANGUAGE_KW -ERROR@10392: expected command, found IDENT -ERROR@16637: missing comma -ERROR@16686: missing comma diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_btree_index.snap b/crates/squawk_parser/tests/snapshots/tests__regression_btree_index.snap index 71724712..7d43bc1c 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_btree_index.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_btree_index.snap @@ -2,42 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/btree_index.sql --- -ERROR@7067: expected SEMICOLON -ERROR@7068: expected command, found ILIKE_KW -ERROR@7074: expected command, found STRING -ERROR@7083: expected command, found ORDER_KW -ERROR@7089: expected command, found BY_KW -ERROR@7092: expected command, found INT_NUMBER -ERROR@7136: expected SEMICOLON -ERROR@7137: expected command, found ILIKE_KW -ERROR@7143: expected command, found STRING -ERROR@7152: expected command, found ORDER_KW -ERROR@7158: expected command, found BY_KW -ERROR@7161: expected command, found INT_NUMBER -ERROR@7225: expected SEMICOLON -ERROR@7226: expected command, found ILIKE_KW -ERROR@7232: expected command, found STRING -ERROR@7241: expected command, found ORDER_KW -ERROR@7247: expected command, found BY_KW -ERROR@7250: expected command, found INT_NUMBER -ERROR@7549: expected SEMICOLON -ERROR@7550: expected command, found ILIKE_KW -ERROR@7556: expected command, found STRING -ERROR@7565: expected command, found ORDER_KW -ERROR@7571: expected command, found BY_KW -ERROR@7574: expected command, found INT_NUMBER -ERROR@7618: expected SEMICOLON -ERROR@7619: expected command, found ILIKE_KW -ERROR@7625: expected command, found STRING -ERROR@7634: expected command, found ORDER_KW -ERROR@7640: expected command, found BY_KW -ERROR@7643: expected command, found INT_NUMBER -ERROR@7707: expected SEMICOLON -ERROR@7708: expected command, found ILIKE_KW -ERROR@7714: expected command, found STRING -ERROR@7723: expected command, found ORDER_KW -ERROR@7729: expected command, found BY_KW -ERROR@7732: expected command, found INT_NUMBER ERROR@13001: expected numeric literal ERROR@13001: expected SET_KW ERROR@13001: expected STATISTICS_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_cluster.snap b/crates/squawk_parser/tests/snapshots/tests__regression_cluster.snap deleted file mode 100644 index 71970c7c..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_cluster.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/cluster.sql ---- -ERROR@11517: expected FROM_KW -ERROR@11517: expected L_PAREN -ERROR@11518: expected an expression, found WHERE_KW -ERROR@11523: expected call expression -ERROR@11526: expected R_PAREN -ERROR@11526: expected SEMICOLON -ERROR@11527: expected command, found L_ANGLE -ERROR@11529: expected command, found IDENT -ERROR@12078: expected FROM_KW -ERROR@12078: expected L_PAREN -ERROR@12079: expected an expression, found WHERE_KW -ERROR@12084: expected call expression -ERROR@12094: expected R_PAREN -ERROR@12094: expected SEMICOLON -ERROR@12095: expected command, found R_ANGLE -ERROR@12097: expected command, found IDENT -ERROR@12102: expected command, found L_PAREN -ERROR@12103: expected command, found IDENT -ERROR@12104: expected command, found R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap b/crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap index 366afad4..9188d12b 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap @@ -2,34 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/collate.icu.utf8.sql --- -ERROR@3535: expected SEMICOLON -ERROR@3536: expected command, found ILIKE_KW -ERROR@3542: expected command, found STRING -ERROR@3584: expected SEMICOLON -ERROR@3585: expected command, found ILIKE_KW -ERROR@3591: expected command, found STRING -ERROR@3634: expected SEMICOLON -ERROR@3635: expected command, found ILIKE_KW -ERROR@3641: expected command, found STRING -ERROR@3694: missing comma -ERROR@3757: missing comma -ERROR@3799: missing comma -ERROR@3858: missing comma -ERROR@4012: expected SEMICOLON -ERROR@4013: expected command, found ILIKE_KW -ERROR@4019: expected command, found STRING -ERROR@12097: expected SEMICOLON -ERROR@12098: expected command, found ILIKE_KW -ERROR@12104: expected command, found STRING -ERROR@12146: expected SEMICOLON -ERROR@12147: expected command, found ILIKE_KW -ERROR@12153: expected command, found STRING -ERROR@12215: expected SEMICOLON -ERROR@12216: expected command, found ILIKE_KW -ERROR@12222: expected command, found STRING -ERROR@12264: expected SEMICOLON -ERROR@12265: expected command, found ILIKE_KW -ERROR@12271: expected command, found STRING ERROR@14369: expected SEMICOLON ERROR@14369: expected command, found COMMA ERROR@14371: expected command, found IDENT @@ -45,13 +17,4 @@ ERROR@14752: expected MATERIALIZED_KW ERROR@14752: expected VIEW_KW ERROR@14762: expected SEMICOLON ERROR@14763: expected command, found VERSION_KW -ERROR@21137: expected SEMICOLON -ERROR@21138: expected command, found ILIKE_KW -ERROR@21144: expected command, found STRING -ERROR@22661: expected SEMICOLON -ERROR@22662: expected command, found ILIKE_KW -ERROR@22668: expected command, found STRING -ERROR@24211: expected SEMICOLON -ERROR@24212: expected command, found ILIKE_KW -ERROR@24218: expected command, found STRING ERROR@42437: expected STORED or VIRTUAL diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap b/crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap index 12844042..9a02e9b7 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap @@ -2,22 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/collate.linux.utf8.sql --- -ERROR@3274: expected SEMICOLON -ERROR@3275: expected command, found ILIKE_KW -ERROR@3281: expected command, found STRING -ERROR@3323: expected SEMICOLON -ERROR@3324: expected command, found ILIKE_KW -ERROR@3330: expected command, found STRING -ERROR@3373: expected SEMICOLON -ERROR@3374: expected command, found ILIKE_KW -ERROR@3380: expected command, found STRING -ERROR@3430: missing comma -ERROR@3490: missing comma -ERROR@3532: missing comma -ERROR@3588: missing comma -ERROR@3739: expected SEMICOLON -ERROR@3740: expected command, found ILIKE_KW -ERROR@3746: expected command, found STRING ERROR@13571: expected SEMICOLON ERROR@13571: expected command, found COMMA ERROR@13573: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_create_aggregate.snap b/crates/squawk_parser/tests/snapshots/tests__regression_create_aggregate.snap deleted file mode 100644 index 583e90a6..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_create_aggregate.snap +++ /dev/null @@ -1,49 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/create_aggregate.sql ---- -ERROR@1544: expected type name -ERROR@1544: expected R_PAREN -ERROR@1544: expected function option -ERROR@1544: expected SEMICOLON -ERROR@1544: expected command, found L_BRACK -ERROR@1545: expected command, found R_BRACK -ERROR@1546: expected command, found COMMA -ERROR@1547: expected command, found INTEGER_KW -ERROR@1554: expected command, found COMMA -ERROR@1555: expected command, found INTEGER_KW -ERROR@1562: expected command, found COMMA -ERROR@1563: expected command, found TEXT_KW -ERROR@1567: expected command, found R_PAREN -ERROR@1569: expected command, found RETURNS_KW -ERROR@1577: expected command, found IDENT -ERROR@1584: expected command, found L_BRACK -ERROR@1585: expected command, found R_BRACK -ERROR@1587: expected command, found AS_KW -ERROR@1590: expected command, found STRING -ERROR@1639: expected command, found LANGUAGE_KW -ERROR@1648: expected command, found SQL_KW -ERROR@1652: expected command, found STRICT_KW -ERROR@1659: expected command, found IMMUTABLE_KW -ERROR@1707: expected type name -ERROR@1707: expected R_PAREN -ERROR@1707: expected function option -ERROR@1707: expected SEMICOLON -ERROR@1707: expected command, found L_BRACK -ERROR@1708: expected command, found R_BRACK -ERROR@1709: expected command, found COMMA -ERROR@1710: expected command, found INTEGER_KW -ERROR@1717: expected command, found COMMA -ERROR@1718: expected command, found INTEGER_KW -ERROR@1725: expected command, found COMMA -ERROR@1726: expected command, found TEXT_KW -ERROR@1730: expected command, found R_PAREN -ERROR@1732: expected command, found RETURNS_KW -ERROR@1740: expected command, found IDENT -ERROR@1747: expected command, found L_BRACK -ERROR@1748: expected command, found R_BRACK -ERROR@1750: expected command, found AS_KW -ERROR@1753: expected command, found STRING -ERROR@1802: expected command, found LANGUAGE_KW -ERROR@1811: expected command, found SQL_KW -ERROR@1815: expected command, found IMMUTABLE_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_create_function_sql.snap b/crates/squawk_parser/tests/snapshots/tests__regression_create_function_sql.snap deleted file mode 100644 index c1d08ef3..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_create_function_sql.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/create_function_sql.sql ---- -ERROR@572: expected type name -ERROR@572: expected R_PAREN -ERROR@572: expected function option -ERROR@572: expected SEMICOLON -ERROR@572: expected command, found L_BRACK -ERROR@573: expected command, found R_BRACK -ERROR@574: expected command, found R_PAREN -ERROR@576: expected command, found RETURNS_KW -ERROR@584: expected command, found INT_KW -ERROR@588: expected command, found LANGUAGE_KW -ERROR@597: expected command, found STRING -ERROR@610: expected command, found AS_KW -ERROR@613: expected command, found STRING -ERROR@6095: expected command, found RETURN_KW -ERROR@6102: expected command, found FALSE_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_generated_stored.snap b/crates/squawk_parser/tests/snapshots/tests__regression_generated_stored.snap deleted file mode 100644 index 58aab9b7..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_generated_stored.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/generated_stored.sql ---- -ERROR@2752: expected IDENTITY_KW -ERROR@2754: expected R_PAREN -ERROR@2754: expected R_PAREN -ERROR@2754: expected SEMICOLON -ERROR@2754: expected command, found IDENT -ERROR@2756: expected command, found STAR -ERROR@2758: expected command, found INT_NUMBER -ERROR@2759: expected command, found R_PAREN -ERROR@2761: expected command, found STORED_KW -ERROR@2767: expected command, found R_PAREN -ERROR@10576: expected TO_KW -ERROR@10576: expected role, got COMMA -ERROR@10584: expected SEMICOLON -ERROR@10585: expected command, found ON_KW -ERROR@10588: expected command, found IDENT -ERROR@10596: expected command, found TO_KW -ERROR@10599: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap b/crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap index 03f60c98..d304a621 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap @@ -2,23 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/generated_virtual.sql --- -ERROR@2774: expected IDENTITY_KW -ERROR@2776: expected R_PAREN -ERROR@2776: expected R_PAREN -ERROR@2776: expected SEMICOLON -ERROR@2776: expected command, found IDENT -ERROR@2778: expected command, found STAR -ERROR@2780: expected command, found INT_NUMBER -ERROR@2781: expected command, found R_PAREN -ERROR@2783: expected command, found VIRTUAL_KW -ERROR@2790: expected command, found R_PAREN -ERROR@10612: expected TO_KW -ERROR@10612: expected role, got COMMA -ERROR@10620: expected SEMICOLON -ERROR@10621: expected command, found ON_KW -ERROR@10624: expected command, found IDENT -ERROR@10632: expected command, found TO_KW -ERROR@10635: expected command, found IDENT ERROR@12952: expected FOREIGN_KW ERROR@12952: expected KEY_KW ERROR@12952: expected column list diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_interval.snap b/crates/squawk_parser/tests/snapshots/tests__regression_interval.snap deleted file mode 100644 index 33d58f5b..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_interval.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/interval.sql ---- -ERROR@9258: missing comma -ERROR@9300: missing comma diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_json.snap b/crates/squawk_parser/tests/snapshots/tests__regression_json.snap deleted file mode 100644 index e33c76d7..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_json.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/json.sql ---- -ERROR@4674: expected FROM_KW -ERROR@4674: expected L_PAREN -ERROR@4676: expected call expression -ERROR@4676: expected R_PAREN -ERROR@5791: expected FROM_KW -ERROR@5791: expected L_PAREN -ERROR@5793: expected call expression -ERROR@5793: expected R_PAREN -ERROR@5891: expected FROM_KW -ERROR@5891: expected L_PAREN -ERROR@5893: expected call expression -ERROR@5893: expected R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_jsonb.snap b/crates/squawk_parser/tests/snapshots/tests__regression_jsonb.snap deleted file mode 100644 index 7a3ce5d6..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_jsonb.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/jsonb.sql ---- -ERROR@4490: expected FROM_KW -ERROR@4490: expected L_PAREN -ERROR@4492: expected call expression -ERROR@4492: expected R_PAREN -ERROR@4591: expected FROM_KW -ERROR@4591: expected L_PAREN -ERROR@4593: expected call expression -ERROR@4593: expected R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_matview.snap b/crates/squawk_parser/tests/snapshots/tests__regression_matview.snap index 3e385668..4069d73e 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_matview.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_matview.snap @@ -2,7 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/matview.sql --- -ERROR@4488: expected SELECT, TABLE, or VALUES statement, got COMPOUND_SELECT ERROR@4758: expected type name ERROR@4761: expected type name ERROR@5137: expected type name diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_numeric.snap b/crates/squawk_parser/tests/snapshots/tests__regression_numeric.snap deleted file mode 100644 index 814887f4..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_numeric.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/numeric.sql ---- -ERROR@47483: expected FROM_KW -ERROR@47483: expected L_PAREN -ERROR@47483: expected an expression, found SEMICOLON -ERROR@47483: expected call expression -ERROR@47483: expected R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap b/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap index c015dbf8..f1f0ee51 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap @@ -40,21 +40,6 @@ ERROR@17985: expected command, found WHERE_KW ERROR@17991: expected command, found IDENT ERROR@17993: expected command, found L_ANGLE ERROR@17995: expected command, found INT_NUMBER -ERROR@18707: expected TO_KW -ERROR@18707: expected role, got COMMA -ERROR@18715: expected SEMICOLON -ERROR@18716: expected command, found L_PAREN -ERROR@18717: expected command, found IDENT -ERROR@18720: expected command, found R_PAREN -ERROR@18721: expected command, found COMMA -ERROR@18730: expected path name -ERROR@18730: expected SET_KW -ERROR@18737: expected EQ -ERROR@18737: expected SEMICOLON -ERROR@18738: expected command, found ON_KW -ERROR@18741: expected command, found IDENT -ERROR@18748: expected command, found TO_KW -ERROR@18751: expected command, found IDENT ERROR@37160: expected SELECT, TABLE, VALUES, or EXECUTE ERROR@37160: expected SEMICOLON ERROR@38499: expected SELECT, TABLE, VALUES, or EXECUTE diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_psql.snap b/crates/squawk_parser/tests/snapshots/tests__regression_psql.snap deleted file mode 100644 index 68a14d3e..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_psql.snap +++ /dev/null @@ -1,747 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/psql.sql ---- -ERROR@262: expected SEMICOLON -ERROR@263: expected command, found ERROR -ERROR@264: expected command, found IDENT -ERROR@294: expected SEMICOLON -ERROR@295: expected command, found ERROR -ERROR@296: expected command, found IDENT -ERROR@369: expected SEMICOLON -ERROR@370: expected command, found ERROR -ERROR@371: expected command, found IDENT -ERROR@401: expected SEMICOLON -ERROR@402: expected command, found ERROR -ERROR@403: expected command, found IDENT -ERROR@462: expected SEMICOLON -ERROR@463: expected command, found ERROR -ERROR@464: expected command, found IDENT -ERROR@466: expected command, found L_PAREN -ERROR@467: expected command, found FORMAT_KW -ERROR@473: expected command, found EQ -ERROR@474: expected command, found CSV_KW -ERROR@478: expected command, found IDENT -ERROR@490: expected command, found EQ -ERROR@491: expected command, found STRING -ERROR@495: expected command, found R_PAREN -ERROR@522: expected SEMICOLON -ERROR@523: expected command, found ERROR -ERROR@524: expected command, found IDENT -ERROR@527: expected command, found L_PAREN -ERROR@528: expected command, found IDENT -ERROR@533: expected command, found EQ -ERROR@534: expected command, found STRING -ERROR@543: expected command, found R_PAREN -ERROR@590: expected SEMICOLON -ERROR@591: expected command, found ERROR -ERROR@592: expected command, found IDENT -ERROR@598: expected command, found STRING -ERROR@609: expected SEMICOLON -ERROR@610: expected command, found ERROR -ERROR@611: expected command, found IDENT -ERROR@617: expected command, found IDENT -ERROR@632: expected SEMICOLON -ERROR@633: expected command, found ERROR -ERROR@634: expected command, found IDENT -ERROR@640: expected command, found IDENT -ERROR@659: expected SEMICOLON -ERROR@660: expected command, found ERROR -ERROR@661: expected command, found IDENT -ERROR@667: expected command, found IDENT -ERROR@1046: expected SEMICOLON -ERROR@1047: expected command, found ERROR -ERROR@1048: expected command, found IDENT -ERROR@1053: expected command, found ERROR -ERROR@1054: expected command, found IDENT -ERROR@1065: expected SEMICOLON -ERROR@1066: expected command, found ERROR -ERROR@1067: expected command, found IDENT -ERROR@1072: expected command, found STRING -ERROR@1078: expected command, found ERROR -ERROR@1079: expected command, found IDENT -ERROR@1094: expected SEMICOLON -ERROR@1095: expected command, found ERROR -ERROR@1096: expected command, found IDENT -ERROR@1101: expected command, found STRING -ERROR@1107: expected command, found STRING -ERROR@1113: expected command, found ERROR -ERROR@1114: expected command, found IDENT -ERROR@1157: expected SEMICOLON -ERROR@1158: expected command, found ERROR -ERROR@1159: expected command, found IDENT -ERROR@1164: expected command, found STRING -ERROR@1170: expected command, found ERROR -ERROR@1171: expected command, found IDENT -ERROR@1176: expected command, found INT_NUMBER -ERROR@1178: expected command, found ERROR -ERROR@1179: expected command, found IDENT -ERROR@1248: expected SEMICOLON -ERROR@1249: expected command, found ERROR -ERROR@1250: expected command, found IDENT -ERROR@1255: expected command, found INT_NUMBER -ERROR@1257: expected command, found ERROR -ERROR@1258: expected command, found IDENT -ERROR@1260: expected command, found ERROR -ERROR@1261: expected command, found IDENT -ERROR@1266: expected command, found INT_NUMBER -ERROR@1268: expected command, found ERROR -ERROR@1269: expected command, found IDENT -ERROR@1307: expected SEMICOLON -ERROR@1308: expected command, found ERROR -ERROR@1309: expected command, found IDENT -ERROR@1314: expected command, found ERROR -ERROR@1315: expected command, found IDENT -ERROR@1339: expected SEMICOLON -ERROR@1340: expected command, found ERROR -ERROR@1351: expected SEMICOLON -ERROR@1352: expected command, found ERROR -ERROR@1353: expected command, found IDENT -ERROR@1358: expected command, found ERROR -ERROR@1359: expected command, found IDENT -ERROR@1388: expected SEMICOLON -ERROR@1389: expected command, found ERROR -ERROR@1390: expected command, found IDENT -ERROR@1395: expected command, found STRING -ERROR@1401: expected command, found ERROR -ERROR@1402: expected command, found IDENT -ERROR@1486: expected command, found IDENT -ERROR@1553: expected SEMICOLON -ERROR@1590: expected command, found IDENT -ERROR@1665: expected command, found IDENT -ERROR@1673: expected command, found ERROR -ERROR@1674: expected command, found ERROR -ERROR@1676: expected command, found ERROR -ERROR@1677: expected command, found IDENT -ERROR@1682: expected command, found STRING -ERROR@1717: expected command, found IDENT -ERROR@1725: expected command, found ERROR -ERROR@1726: expected command, found IDENT -ERROR@1731: expected command, found STRING -ERROR@1742: expected command, found ERROR -ERROR@1743: expected command, found IDENT -ERROR@1748: expected command, found STRING -ERROR@1783: expected command, found IDENT -ERROR@1791: expected command, found ERROR -ERROR@1792: expected command, found ERROR -ERROR@1794: expected command, found ERROR -ERROR@1795: expected command, found IDENT -ERROR@1797: expected command, found ERROR -ERROR@1798: expected command, found IDENT -ERROR@1803: expected command, found STRING -ERROR@1814: expected command, found STRING -ERROR@1846: expected SEMICOLON -ERROR@1847: expected command, found ERROR -ERROR@1848: expected command, found IDENT -ERROR@1852: expected command, found IDENT -ERROR@1860: expected command, found ERROR -ERROR@1861: expected command, found IDENT -ERROR@1866: expected command, found STRING -ERROR@1877: expected command, found STRING -ERROR@2269: expected command, found IDENT -ERROR@2277: expected command, found ERROR -ERROR@2278: expected command, found ERROR -ERROR@2280: expected command, found ERROR -ERROR@2281: expected command, found IDENT -ERROR@2286: expected command, found STRING -ERROR@2321: expected command, found IDENT -ERROR@2329: expected command, found ERROR -ERROR@2330: expected command, found IDENT -ERROR@2335: expected command, found STRING -ERROR@2346: expected command, found ERROR -ERROR@2347: expected command, found IDENT -ERROR@2352: expected command, found STRING -ERROR@2667: missing comma -ERROR@2744: expected SEMICOLON -ERROR@2745: expected command, found AS_KW -ERROR@2792: expected SEMICOLON -ERROR@2793: expected command, found ERROR -ERROR@2794: expected command, found IDENT -ERROR@2820: expected SEMICOLON -ERROR@2821: expected command, found ERROR -ERROR@2822: expected command, found IDENT -ERROR@2878: expected an expression, found ERROR -ERROR@2884: expected SEMICOLON -ERROR@2929: expected SEMICOLON -ERROR@2930: expected command, found ERROR -ERROR@2931: expected command, found IDENT -ERROR@2963: expected SEMICOLON -ERROR@2964: expected command, found ERROR -ERROR@2965: expected command, found IDENT -ERROR@3132: expected SEMICOLON -ERROR@3205: expected SEMICOLON -ERROR@3206: expected command, found ERROR -ERROR@3207: expected command, found IDENT -ERROR@3213: expected command, found ERROR -ERROR@3214: expected command, found IDENT -ERROR@3325: expected command, found IDENT -ERROR@3568: expected SEMICOLON -ERROR@4179: missing comma -ERROR@4191: missing comma -ERROR@6049: expected NONE or role_name -ERROR@6049: expected SEMICOLON -ERROR@6050: expected command, found TO_KW -ERROR@6053: expected command, found IDENT -ERROR@7161: missing comma -ERROR@8889: expected command, found NOT_KW -ERROR@8893: expected command, found IDENT -ERROR@8901: expected command, found IDENT -ERROR@8907: expected command, found NOT_KW -ERROR@8911: expected command, found IDENT -ERROR@9031: expected SEMICOLON -ERROR@9034: expected command, found ERROR -ERROR@9035: expected command, found IF_KW -ERROR@9038: expected command, found TRUE_KW -ERROR@9047: expected command, found INT_NUMBER -ERROR@9052: expected command, found ERROR -ERROR@9053: expected command, found ELSE_KW -ERROR@9062: expected command, found L_PAREN -ERROR@9063: expected command, found IDENT -ERROR@9071: expected command, found ERROR -ERROR@9072: expected command, found IDENT -ERROR@9080: expected command, found IDENT -ERROR@9098: expected SEMICOLON -ERROR@9099: expected command, found ERROR -ERROR@9100: expected command, found IF_KW -ERROR@9103: expected command, found FALSE_KW -ERROR@9109: expected command, found ERROR -ERROR@9110: expected command, found ERROR -ERROR@9112: expected command, found L_PAREN -ERROR@9113: expected command, found IDENT -ERROR@9119: expected command, found ERROR -ERROR@9120: expected command, found ELSE_KW -ERROR@9125: expected command, found ERROR -ERROR@9126: expected command, found ERROR -ERROR@9128: expected command, found INT_NUMBER -ERROR@9131: expected command, found ERROR -ERROR@9132: expected command, found IDENT -ERROR@9138: expected command, found ERROR -ERROR@9139: expected command, found ERROR -ERROR@9141: expected command, found IDENT -ERROR@9216: expected command, found ERROR -ERROR@9217: expected command, found IF_KW -ERROR@9220: expected command, found INT_NUMBER -ERROR@9224: expected command, found ERROR -ERROR@9225: expected command, found IF_KW -ERROR@9228: expected command, found YES_KW -ERROR@9235: expected command, found ERROR -ERROR@9236: expected command, found IF_KW -ERROR@9239: expected command, found ON_KW -ERROR@9246: expected command, found ERROR -ERROR@9247: expected command, found IDENT -ERROR@9252: expected command, found STRING -ERROR@9266: expected command, found ERROR -ERROR@9267: expected command, found ELSE_KW -ERROR@9276: expected command, found ERROR -ERROR@9277: expected command, found IDENT -ERROR@9282: expected command, found STRING -ERROR@9309: expected command, found ERROR -ERROR@9310: expected command, found IDENT -ERROR@9318: expected command, found ERROR -ERROR@9319: expected command, found ELSE_KW -ERROR@9327: expected command, found ERROR -ERROR@9328: expected command, found IDENT -ERROR@9333: expected command, found STRING -ERROR@9359: expected command, found ERROR -ERROR@9360: expected command, found IDENT -ERROR@9367: expected command, found ERROR -ERROR@9368: expected command, found ELSE_KW -ERROR@9375: expected command, found ERROR -ERROR@9376: expected command, found IDENT -ERROR@9381: expected command, found STRING -ERROR@9406: expected command, found ERROR -ERROR@9407: expected command, found IDENT -ERROR@9414: expected command, found ERROR -ERROR@9415: expected command, found IDENT -ERROR@9420: expected command, found STRING -ERROR@9514: expected command, found ERROR -ERROR@9515: expected command, found IDENT -ERROR@9520: expected command, found STRING -ERROR@9545: expected command, found ERROR -ERROR@9546: expected command, found IDENT -ERROR@9551: expected command, found STRING -ERROR@9576: expected command, found ERROR -ERROR@9577: expected command, found IDENT -ERROR@9582: expected command, found STRING -ERROR@9607: expected command, found ERROR -ERROR@9608: expected command, found IDENT -ERROR@9613: expected command, found STRING -ERROR@9638: expected command, found ERROR -ERROR@9639: expected command, found IDENT -ERROR@9644: expected command, found STRING -ERROR@9708: expected command, found ERROR -ERROR@9709: expected command, found IDENT -ERROR@9714: expected command, found STRING -ERROR@9735: expected command, found ERROR -ERROR@9736: expected command, found IDENT -ERROR@9741: expected command, found STRING -ERROR@9766: expected command, found ERROR -ERROR@9767: expected command, found IDENT -ERROR@9772: expected command, found STRING -ERROR@9797: expected command, found ERROR -ERROR@9798: expected command, found IDENT -ERROR@9803: expected command, found STRING -ERROR@9859: expected command, found ERROR -ERROR@9860: expected command, found IDENT -ERROR@9865: expected command, found STRING -ERROR@9885: expected command, found ERROR -ERROR@9886: expected command, found IDENT -ERROR@9891: expected command, found STRING -ERROR@9948: expected command, found ERROR -ERROR@9949: expected command, found IDENT -ERROR@9954: expected command, found STRING -ERROR@9979: expected command, found ERROR -ERROR@9980: expected command, found IDENT -ERROR@9985: expected command, found STRING -ERROR@10006: expected command, found ERROR -ERROR@10007: expected command, found IDENT -ERROR@10012: expected command, found STRING -ERROR@10079: expected command, found ERROR -ERROR@10080: expected command, found IDENT -ERROR@10085: expected command, found STRING -ERROR@10108: expected command, found ERROR -ERROR@10109: expected command, found IDENT -ERROR@10114: expected command, found STRING -ERROR@10318: expected command, found ERROR -ERROR@10319: expected command, found IF_KW -ERROR@10322: expected command, found FALSE_KW -ERROR@10336: expected command, found ERROR -ERROR@10337: expected command, found IDENT -ERROR@10342: expected command, found STRING -ERROR@10370: expected command, found ERROR -ERROR@10371: expected command, found ELSE_KW -ERROR@10384: expected command, found ERROR -ERROR@10385: expected command, found IDENT -ERROR@10390: expected command, found STRING -ERROR@10418: expected command, found ERROR -ERROR@10419: expected command, found IDENT -ERROR@10429: expected command, found ERROR -ERROR@10430: expected command, found IDENT -ERROR@10435: expected command, found STRING -ERROR@10463: expected command, found ERROR -ERROR@10464: expected command, found IDENT -ERROR@10469: expected command, found STRING -ERROR@10669: expected command, found STRING -ERROR@10684: expected command, found ERROR -ERROR@10685: expected command, found IDENT -ERROR@10690: expected command, found BACKTICK -ERROR@10691: expected command, found IDENT -ERROR@10704: expected command, found BACKTICK -ERROR@10706: expected command, found STRING -ERROR@10712: expected command, found STRING -ERROR@10718: expected command, found COLON -ERROR@10719: expected command, found IDENT -ERROR@10726: expected command, found ERROR -ERROR@10727: expected command, found IDENT -ERROR@10732: expected command, found IDENT -ERROR@10741: expected command, found PIPE -ERROR@10743: expected command, found BACKTICK -ERROR@10744: expected command, found IDENT -ERROR@10757: expected command, found BACKTICK -ERROR@10759: expected command, found STRING -ERROR@10765: expected command, found STRING -ERROR@10771: expected command, found COLON -ERROR@10772: expected command, found IDENT -ERROR@10779: expected command, found ERROR -ERROR@10780: expected command, found IDENT -ERROR@10792: expected SEMICOLON -ERROR@10793: expected command, found ERROR -ERROR@10794: expected command, found IDENT -ERROR@10799: expected command, found INT_NUMBER -ERROR@10801: expected command, found ERROR -ERROR@10802: expected command, found IDENT -ERROR@10805: expected command, found ERROR -ERROR@10806: expected command, found IDENT -ERROR@10817: expected command, found IDENT -ERROR@10823: expected command, found INT_NUMBER -ERROR@10825: expected command, found INT_NUMBER -ERROR@10827: expected command, found ERROR -ERROR@10828: expected command, found IDENT -ERROR@10831: expected command, found ERROR -ERROR@10832: expected command, found IDENT -ERROR@10834: expected command, found IDENT -ERROR@10840: expected command, found ERROR -ERROR@10841: expected command, found IDENT -ERROR@10843: expected command, found IDENT -ERROR@10848: expected command, found IDENT -ERROR@10853: expected command, found IDENT -ERROR@10858: expected command, found IDENT -ERROR@10864: expected command, found ERROR -ERROR@10865: expected command, found IDENT -ERROR@10868: expected command, found IDENT -ERROR@10874: expected command, found ERROR -ERROR@10886: expected SEMICOLON -ERROR@10888: expected command, found ERROR -ERROR@10889: expected command, found IDENT -ERROR@10899: expected command, found ERROR -ERROR@10909: expected SEMICOLON -ERROR@10910: expected command, found IDENT -ERROR@10915: expected command, found IDENT -ERROR@10920: expected command, found IDENT -ERROR@10925: expected command, found IDENT -ERROR@10930: expected command, found IDENT -ERROR@10936: expected command, found ERROR -ERROR@10937: expected command, found IDENT -ERROR@10969: expected SEMICOLON -ERROR@10970: expected command, found ERROR -ERROR@10971: expected command, found IDENT -ERROR@10985: expected command, found ERROR -ERROR@10986: expected command, found IDENT -ERROR@10989: expected command, found IDENT -ERROR@10995: expected command, found ERROR -ERROR@10996: expected command, found IDENT -ERROR@10998: expected command, found IDENT -ERROR@11003: expected command, found IDENT -ERROR@11009: expected command, found ERROR -ERROR@11010: expected command, found IDENT -ERROR@11013: expected command, found IDENT -ERROR@11025: expected command, found ERROR -ERROR@11026: expected command, found IDENT -ERROR@11029: expected command, found IDENT -ERROR@11041: expected command, found ERROR -ERROR@11042: expected command, found IDENT -ERROR@11047: expected command, found IDENT -ERROR@11052: expected command, found IDENT -ERROR@11057: expected command, found IDENT -ERROR@11062: expected command, found IDENT -ERROR@11067: expected command, found IDENT -ERROR@11073: expected command, found ERROR -ERROR@11074: expected command, found IDENT -ERROR@11079: expected command, found IDENT -ERROR@11085: expected command, found ERROR -ERROR@11086: expected command, found ENCODING_KW -ERROR@11095: expected command, found IDENT -ERROR@11101: expected command, found ERROR -ERROR@11102: expected command, found IDENT -ERROR@11115: expected command, found ERROR -ERROR@11116: expected command, found IDENT -ERROR@11128: expected command, found ERROR -ERROR@11129: expected command, found IDENT -ERROR@11131: expected command, found IDENT -ERROR@11137: expected command, found ERROR -ERROR@11138: expected command, found IDENT -ERROR@11145: expected command, found ERROR -ERROR@11146: expected command, found IDENT -ERROR@11160: expected command, found ERROR -ERROR@11161: expected command, found IDENT -ERROR@11163: expected command, found IDENT -ERROR@11169: expected command, found ERROR -ERROR@11170: expected command, found IDENT -ERROR@11173: expected command, found IDENT -ERROR@11179: expected command, found ERROR -ERROR@11180: expected command, found IDENT -ERROR@11187: expected command, found ERROR -ERROR@11188: expected command, found IDENT -ERROR@11219: expected command, found ERROR -ERROR@11220: expected command, found IDENT -ERROR@11223: expected command, found ERROR -ERROR@11224: expected command, found QUESTION -ERROR@11227: expected command, found ERROR -ERROR@11228: expected command, found IDENT -ERROR@11234: expected command, found ERROR -ERROR@11235: expected command, found IDENT -ERROR@11237: expected command, found IDENT -ERROR@11243: expected command, found ERROR -ERROR@11244: expected command, found IDENT -ERROR@11247: expected command, found IDENT -ERROR@11253: expected command, found ERROR -ERROR@11254: expected command, found IDENT -ERROR@11256: expected command, found IDENT -ERROR@11262: expected command, found ERROR -ERROR@11263: expected command, found IDENT -ERROR@11266: expected command, found IDENT -ERROR@11271: expected command, found IDENT -ERROR@11277: expected command, found ERROR -ERROR@11278: expected command, found IDENT -ERROR@11287: expected command, found ERROR -ERROR@11288: expected command, found IDENT -ERROR@11290: expected command, found IDENT -ERROR@11296: expected command, found ERROR -ERROR@11297: expected command, found IDENT -ERROR@11308: expected SEMICOLON -ERROR@11309: expected command, found ERROR -ERROR@11310: expected command, found IDENT -ERROR@11317: expected command, found ERROR -ERROR@11318: expected command, found PASSWORD_KW -ERROR@11327: expected command, found IDENT -ERROR@11333: expected command, found ERROR -ERROR@11334: expected command, found IDENT -ERROR@11341: expected command, found IDENT -ERROR@11346: expected command, found IDENT -ERROR@11352: expected command, found ERROR -ERROR@11353: expected command, found IDENT -ERROR@11358: expected command, found IDENT -ERROR@11363: expected command, found IDENT -ERROR@11369: expected command, found ERROR -ERROR@11370: expected command, found IDENT -ERROR@11373: expected command, found ERROR -ERROR@11379: expected name -ERROR@11379: expected SEMICOLON -ERROR@11381: expected command, found ERROR -ERROR@11382: expected command, found IDENT -ERROR@11384: expected command, found IDENT -ERROR@11390: expected command, found ERROR -ERROR@11391: expected command, found IDENT -ERROR@11405: expected command, found ERROR -ERROR@11414: expected EQ -ERROR@11419: expected SEMICOLON -ERROR@11420: expected command, found IDENT -ERROR@11425: expected command, found IDENT -ERROR@11430: expected command, found IDENT -ERROR@11435: expected command, found IDENT -ERROR@11440: expected command, found IDENT -ERROR@11446: expected command, found ERROR -ERROR@11447: expected command, found IDENT -ERROR@11454: expected command, found IDENT -ERROR@11459: expected command, found IDENT -ERROR@11465: expected command, found ERROR -ERROR@11466: expected command, found IDENT -ERROR@11469: expected command, found IDENT -ERROR@11481: expected command, found ERROR -ERROR@11482: expected command, found IDENT -ERROR@11485: expected command, found IDENT -ERROR@11497: expected command, found ERROR -ERROR@11498: expected command, found IDENT -ERROR@11513: expected command, found ERROR -ERROR@11514: expected command, found IDENT -ERROR@11528: expected command, found ERROR -ERROR@11529: expected command, found IDENT -ERROR@11531: expected command, found IDENT -ERROR@11537: expected command, found ERROR -ERROR@11538: expected command, found IDENT -ERROR@11540: expected command, found IDENT -ERROR@11546: expected command, found ERROR -ERROR@11547: expected command, found IDENT -ERROR@11554: expected command, found IDENT -ERROR@11560: expected command, found ERROR -ERROR@11561: expected command, found IDENT -ERROR@11567: expected command, found IDENT -ERROR@11573: expected command, found ERROR -ERROR@11574: expected command, found IDENT -ERROR@11576: expected command, found IDENT -ERROR@11582: expected command, found ERROR -ERROR@11583: expected command, found IDENT -ERROR@11589: expected command, found IDENT -ERROR@11594: expected command, found IDENT -ERROR@11600: expected command, found ERROR -ERROR@11601: expected command, found IDENT -ERROR@11603: expected command, found IDENT -ERROR@11665: expected command, found ERROR -ERROR@11666: expected command, found IDENT -ERROR@11668: expected command, found PIPE -ERROR@11669: expected command, found SLASH -ERROR@11670: expected command, found NO_KW -ERROR@11672: expected command, found SLASH -ERROR@11673: expected command, found IDENT -ERROR@11677: expected command, found SLASH -ERROR@11678: expected command, found IDENT -ERROR@11683: expected command, found ERROR -ERROR@11684: expected command, found ELSE_KW -ERROR@11746: expected command, found ERROR -ERROR@11747: expected command, found BANG -ERROR@11749: expected command, found IDENT -ERROR@11760: expected command, found ERROR -ERROR@11761: expected command, found IDENT -ERROR@11768: expected command, found ERROR -ERROR@11769: expected command, found IDENT -ERROR@11772: expected command, found ERROR -ERROR@11773: expected command, found IDENT -ERROR@11778: expected command, found STRING -ERROR@11834: expected command, found ERROR -ERROR@11835: expected command, found IDENT -ERROR@11840: expected command, found STRING -ERROR@11875: expected command, found ERROR -ERROR@11876: expected command, found IDENT -ERROR@11881: expected command, found STRING -ERROR@11908: expected command, found ERROR -ERROR@11909: expected command, found IDENT -ERROR@11914: expected command, found STRING -ERROR@11941: expected command, found ERROR -ERROR@11942: expected command, found IDENT -ERROR@11947: expected command, found STRING -ERROR@12007: expected SEMICOLON -ERROR@12008: expected command, found COLON -ERROR@12009: expected command, found ERROR -ERROR@12010: expected command, found QUESTION -ERROR@12011: expected command, found IDENT -ERROR@12012: expected command, found ERROR -ERROR@12014: expected command, found AS_KW -ERROR@12017: expected command, found IDENT -ERROR@12043: expected an expression, found COLON -ERROR@12044: expected SEMICOLON -ERROR@12044: expected command, found ERROR -ERROR@12045: expected command, found QUESTION -ERROR@12046: expected command, found IDENT -ERROR@12057: expected command, found ERROR -ERROR@12059: expected command, found AS_KW -ERROR@12062: expected command, found IDENT -ERROR@12377: expected SEMICOLON -ERROR@12378: expected command, found ERROR -ERROR@12379: expected command, found IDENT -ERROR@12389: expected SEMICOLON -ERROR@12390: expected command, found ERROR -ERROR@12391: expected command, found IDENT -ERROR@12393: expected command, found UNION_KW -ERROR@12407: expected SEMICOLON -ERROR@12408: expected command, found ERROR -ERROR@12409: expected command, found IDENT -ERROR@12411: expected command, found UNION_KW -ERROR@12577: expected start of a select statement -ERROR@12785: expected start of a select statement -ERROR@12848: expected SEMICOLON -ERROR@12849: expected command, found ERROR -ERROR@12850: expected command, found IDENT -ERROR@12893: expected column label, got ERROR -ERROR@12894: missing comma -ERROR@12959: missing comma -ERROR@13395: expected NONE or role_name -ERROR@13395: expected SEMICOLON -ERROR@13396: expected command, found TO_KW -ERROR@13399: expected command, found IDENT -ERROR@14992: expected NONE or role_name -ERROR@14992: expected SEMICOLON -ERROR@14993: expected command, found TO_KW -ERROR@14996: expected command, found DEFAULT_KW -ERROR@16963: expected SEMICOLON -ERROR@16964: expected command, found ERROR -ERROR@16985: expected SEMICOLON -ERROR@16986: expected command, found ERROR -ERROR@17056: expected SEMICOLON -ERROR@17057: expected command, found ERROR -ERROR@17078: expected SEMICOLON -ERROR@17079: expected command, found ERROR -ERROR@17146: expected SEMICOLON -ERROR@17147: expected command, found ERROR -ERROR@17161: expected an expression, found ERROR -ERROR@17182: expected SEMICOLON -ERROR@17183: expected command, found ERROR -ERROR@17251: expected SEMICOLON -ERROR@17252: expected command, found ERROR -ERROR@17272: expected SEMICOLON -ERROR@17273: expected command, found ERROR -ERROR@17294: expected SEMICOLON -ERROR@17295: expected command, found ERROR -ERROR@17306: expected SEMICOLON -ERROR@17307: expected command, found ERROR -ERROR@17512: expected SEMICOLON -ERROR@17513: expected command, found ERROR -ERROR@17548: expected SEMICOLON -ERROR@17549: expected command, found ERROR -ERROR@17605: expected SEMICOLON -ERROR@17606: expected command, found ERROR -ERROR@17625: expected SEMICOLON -ERROR@17626: expected command, found ERROR -ERROR@17647: expected SEMICOLON -ERROR@17648: expected command, found ERROR -ERROR@17839: expected SEMICOLON -ERROR@17840: expected command, found ERROR -ERROR@17841: expected command, found IDENT -ERROR@17843: expected command, found STRING -ERROR@17913: expected SEMICOLON -ERROR@17913: expected command, found ERROR -ERROR@17929: expected SEMICOLON -ERROR@17929: expected command, found ERROR -ERROR@17945: expected SEMICOLON -ERROR@17946: expected command, found ERROR -ERROR@17947: expected command, found IDENT -ERROR@17949: expected command, found STRING -ERROR@18035: expected SEMICOLON -ERROR@18036: expected command, found ERROR -ERROR@18068: expected SEMICOLON -ERROR@18069: expected command, found ERROR -ERROR@18070: expected command, found IDENT -ERROR@18072: expected command, found STRING -ERROR@18276: expected SEMICOLON -ERROR@18276: expected command, found ERROR -ERROR@18292: expected SEMICOLON -ERROR@18292: expected command, found ERROR -ERROR@18960: expected SEMICOLON -ERROR@18961: expected command, found ERROR -ERROR@19087: expected SEMICOLON -ERROR@19088: expected command, found ERROR -ERROR@19121: expected SEMICOLON -ERROR@19122: expected command, found ERROR -ERROR@19123: expected command, found IDENT -ERROR@19125: expected command, found STRING -ERROR@19518: expected SEMICOLON -ERROR@19519: expected command, found ERROR -ERROR@19557: expected SEMICOLON -ERROR@19558: expected command, found ERROR -ERROR@19607: expected SEMICOLON -ERROR@19608: expected command, found ERROR -ERROR@19634: expected SEMICOLON -ERROR@19635: expected command, found ERROR -ERROR@19705: expected SEMICOLON -ERROR@19706: expected command, found ERROR -ERROR@19723: expected SEMICOLON -ERROR@19724: expected command, found ERROR -ERROR@19797: expected SEMICOLON -ERROR@19798: expected command, found ERROR -ERROR@19825: expected SEMICOLON -ERROR@19826: expected command, found ERROR -ERROR@19875: expected SEMICOLON -ERROR@19876: expected command, found ERROR -ERROR@19893: expected SEMICOLON -ERROR@19894: expected command, found ERROR -ERROR@19911: expected SEMICOLON -ERROR@19912: expected command, found ERROR -ERROR@19923: expected SEMICOLON -ERROR@19924: expected command, found ERROR -ERROR@19981: expected SEMICOLON -ERROR@19982: expected command, found ERROR -ERROR@20580: expected SEMICOLON -ERROR@20581: expected command, found ERROR -ERROR@20634: expected SEMICOLON -ERROR@20635: expected command, found ERROR -ERROR@20702: expected SEMICOLON -ERROR@20703: expected command, found ERROR -ERROR@20831: expected SEMICOLON -ERROR@20832: expected command, found ERROR -ERROR@21182: expected SEMICOLON -ERROR@21183: expected command, found ERROR -ERROR@21261: expected SEMICOLON -ERROR@21262: expected command, found ERROR -ERROR@21432: expected SEMICOLON -ERROR@21433: expected command, found ERROR -ERROR@22268: missing comma -ERROR@22277: expected OPTION, TRUE, or FALSE -ERROR@22277: missing comma -ERROR@22280: expected OPTION, TRUE, or FALSE -ERROR@22280: missing comma -ERROR@22297: expected OPTION, TRUE, or FALSE -ERROR@22384: missing comma -ERROR@22392: expected OPTION, TRUE, or FALSE -ERROR@22392: missing comma -ERROR@22395: expected OPTION, TRUE, or FALSE -ERROR@22395: missing comma -ERROR@22412: expected OPTION, TRUE, or FALSE -ERROR@22498: missing comma -ERROR@22507: expected OPTION, TRUE, or FALSE -ERROR@22507: missing comma -ERROR@22510: expected OPTION, TRUE, or FALSE -ERROR@22510: missing comma -ERROR@22527: expected OPTION, TRUE, or FALSE -ERROR@22614: missing comma -ERROR@22622: expected OPTION, TRUE, or FALSE -ERROR@22622: missing comma -ERROR@22625: expected OPTION, TRUE, or FALSE -ERROR@22625: missing comma -ERROR@22642: expected OPTION, TRUE, or FALSE -ERROR@22728: missing comma -ERROR@22737: expected OPTION, TRUE, or FALSE -ERROR@22737: missing comma -ERROR@22740: expected OPTION, TRUE, or FALSE -ERROR@22740: missing comma -ERROR@22757: expected OPTION, TRUE, or FALSE -ERROR@22843: missing comma -ERROR@22852: expected OPTION, TRUE, or FALSE -ERROR@22852: missing comma -ERROR@22855: expected OPTION, TRUE, or FALSE -ERROR@22855: missing comma -ERROR@22872: expected OPTION, TRUE, or FALSE -ERROR@22959: missing comma -ERROR@22967: expected OPTION, TRUE, or FALSE -ERROR@22967: missing comma -ERROR@22970: expected OPTION, TRUE, or FALSE -ERROR@22970: missing comma -ERROR@22987: expected OPTION, TRUE, or FALSE diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_psql_crosstab.snap b/crates/squawk_parser/tests/snapshots/tests__regression_psql_crosstab.snap deleted file mode 100644 index 80a21a3a..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_psql_crosstab.snap +++ /dev/null @@ -1,119 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/psql_crosstab.sql ---- -ERROR@48: expected type name -ERROR@51: expected type name -ERROR@54: expected type name -ERROR@57: expected type name -ERROR@60: expected type name -ERROR@577: expected command, found ERROR -ERROR@578: expected command, found IDENT -ERROR@776: expected SEMICOLON -ERROR@778: expected command, found ERROR -ERROR@779: expected command, found IDENT -ERROR@792: expected command, found IDENT -ERROR@794: expected command, found IDENT -ERROR@807: expected command, found INT_NUMBER -ERROR@809: expected command, found IDENT -ERROR@946: missing comma -ERROR@1155: expected SEMICOLON -ERROR@1300: expected SEMICOLON -ERROR@1302: expected command, found ERROR -ERROR@1303: expected command, found IDENT -ERROR@1316: expected command, found INT_NUMBER -ERROR@1318: expected command, found INT_NUMBER -ERROR@1320: expected command, found INT_NUMBER -ERROR@1484: expected SEMICOLON -ERROR@1486: expected command, found ERROR -ERROR@1487: expected command, found IDENT -ERROR@1500: expected command, found IDENT -ERROR@1502: expected command, found IDENT -ERROR@1504: expected command, found IDENT -ERROR@1506: expected command, found IDENT -ERROR@1677: expected SEMICOLON -ERROR@1679: expected command, found ERROR -ERROR@1680: expected command, found IDENT -ERROR@1693: expected command, found IDENT -ERROR@1695: expected command, found IDENT -ERROR@1697: expected command, found IDENT -ERROR@1699: expected command, found IDENT -ERROR@1898: expected SEMICOLON -ERROR@1900: expected command, found ERROR -ERROR@1901: expected command, found IDENT -ERROR@1914: expected command, found IDENT -ERROR@1916: expected command, found IDENT -ERROR@1918: expected command, found IDENT -ERROR@1920: expected command, found IDENT -ERROR@1986: expected SEMICOLON -ERROR@1987: expected command, found ERROR -ERROR@1988: expected command, found IDENT -ERROR@2070: expected SEMICOLON -ERROR@2071: expected command, found ERROR -ERROR@2072: expected command, found IDENT -ERROR@2186: expected SEMICOLON -ERROR@2188: expected command, found ERROR -ERROR@2189: expected command, found IDENT -ERROR@2202: expected command, found IDENT -ERROR@2204: expected command, found IDENT -ERROR@2206: expected command, found IDENT -ERROR@2341: expected SEMICOLON -ERROR@2343: expected command, found ERROR -ERROR@2344: expected command, found IDENT -ERROR@2357: expected command, found INT_NUMBER -ERROR@2359: expected command, found INT_NUMBER -ERROR@2361: expected command, found INT_NUMBER -ERROR@2524: expected SEMICOLON -ERROR@2526: expected command, found ERROR -ERROR@2527: expected command, found IDENT -ERROR@2540: expected command, found INT_NUMBER -ERROR@2542: expected command, found IDENT -ERROR@2546: expected command, found INT_NUMBER -ERROR@2656: expected SEMICOLON -ERROR@2658: expected command, found ERROR -ERROR@2659: expected command, found IDENT -ERROR@2672: expected command, found IDENT -ERROR@2677: expected command, found IDENT -ERROR@2679: expected command, found IDENT -ERROR@2740: expected SEMICOLON -ERROR@2742: expected command, found ERROR -ERROR@2743: expected command, found IDENT -ERROR@2756: expected command, found IDENT -ERROR@2758: expected command, found IDENT -ERROR@2760: expected command, found IDENT -ERROR@2828: expected SEMICOLON -ERROR@2830: expected command, found ERROR -ERROR@2831: expected command, found IDENT -ERROR@2844: expected command, found INT_NUMBER -ERROR@2846: expected command, found INT_NUMBER -ERROR@2848: expected command, found IDENT -ERROR@2922: expected SEMICOLON -ERROR@2924: expected command, found ERROR -ERROR@2925: expected command, found IDENT -ERROR@2938: expected command, found INT_NUMBER -ERROR@2940: expected command, found IDENT -ERROR@2944: expected command, found IDENT -ERROR@3007: expected SEMICOLON -ERROR@3009: expected command, found ERROR -ERROR@3010: expected command, found IDENT -ERROR@3023: expected command, found INT_NUMBER -ERROR@3025: expected command, found INT_NUMBER -ERROR@3027: expected command, found INT_NUMBER -ERROR@3089: expected SEMICOLON -ERROR@3091: expected command, found ERROR -ERROR@3092: expected command, found IDENT -ERROR@3105: expected command, found INT_NUMBER -ERROR@3107: expected command, found IDENT -ERROR@3109: expected command, found INT_NUMBER -ERROR@3185: expected SEMICOLON -ERROR@3187: expected command, found ERROR -ERROR@3188: expected command, found IDENT -ERROR@3236: expected SEMICOLON -ERROR@3237: expected command, found ERROR -ERROR@3238: expected command, found IDENT -ERROR@3454: expected SEMICOLON -ERROR@3455: expected command, found ERROR -ERROR@3456: expected command, found IDENT -ERROR@3567: expected SEMICOLON -ERROR@3568: expected command, found ERROR -ERROR@3569: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_psql_pipeline.snap b/crates/squawk_parser/tests/snapshots/tests__regression_psql_pipeline.snap deleted file mode 100644 index 5304332b..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_psql_pipeline.snap +++ /dev/null @@ -1,653 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/psql_pipeline.sql ---- -ERROR@123: expected SEMICOLON -ERROR@124: expected command, found ERROR -ERROR@125: expected command, found IDENT -ERROR@130: expected command, found STRING -ERROR@137: expected command, found ERROR -ERROR@138: expected command, found IDENT -ERROR@196: expected SEMICOLON -ERROR@197: expected command, found ERROR -ERROR@198: expected command, found IDENT -ERROR@203: expected command, found STRING -ERROR@210: expected command, found ERROR -ERROR@211: expected command, found IDENT -ERROR@237: expected SEMICOLON -ERROR@238: expected command, found ERROR -ERROR@239: expected command, found IDENT -ERROR@244: expected command, found STRING -ERROR@251: expected command, found STRING -ERROR@258: expected command, found ERROR -ERROR@259: expected command, found IDENT -ERROR@285: expected SEMICOLON -ERROR@286: expected command, found ERROR -ERROR@287: expected command, found IDENT -ERROR@292: expected command, found STRING -ERROR@299: expected command, found STRING -ERROR@306: expected command, found ERROR -ERROR@307: expected command, found IDENT -ERROR@475: expected SEMICOLON -ERROR@476: expected command, found ERROR -ERROR@477: expected command, found IDENT -ERROR@482: expected command, found STRING -ERROR@489: expected command, found ERROR -ERROR@490: expected command, found IDENT -ERROR@516: expected SEMICOLON -ERROR@517: expected command, found ERROR -ERROR@518: expected command, found IDENT -ERROR@523: expected command, found STRING -ERROR@530: expected command, found STRING -ERROR@537: expected command, found ERROR -ERROR@538: expected command, found IDENT -ERROR@564: expected SEMICOLON -ERROR@565: expected command, found ERROR -ERROR@566: expected command, found IDENT -ERROR@571: expected command, found STRING -ERROR@578: expected command, found STRING -ERROR@585: expected command, found ERROR -ERROR@586: expected command, found IDENT -ERROR@670: expected SEMICOLON -ERROR@671: expected command, found ERROR -ERROR@672: expected command, found IDENT -ERROR@677: expected command, found STRING -ERROR@684: expected command, found ERROR -ERROR@685: expected command, found IDENT -ERROR@711: expected SEMICOLON -ERROR@712: expected command, found ERROR -ERROR@713: expected command, found IDENT -ERROR@718: expected command, found STRING -ERROR@725: expected command, found STRING -ERROR@732: expected command, found ERROR -ERROR@733: expected command, found IDENT -ERROR@759: expected SEMICOLON -ERROR@760: expected command, found ERROR -ERROR@761: expected command, found IDENT -ERROR@766: expected command, found STRING -ERROR@773: expected command, found STRING -ERROR@780: expected command, found ERROR -ERROR@781: expected command, found IDENT -ERROR@929: expected SEMICOLON -ERROR@930: expected command, found ERROR -ERROR@931: expected command, found IDENT -ERROR@937: expected command, found STRING -ERROR@1037: expected SEMICOLON -ERROR@1038: expected command, found ERROR -ERROR@1039: expected command, found IDENT -ERROR@1044: expected command, found INT_NUMBER -ERROR@1139: expected SEMICOLON -ERROR@1140: expected command, found ERROR -ERROR@1141: expected command, found IDENT -ERROR@1146: expected command, found STRING -ERROR@1153: expected command, found ERROR -ERROR@1154: expected command, found IDENT -ERROR@1280: expected SEMICOLON -ERROR@1281: expected command, found ERROR -ERROR@1282: expected command, found IDENT -ERROR@1287: expected command, found INT_NUMBER -ERROR@1289: expected command, found ERROR -ERROR@1290: expected command, found IDENT -ERROR@1308: expected SEMICOLON -ERROR@1309: expected command, found ERROR -ERROR@1310: expected command, found IDENT -ERROR@1315: expected command, found ERROR -ERROR@1316: expected command, found IDENT -ERROR@1366: expected SEMICOLON -ERROR@1367: expected command, found ERROR -ERROR@1368: expected command, found IDENT -ERROR@1373: expected command, found INT_NUMBER -ERROR@1375: expected command, found ERROR -ERROR@1376: expected command, found IDENT -ERROR@1397: expected SEMICOLON -ERROR@1398: expected command, found ERROR -ERROR@1399: expected command, found IDENT -ERROR@1404: expected command, found ERROR -ERROR@1405: expected command, found IDENT -ERROR@1458: expected SEMICOLON -ERROR@1459: expected command, found ERROR -ERROR@1460: expected command, found IDENT -ERROR@1465: expected command, found ERROR -ERROR@1466: expected command, found IDENT -ERROR@1516: expected SEMICOLON -ERROR@1517: expected command, found ERROR -ERROR@1518: expected command, found IDENT -ERROR@1523: expected command, found INT_NUMBER -ERROR@1525: expected command, found ERROR -ERROR@1526: expected command, found IDENT -ERROR@1547: expected SEMICOLON -ERROR@1548: expected command, found ERROR -ERROR@1549: expected command, found IDENT -ERROR@1554: expected command, found ERROR -ERROR@1555: expected command, found IDENT -ERROR@1573: expected SEMICOLON -ERROR@1574: expected command, found ERROR -ERROR@1575: expected command, found IDENT -ERROR@1580: expected command, found ERROR -ERROR@1581: expected command, found IDENT -ERROR@1631: expected SEMICOLON -ERROR@1632: expected command, found ERROR -ERROR@1633: expected command, found IDENT -ERROR@1638: expected command, found INT_NUMBER -ERROR@1640: expected command, found ERROR -ERROR@1641: expected command, found IDENT -ERROR@1660: expected SEMICOLON -ERROR@1661: expected command, found ERROR -ERROR@1662: expected command, found IDENT -ERROR@1667: expected command, found ERROR -ERROR@1668: expected command, found IDENT -ERROR@1742: expected SEMICOLON -ERROR@1743: expected command, found ERROR -ERROR@1744: expected command, found IDENT -ERROR@1749: expected command, found STRING -ERROR@1756: expected command, found ERROR -ERROR@1757: expected command, found IDENT -ERROR@1897: expected SEMICOLON -ERROR@1898: expected command, found ERROR -ERROR@1899: expected command, found IDENT -ERROR@1904: expected command, found STRING -ERROR@1911: expected command, found ERROR -ERROR@1912: expected command, found IDENT -ERROR@2052: expected SEMICOLON -ERROR@2053: expected command, found ERROR -ERROR@2054: expected command, found IDENT -ERROR@2059: expected command, found STRING -ERROR@2066: expected command, found ERROR -ERROR@2067: expected command, found IDENT -ERROR@2173: expected SEMICOLON -ERROR@2174: expected command, found ERROR -ERROR@2175: expected command, found IDENT -ERROR@2180: expected command, found STRING -ERROR@2187: expected command, found ERROR -ERROR@2188: expected command, found IDENT -ERROR@2229: expected SEMICOLON -ERROR@2230: expected command, found ERROR -ERROR@2231: expected command, found IDENT -ERROR@2236: expected command, found ERROR -ERROR@2237: expected command, found IDENT -ERROR@2406: expected SEMICOLON -ERROR@2407: expected command, found ERROR -ERROR@2408: expected command, found IDENT -ERROR@2413: expected command, found STRING -ERROR@2420: expected command, found ERROR -ERROR@2421: expected command, found IDENT -ERROR@2462: expected SEMICOLON -ERROR@2463: expected command, found ERROR -ERROR@2464: expected command, found IDENT -ERROR@2469: expected command, found ERROR -ERROR@2470: expected command, found IDENT -ERROR@2639: expected SEMICOLON -ERROR@2640: expected command, found ERROR -ERROR@2641: expected command, found IDENT -ERROR@2646: expected command, found STRING -ERROR@2653: expected command, found ERROR -ERROR@2654: expected command, found IDENT -ERROR@2695: expected SEMICOLON -ERROR@2696: expected command, found ERROR -ERROR@2697: expected command, found IDENT -ERROR@2702: expected command, found ERROR -ERROR@2703: expected command, found IDENT -ERROR@2819: expected SEMICOLON -ERROR@2820: expected command, found ERROR -ERROR@2821: expected command, found IDENT -ERROR@2827: expected command, found STRING -ERROR@2843: expected SEMICOLON -ERROR@2844: expected command, found ERROR -ERROR@2845: expected command, found IDENT -ERROR@2851: expected command, found STRING -ERROR@2863: expected SEMICOLON -ERROR@2864: expected command, found ERROR -ERROR@2865: expected command, found IDENT -ERROR@2871: expected command, found IDENT -ERROR@2955: expected SEMICOLON -ERROR@2956: expected command, found ERROR -ERROR@2957: expected command, found IDENT -ERROR@2962: expected command, found INT_NUMBER -ERROR@2964: expected command, found ERROR -ERROR@2965: expected command, found IDENT -ERROR@2987: expected SEMICOLON -ERROR@2988: expected command, found ERROR -ERROR@2989: expected command, found IDENT -ERROR@2994: expected command, found INT_NUMBER -ERROR@2996: expected command, found ERROR -ERROR@2997: expected command, found IDENT -ERROR@3083: expected SEMICOLON -ERROR@3084: expected command, found ERROR -ERROR@3085: expected command, found IDENT -ERROR@3090: expected command, found INT_NUMBER -ERROR@3092: expected command, found ERROR -ERROR@3093: expected command, found IDENT -ERROR@3115: expected SEMICOLON -ERROR@3116: expected command, found ERROR -ERROR@3117: expected command, found IDENT -ERROR@3122: expected command, found INT_NUMBER -ERROR@3124: expected command, found ERROR -ERROR@3125: expected command, found IDENT -ERROR@3215: expected SEMICOLON -ERROR@3216: expected command, found ERROR -ERROR@3217: expected command, found IDENT -ERROR@3222: expected command, found INT_NUMBER -ERROR@3224: expected command, found ERROR -ERROR@3225: expected command, found IDENT -ERROR@3311: expected SEMICOLON -ERROR@3312: expected command, found ERROR -ERROR@3313: expected command, found IDENT -ERROR@3318: expected command, found INT_NUMBER -ERROR@3320: expected command, found ERROR -ERROR@3321: expected command, found IDENT -ERROR@3343: expected SEMICOLON -ERROR@3344: expected command, found ERROR -ERROR@3345: expected command, found IDENT -ERROR@3350: expected command, found INT_NUMBER -ERROR@3352: expected command, found ERROR -ERROR@3353: expected command, found IDENT -ERROR@3439: expected SEMICOLON -ERROR@3440: expected command, found ERROR -ERROR@3441: expected command, found IDENT -ERROR@3446: expected command, found INT_NUMBER -ERROR@3448: expected command, found ERROR -ERROR@3449: expected command, found IDENT -ERROR@3471: expected SEMICOLON -ERROR@3472: expected command, found ERROR -ERROR@3473: expected command, found IDENT -ERROR@3478: expected command, found INT_NUMBER -ERROR@3480: expected command, found ERROR -ERROR@3481: expected command, found IDENT -ERROR@3580: expected SEMICOLON -ERROR@3581: expected command, found ERROR -ERROR@3582: expected command, found IDENT -ERROR@3587: expected command, found INT_NUMBER -ERROR@3589: expected command, found ERROR -ERROR@3590: expected command, found IDENT -ERROR@3612: expected SEMICOLON -ERROR@3613: expected command, found ERROR -ERROR@3614: expected command, found IDENT -ERROR@3619: expected command, found INT_NUMBER -ERROR@3621: expected command, found ERROR -ERROR@3622: expected command, found IDENT -ERROR@3703: expected SEMICOLON -ERROR@3704: expected command, found ERROR -ERROR@3705: expected command, found IDENT -ERROR@3710: expected command, found INT_NUMBER -ERROR@3712: expected command, found ERROR -ERROR@3713: expected command, found IDENT -ERROR@3735: expected SEMICOLON -ERROR@3736: expected command, found ERROR -ERROR@3737: expected command, found IDENT -ERROR@3742: expected command, found INT_NUMBER -ERROR@3744: expected command, found ERROR -ERROR@3745: expected command, found IDENT -ERROR@3767: expected SEMICOLON -ERROR@3768: expected command, found ERROR -ERROR@3769: expected command, found IDENT -ERROR@3774: expected command, found INT_NUMBER -ERROR@3776: expected command, found ERROR -ERROR@3777: expected command, found IDENT -ERROR@3799: expected SEMICOLON -ERROR@3800: expected command, found ERROR -ERROR@3801: expected command, found IDENT -ERROR@3806: expected command, found INT_NUMBER -ERROR@3808: expected command, found ERROR -ERROR@3809: expected command, found IDENT -ERROR@3896: expected SEMICOLON -ERROR@3897: expected command, found ERROR -ERROR@3898: expected command, found IDENT -ERROR@3903: expected command, found INT_NUMBER -ERROR@3905: expected command, found ERROR -ERROR@3906: expected command, found IDENT -ERROR@3974: expected SEMICOLON -ERROR@3975: expected command, found ERROR -ERROR@3976: expected command, found IDENT -ERROR@3981: expected command, found INT_NUMBER -ERROR@3983: expected command, found ERROR -ERROR@3984: expected command, found IDENT -ERROR@4006: expected SEMICOLON -ERROR@4007: expected command, found ERROR -ERROR@4008: expected command, found IDENT -ERROR@4013: expected command, found INT_NUMBER -ERROR@4015: expected command, found ERROR -ERROR@4016: expected command, found IDENT -ERROR@4038: expected SEMICOLON -ERROR@4039: expected command, found ERROR -ERROR@4040: expected command, found IDENT -ERROR@4045: expected command, found INT_NUMBER -ERROR@4047: expected command, found ERROR -ERROR@4048: expected command, found IDENT -ERROR@4231: expected SEMICOLON -ERROR@4232: expected command, found ERROR -ERROR@4233: expected command, found IDENT -ERROR@4238: expected command, found ERROR -ERROR@4239: expected command, found IDENT -ERROR@4261: expected SEMICOLON -ERROR@4262: expected command, found ERROR -ERROR@4263: expected command, found IDENT -ERROR@4268: expected command, found INT_NUMBER -ERROR@4270: expected command, found ERROR -ERROR@4271: expected command, found IDENT -ERROR@4408: expected SEMICOLON -ERROR@4409: expected command, found ERROR -ERROR@4410: expected command, found IDENT -ERROR@4415: expected command, found STRING -ERROR@4422: expected command, found ERROR -ERROR@4423: expected command, found IDENT -ERROR@4445: expected SEMICOLON -ERROR@4446: expected command, found ERROR -ERROR@4447: expected command, found IDENT -ERROR@4452: expected command, found STRING -ERROR@4459: expected command, found ERROR -ERROR@4460: expected command, found IDENT -ERROR@4672: expected SEMICOLON -ERROR@4673: expected command, found ERROR -ERROR@4674: expected command, found IDENT -ERROR@4679: expected command, found ERROR -ERROR@4680: expected command, found IDENT -ERROR@4730: expected SEMICOLON -ERROR@4731: expected command, found ERROR -ERROR@4732: expected command, found IDENT -ERROR@4737: expected command, found INT_NUMBER -ERROR@4739: expected command, found ERROR -ERROR@4740: expected command, found IDENT -ERROR@4761: expected SEMICOLON -ERROR@4762: expected command, found ERROR -ERROR@4763: expected command, found IDENT -ERROR@4768: expected command, found ERROR -ERROR@4769: expected command, found IDENT -ERROR@4839: expected SEMICOLON -ERROR@4840: expected command, found ERROR -ERROR@4841: expected command, found IDENT -ERROR@4846: expected command, found ERROR -ERROR@4847: expected command, found IDENT -ERROR@4991: expected SEMICOLON -ERROR@4992: expected command, found ERROR -ERROR@4993: expected command, found IDENT -ERROR@4998: expected command, found INT_NUMBER -ERROR@5000: expected command, found ERROR -ERROR@5001: expected command, found IDENT -ERROR@5016: expected SEMICOLON -ERROR@5017: expected command, found ERROR -ERROR@5018: expected command, found IDENT -ERROR@5023: expected command, found INT_NUMBER -ERROR@5025: expected command, found ERROR -ERROR@5026: expected command, found IDENT -ERROR@5131: expected SEMICOLON -ERROR@5132: expected command, found ERROR -ERROR@5133: expected command, found IDENT -ERROR@5139: expected command, found STRING -ERROR@5165: expected SEMICOLON -ERROR@5166: expected command, found ERROR -ERROR@5167: expected command, found IDENT -ERROR@5173: expected command, found STRING -ERROR@5256: expected SEMICOLON -ERROR@5257: expected command, found ERROR -ERROR@5258: expected command, found IDENT -ERROR@5263: expected command, found INT_NUMBER -ERROR@5265: expected command, found ERROR -ERROR@5266: expected command, found IDENT -ERROR@5277: expected SEMICOLON -ERROR@5278: expected command, found ERROR -ERROR@5279: expected command, found IDENT -ERROR@5284: expected command, found INT_NUMBER -ERROR@5286: expected command, found ERROR -ERROR@5287: expected command, found IDENT -ERROR@5289: expected command, found L_PAREN -ERROR@5290: expected command, found FORMAT_KW -ERROR@5296: expected command, found EQ -ERROR@5297: expected command, found IDENT -ERROR@5307: expected command, found IDENT -ERROR@5318: expected command, found EQ -ERROR@5319: expected command, found ON_KW -ERROR@5321: expected command, found R_PAREN -ERROR@5332: expected SEMICOLON -ERROR@5333: expected command, found ERROR -ERROR@5334: expected command, found IDENT -ERROR@5339: expected command, found INT_NUMBER -ERROR@5341: expected command, found ERROR -ERROR@5342: expected command, found IDENT -ERROR@5354: expected SEMICOLON -ERROR@5355: expected command, found ERROR -ERROR@5356: expected command, found IDENT -ERROR@5361: expected command, found INT_NUMBER -ERROR@5363: expected command, found ERROR -ERROR@5364: expected command, found IDENT -ERROR@5367: expected command, found L_PAREN -ERROR@5368: expected command, found FORMAT_KW -ERROR@5374: expected command, found EQ -ERROR@5375: expected command, found IDENT -ERROR@5385: expected command, found IDENT -ERROR@5396: expected command, found EQ -ERROR@5397: expected command, found ON_KW -ERROR@5399: expected command, found R_PAREN -ERROR@5410: expected SEMICOLON -ERROR@5411: expected command, found ERROR -ERROR@5412: expected command, found IDENT -ERROR@5417: expected command, found INT_NUMBER -ERROR@5419: expected command, found ERROR -ERROR@5420: expected command, found IDENT -ERROR@5539: expected SEMICOLON -ERROR@5540: expected command, found ERROR -ERROR@5541: expected command, found IDENT -ERROR@5546: expected command, found ERROR -ERROR@5547: expected command, found IDENT -ERROR@5569: expected SEMICOLON -ERROR@5570: expected command, found ERROR -ERROR@5571: expected command, found IDENT -ERROR@5576: expected command, found INT_NUMBER -ERROR@5578: expected command, found ERROR -ERROR@5579: expected command, found IDENT -ERROR@5590: expected SEMICOLON -ERROR@5591: expected command, found ERROR -ERROR@5592: expected command, found IDENT -ERROR@5597: expected command, found INT_NUMBER -ERROR@5599: expected command, found ERROR -ERROR@5600: expected command, found IDENT -ERROR@5667: expected SEMICOLON -ERROR@5668: expected command, found ERROR -ERROR@5669: expected command, found IDENT -ERROR@5674: expected command, found INT_NUMBER -ERROR@5676: expected command, found ERROR -ERROR@5677: expected command, found IDENT -ERROR@5771: expected SEMICOLON -ERROR@5772: expected command, found ERROR -ERROR@5773: expected command, found IDENT -ERROR@5913: expected SEMICOLON -ERROR@5914: expected command, found ERROR -ERROR@5915: expected command, found IDENT -ERROR@5921: expected command, found STRING -ERROR@5969: expected SEMICOLON -ERROR@5970: expected command, found ERROR -ERROR@5971: expected command, found IDENT -ERROR@5976: expected command, found ERROR -ERROR@5977: expected command, found IDENT -ERROR@6085: expected SEMICOLON -ERROR@6086: expected command, found ERROR -ERROR@6087: expected command, found IDENT -ERROR@6092: expected command, found ERROR -ERROR@6093: expected command, found IDENT -ERROR@6115: expected SEMICOLON -ERROR@6116: expected command, found ERROR -ERROR@6117: expected command, found IDENT -ERROR@6122: expected command, found INT_NUMBER -ERROR@6124: expected command, found ERROR -ERROR@6125: expected command, found IDENT -ERROR@6147: expected SEMICOLON -ERROR@6148: expected command, found ERROR -ERROR@6149: expected command, found IDENT -ERROR@6155: expected command, found IDENT -ERROR@6190: expected SEMICOLON -ERROR@6191: expected command, found ERROR -ERROR@6192: expected command, found IDENT -ERROR@6197: expected command, found INT_NUMBER -ERROR@6199: expected command, found ERROR -ERROR@6200: expected command, found IDENT -ERROR@6222: expected SEMICOLON -ERROR@6223: expected command, found ERROR -ERROR@6224: expected command, found IDENT -ERROR@6230: expected command, found IDENT -ERROR@6277: expected SEMICOLON -ERROR@6278: expected command, found ERROR -ERROR@6279: expected command, found IDENT -ERROR@6284: expected command, found INT_NUMBER -ERROR@6286: expected command, found ERROR -ERROR@6287: expected command, found IDENT -ERROR@6309: expected SEMICOLON -ERROR@6310: expected command, found ERROR -ERROR@6311: expected command, found IDENT -ERROR@6317: expected command, found IDENT -ERROR@6401: expected SEMICOLON -ERROR@6402: expected command, found ERROR -ERROR@6403: expected command, found IDENT -ERROR@6408: expected command, found ERROR -ERROR@6409: expected command, found IDENT -ERROR@6431: expected SEMICOLON -ERROR@6432: expected command, found ERROR -ERROR@6433: expected command, found IDENT -ERROR@6438: expected command, found INT_NUMBER -ERROR@6440: expected command, found ERROR -ERROR@6441: expected command, found IDENT -ERROR@6463: expected SEMICOLON -ERROR@6464: expected command, found ERROR -ERROR@6465: expected command, found IDENT -ERROR@6471: expected command, found IDENT -ERROR@6533: expected SEMICOLON -ERROR@6534: expected command, found ERROR -ERROR@6535: expected command, found IDENT -ERROR@6540: expected command, found ERROR -ERROR@6541: expected command, found IDENT -ERROR@6563: expected SEMICOLON -ERROR@6564: expected command, found ERROR -ERROR@6565: expected command, found IDENT -ERROR@6570: expected command, found ERROR -ERROR@6571: expected command, found IDENT -ERROR@6807: expected SEMICOLON -ERROR@6808: expected command, found ERROR -ERROR@6809: expected command, found IDENT -ERROR@6814: expected command, found ERROR -ERROR@6815: expected command, found IDENT -ERROR@7228: expected SEMICOLON -ERROR@7229: expected command, found ERROR -ERROR@7230: expected command, found IDENT -ERROR@7235: expected command, found ERROR -ERROR@7236: expected command, found IDENT -ERROR@7271: expected SEMICOLON -ERROR@7272: expected command, found ERROR -ERROR@7273: expected command, found IDENT -ERROR@7278: expected command, found ERROR -ERROR@7279: expected command, found IDENT -ERROR@7314: expected SEMICOLON -ERROR@7315: expected command, found ERROR -ERROR@7316: expected command, found IDENT -ERROR@7321: expected command, found ERROR -ERROR@7322: expected command, found IDENT -ERROR@7367: expected SEMICOLON -ERROR@7368: expected command, found ERROR -ERROR@7369: expected command, found IDENT -ERROR@7374: expected command, found ERROR -ERROR@7375: expected command, found IDENT -ERROR@7410: expected SEMICOLON -ERROR@7411: expected command, found ERROR -ERROR@7412: expected command, found IDENT -ERROR@7417: expected command, found ERROR -ERROR@7418: expected command, found IDENT -ERROR@7511: expected SEMICOLON -ERROR@7512: expected command, found ERROR -ERROR@7513: expected command, found IDENT -ERROR@7518: expected command, found INT_NUMBER -ERROR@7520: expected command, found ERROR -ERROR@7521: expected command, found IDENT -ERROR@7574: expected SEMICOLON -ERROR@7575: expected command, found ERROR -ERROR@7576: expected command, found IDENT -ERROR@7581: expected command, found ERROR -ERROR@7582: expected command, found IDENT -ERROR@7604: expected SEMICOLON -ERROR@7605: expected command, found ERROR -ERROR@7606: expected command, found IDENT -ERROR@7611: expected command, found INT_NUMBER -ERROR@7613: expected command, found ERROR -ERROR@7614: expected command, found IDENT -ERROR@7740: expected SEMICOLON -ERROR@7741: expected command, found ERROR -ERROR@7742: expected command, found IDENT -ERROR@7747: expected command, found ERROR -ERROR@7748: expected command, found IDENT -ERROR@7770: expected SEMICOLON -ERROR@7771: expected command, found ERROR -ERROR@7772: expected command, found IDENT -ERROR@7777: expected command, found INT_NUMBER -ERROR@7779: expected command, found ERROR -ERROR@7780: expected command, found IDENT -ERROR@7855: expected SEMICOLON -ERROR@7856: expected command, found ERROR -ERROR@7857: expected command, found IDENT -ERROR@7862: expected command, found ERROR -ERROR@7863: expected command, found IDENT -ERROR@7885: expected SEMICOLON -ERROR@7886: expected command, found ERROR -ERROR@7887: expected command, found IDENT -ERROR@7892: expected command, found INT_NUMBER -ERROR@7894: expected command, found ERROR -ERROR@7895: expected command, found IDENT -ERROR@7931: expected SEMICOLON -ERROR@7932: expected command, found ERROR -ERROR@7933: expected command, found IDENT -ERROR@7938: expected command, found ERROR -ERROR@7939: expected command, found IDENT -ERROR@7961: expected SEMICOLON -ERROR@7962: expected command, found ERROR -ERROR@7963: expected command, found IDENT -ERROR@7968: expected command, found INT_NUMBER -ERROR@7970: expected command, found ERROR -ERROR@7971: expected command, found IDENT -ERROR@8102: expected SEMICOLON -ERROR@8103: expected command, found ERROR -ERROR@8104: expected command, found IDENT -ERROR@8109: expected command, found ERROR -ERROR@8110: expected command, found IDENT -ERROR@8132: expected SEMICOLON -ERROR@8133: expected command, found ERROR -ERROR@8134: expected command, found IDENT -ERROR@8139: expected command, found INT_NUMBER -ERROR@8141: expected command, found ERROR -ERROR@8142: expected command, found IDENT -ERROR@8270: expected SEMICOLON -ERROR@8271: expected command, found ERROR -ERROR@8272: expected command, found IDENT -ERROR@8277: expected command, found INT_NUMBER -ERROR@8279: expected command, found ERROR -ERROR@8280: expected command, found IDENT -ERROR@8311: expected SEMICOLON -ERROR@8312: expected command, found ERROR -ERROR@8313: expected command, found IDENT -ERROR@8318: expected command, found ERROR -ERROR@8319: expected command, found IDENT -ERROR@8341: expected SEMICOLON -ERROR@8342: expected command, found ERROR -ERROR@8343: expected command, found IDENT -ERROR@8348: expected command, found INT_NUMBER -ERROR@8350: expected command, found ERROR -ERROR@8351: expected command, found IDENT -ERROR@8437: expected SEMICOLON -ERROR@8438: expected command, found ERROR -ERROR@8439: expected command, found IDENT -ERROR@8444: expected command, found ERROR -ERROR@8445: expected command, found IDENT -ERROR@8525: expected SEMICOLON -ERROR@8526: expected command, found ERROR -ERROR@8527: expected command, found IDENT -ERROR@8532: expected command, found ERROR -ERROR@8533: expected command, found IDENT -ERROR@8566: expected SEMICOLON -ERROR@8567: expected command, found ERROR -ERROR@8568: expected command, found IDENT -ERROR@8573: expected command, found ERROR -ERROR@8574: expected command, found IDENT -ERROR@8635: expected SEMICOLON -ERROR@8636: expected command, found ERROR -ERROR@8637: expected command, found IDENT -ERROR@8642: expected command, found ERROR -ERROR@8643: expected command, found IDENT -ERROR@8676: expected SEMICOLON -ERROR@8677: expected command, found ERROR -ERROR@8678: expected command, found IDENT -ERROR@8683: expected command, found ERROR -ERROR@8684: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap b/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap index e3dbfab6..29bc02a6 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap @@ -2,21 +2,16 @@ source: crates/squawk_parser/tests/tests.rs expression: "out.join(\"\\n\")" --- -tests/snapshots/tests__regression_alter_generic.snap:13 tests/snapshots/tests__regression_alter_table.snap:136 -tests/snapshots/tests__regression_arrays.snap:5 -tests/snapshots/tests__regression_btree_index.snap:66 -tests/snapshots/tests__regression_cluster.snap:19 -tests/snapshots/tests__regression_collate.icu.utf8.snap:53 -tests/snapshots/tests__regression_collate.linux.utf8.snap:31 +tests/snapshots/tests__regression_btree_index.snap:30 +tests/snapshots/tests__regression_collate.icu.utf8.snap:16 +tests/snapshots/tests__regression_collate.linux.utf8.snap:15 tests/snapshots/tests__regression_constraints.snap:538 tests/snapshots/tests__regression_copy.snap:231 tests/snapshots/tests__regression_copy2.snap:58 tests/snapshots/tests__regression_copydml.snap:154 tests/snapshots/tests__regression_copyselect.snap:27 -tests/snapshots/tests__regression_create_aggregate.snap:45 tests/snapshots/tests__regression_create_am.snap:14 -tests/snapshots/tests__regression_create_function_sql.snap:15 tests/snapshots/tests__regression_create_index.snap:22 tests/snapshots/tests__regression_create_operator.snap:17 tests/snapshots/tests__regression_create_table.snap:31 @@ -27,35 +22,27 @@ tests/snapshots/tests__regression_drop_if_exists.snap:22 tests/snapshots/tests__regression_errors.snap:286 tests/snapshots/tests__regression_foreign_data.snap:57 tests/snapshots/tests__regression_foreign_key.snap:92 -tests/snapshots/tests__regression_generated_stored.snap:17 -tests/snapshots/tests__regression_generated_virtual.snap:36 +tests/snapshots/tests__regression_generated_virtual.snap:19 tests/snapshots/tests__regression_groupingsets.snap:97 tests/snapshots/tests__regression_guc.snap:81 tests/snapshots/tests__regression_horology.snap:173 tests/snapshots/tests__regression_inherit.snap:304 tests/snapshots/tests__regression_insert.snap:19 tests/snapshots/tests__regression_insert_conflict.snap:253 -tests/snapshots/tests__regression_interval.snap:2 tests/snapshots/tests__regression_join.snap:20 -tests/snapshots/tests__regression_json.snap:12 -tests/snapshots/tests__regression_jsonb.snap:8 tests/snapshots/tests__regression_largeobject.snap:12 -tests/snapshots/tests__regression_matview.snap:6 +tests/snapshots/tests__regression_matview.snap:5 tests/snapshots/tests__regression_merge.snap:384 tests/snapshots/tests__regression_misc.snap:26 tests/snapshots/tests__regression_misc_functions.snap:9 tests/snapshots/tests__regression_namespace.snap:7 -tests/snapshots/tests__regression_numeric.snap:5 tests/snapshots/tests__regression_numerology.snap:6 tests/snapshots/tests__regression_object_address.snap:14 tests/snapshots/tests__regression_oidjoins.snap:3 tests/snapshots/tests__regression_partition_join.snap:2 tests/snapshots/tests__regression_partition_prune.snap:330 tests/snapshots/tests__regression_plpgsql.snap:590 -tests/snapshots/tests__regression_privileges.snap:111 -tests/snapshots/tests__regression_psql.snap:743 -tests/snapshots/tests__regression_psql_crosstab.snap:115 -tests/snapshots/tests__regression_psql_pipeline.snap:649 +tests/snapshots/tests__regression_privileges.snap:96 tests/snapshots/tests__regression_publication.snap:71 tests/snapshots/tests__regression_rangefuncs.snap:290 tests/snapshots/tests__regression_returning.snap:230 diff --git a/crates/squawk_parser/tests/snapshots/tests__select_casts_ok.snap b/crates/squawk_parser/tests/snapshots/tests__select_casts_ok.snap index 1eb0b1b6..cc55d9b4 100644 --- a/crates/squawk_parser/tests/snapshots/tests__select_casts_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__select_casts_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/select_casts.sql -snapshot_kind: text --- SOURCE_FILE COMMENT "-- type_casts" @@ -1028,6 +1027,24 @@ SOURCE_FILE MONTH_KW "month" SEMICOLON ";" WHITESPACE "\n\n" + SELECT + SELECT_CLAUSE + SELECT_KW "select" + WHITESPACE " " + TARGET_LIST + TARGET + CAST_EXPR + LITERAL + STRING "'10 days'" + COLON_COLON "::" + INTERVAL_TYPE + INTERVAL_KW "interval" + L_PAREN "(" + LITERAL + INT_NUMBER "0" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n\n" SELECT SELECT_CLAUSE SELECT_KW "select" @@ -1337,11 +1354,9 @@ SOURCE_FILE INTERVAL_TYPE INTERVAL_KW "interval" L_PAREN "(" - ARG_LIST - ARG - LITERAL - INT_NUMBER "10" - R_PAREN ")" + LITERAL + INT_NUMBER "10" + R_PAREN ")" SEMICOLON ";" WHITESPACE "\n\n" COMMENT "-- JsonType" diff --git a/crates/squawk_syntax/src/ast/generated/nodes.rs b/crates/squawk_syntax/src/ast/generated/nodes.rs index 631e5a97..19db520f 100644 --- a/crates/squawk_syntax/src/ast/generated/nodes.rs +++ b/crates/squawk_syntax/src/ast/generated/nodes.rs @@ -5576,6 +5576,21 @@ impl NotDeferrableConstraintOption { } } +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct NotIlike { + pub(crate) syntax: SyntaxNode, +} +impl NotIlike { + #[inline] + pub fn ilike_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::ILIKE_KW) + } + #[inline] + pub fn not_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::NOT_KW) + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct NotIn { pub(crate) syntax: SyntaxNode, @@ -5815,6 +5830,10 @@ impl Op { support::child(&self.syntax) } #[inline] + pub fn not_ilike(&self) -> Option { + support::child(&self.syntax) + } + #[inline] pub fn not_in(&self) -> Option { support::child(&self.syntax) } @@ -5875,6 +5894,10 @@ impl Op { support::token(&self.syntax, SyntaxKind::COLLATE_KW) } #[inline] + pub fn ilike_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::ILIKE_KW) + } + #[inline] pub fn in_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::IN_KW) } @@ -13368,6 +13391,24 @@ impl AstNode for NotDeferrableConstraintOption { &self.syntax } } +impl AstNode for NotIlike { + #[inline] + fn can_cast(kind: SyntaxKind) -> bool { + kind == SyntaxKind::NOT_ILIKE + } + #[inline] + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + #[inline] + fn syntax(&self) -> &SyntaxNode { + &self.syntax + } +} impl AstNode for NotIn { #[inline] fn can_cast(kind: SyntaxKind) -> bool { diff --git a/crates/squawk_syntax/src/postgresql.ungram b/crates/squawk_syntax/src/postgresql.ungram index cd4a90f5..367a26d9 100644 --- a/crates/squawk_syntax/src/postgresql.ungram +++ b/crates/squawk_syntax/src/postgresql.ungram @@ -116,6 +116,8 @@ Lteq = NotLike = 'not' 'like' +NotIlike = + 'not' 'ilike' CustomOp = ('+' | '-' | '*' | '/' | '<' | '>' | '=' | '~' | '!' | '@' | '#' | '%' | '^' | '&' | '|' | '`' | '?') @@ -151,7 +153,7 @@ IsNot = 'is' 'not' Op = -'or' | Gteq | '<' | '>' | FatArrow | '=' | 'in' | Neqb | Lteq | '+' | 'overlaps' | 'like' | NotLike | NotIn | CustomOp | IsDistinctFrom | IsNotDistinctFrom | OperatorCall | 'is' | '^' | '%' | 'and' | '/' | Neq | 'collate' | '-' | ColonEq | ColonColon | 'value' | ':' | IsNot | SimilarTo | AtTimeZone +'or' | Gteq | '<' | '>' | FatArrow | '=' | 'in' | Neqb | Lteq | '+' | 'overlaps' | 'like' | 'ilike' | NotLike | NotIlike | NotIn | CustomOp | IsDistinctFrom | IsNotDistinctFrom | OperatorCall | 'is' | '^' | '%' | 'and' | '/' | Neq | 'collate' | '-' | ColonEq | ColonColon | 'value' | ':' | IsNot | SimilarTo | AtTimeZone BinExpr = lhs:Expr Op rhs:Expr diff --git a/crates/xtask/src/download_regression_tests.rs b/crates/xtask/src/download_regression_tests.rs index 7df6b247..cc26832f 100644 --- a/crates/xtask/src/download_regression_tests.rs +++ b/crates/xtask/src/download_regression_tests.rs @@ -22,6 +22,10 @@ pub(crate) fn download_regression_tests() -> Result<()> { for (index, url) in urls.iter().enumerate() { let filename = url.split('/').last().unwrap(); + if filename.contains("psql") { + // skipping this for now, we don't support psql + continue; + } let filepath = target_dir.join(filename); println!(