diff --git a/PLAN.md b/PLAN.md index c75b0de..f18f9d9 100644 --- a/PLAN.md +++ b/PLAN.md @@ -392,15 +392,18 @@ gate; the corpus harness exists before the first line of the lexer. 5. **DML.** ✅ *Landed 2026-08-16.* `INSERT` (`ON CONFLICT`, `OVERRIDING`), `UPDATE`, `DELETE`, `MERGE`, `RETURNING`, `COPY`, `PREPARE`/`EXECUTE`, cursors. See "As-built notes (milestone 5)". -6. **DDL, part 1.** `CREATE`/`ALTER TABLE` (the second-biggest grammar - region: constraints, partitioning, identity, storage options), - `CREATE INDEX`, views, sequences, schemas. -7. **DDL, part 2 + utility.** The long tail of ~150 statement types: - functions/procedures, triggers, policies, roles/grants, types/domains, - FDWs, publications/subscriptions, `EXPLAIN`/`VACUUM`/`SET`/`SHOW`, event - triggers, … `SplitWithParser` and `IsUtilityStmt` fall out here. +6. **DDL, part 1.** ✅ *Landed 2026-08-16.* `CREATE`/`ALTER TABLE` (the + second-biggest grammar region: constraints, partitioning, identity, + storage options), `CREATE INDEX`, views, sequences, schemas. See + "As-built notes (milestones 6–7)". +7. **DDL, part 2 + utility.** ✅ *Landed 2026-08-16.* The long tail of ~150 + statement types: functions/procedures, triggers, policies, roles/grants, + types/domains, FDWs, publications/subscriptions, + `EXPLAIN`/`VACUUM`/`SET`/`SHOW`, event triggers, … `SplitWithParser` and + `IsUtilityStmt` ship here. **Gate for 4–7:** 100% of the regress corpus — trees, JSON bytes, error - messages, cursor positions. + messages, cursor positions — met: the parse suite's todo list is empty + (42,970 cases across every tier), as are scan and both split suites. 8. **Normalize + Fingerprint.** Port `pg_query_normalize.c` (constant locations → `$n`, `NormalizeUtility`); generated fingerprint walk + the hand-written special cases. **Gate:** all normalize/fingerprint goldens, @@ -555,6 +558,46 @@ Measured at the pin, where the plan's estimates differ: and the `-summary` classifier shows no tree or error mismatches against any implemented statement. +### As-built notes (milestones 6–7) + +- Statement dispatch is a family of lookahead routers + (`internal/parse/ddl_dispatch.go`, `ddl_alter_generic.go`): each + CREATE/ALTER/DROP object-kind arm parses the object reference once, then + the following token picks the production, mirroring how the LALR tables + keep RenameStmt/AlterObjectSchemaStmt/AlterOwnerStmt/ + AlterObjectDependsStmt alive alongside each object's own ALTER statement. + A shared `parseAlterGenericTail` implements the four generic tails with a + per-kind support mask, so `ALTER LANGUAGE x SET SCHEMA` still fails at + the token bison would reject. +- The CreateStmt/CreateAsStmt ambiguity (`CREATE TABLE t (…)` element list + vs. `create_as_target` column list) is the one new bounded-backtracking + site: the CTAS reading is tried first and commits only when its `AS` + arrives, else the position resets and the element list parses. +- C's zero-valued enums surface as their proto-shifted spellings, which the + goldens made explicit: every `AlterTableCmd`/`RenameStmt` carries + `behavior: DROP_RESTRICT`, `RenameStmt.relationType` defaults to + `OBJECT_ACCESS_METHOD`, and `AlterPublicationStmt.action` to + `AP_AddObjects`. Two NIL-vs-empty-list shapes matter: the zero-argument + `(*)` aggregate stores a null list element in `DefineStmt.args`, and an + empty `BEGIN ATOMIC` body stores `[NIL]`, not `[[]]`. +- Support-function ereports carry their C call site's funcname + (`processCASbits`, `SplitColQualList`, `makeOrderedSetArgs`, + `preprocess_pubobj_list`, …), and `ConstraintAttributeSpec`'s own + location is always -1 (PG's `YYLLOC_DEFAULT` gives empty productions -1 + and the left recursion propagates it), so `processCASbits` errors have no + cursor position. +- The `base_yylex`-merged `*_LA` tokens keep their first word's keyword + classification in the lexer but are never identifiers in the grammar; the + identifier-class helpers reject them (found via `nulls first` in + `index_elem`, where `NULLS_LA` must not parse as an opclass name). +- `makeRangeVarFromAnyName` builds via `makeNode`, so `inh` stays false — + unlike `makeRangeVar`'s true — which the CompositeTypeStmt goldens pin. +- `cmd/difftodo` (debug aid) prints input/want/got for a file's remaining + parse todos; it drove the long-tail mismatch hunt to zero. +- Corpus effect: all 19,787 remaining parse todos graduated, plus the 8 + `split_parser` cases. The remaining todo suites (deparse, fingerprint, + normalize, normalize_utility) belong to milestones 8–9. + ## Regeneration (the PostgreSQL-upgrade story) Everything derived is derived by committed tooling from the pin: diff --git a/cmd/difftodo/main.go b/cmd/difftodo/main.go new file mode 100644 index 0000000..a7799b4 --- /dev/null +++ b/cmd/difftodo/main.go @@ -0,0 +1,64 @@ +// difftodo prints input, expected, and actual output for the still-failing +// todo cases of parse-suite .test files. Debug aid for the corpus loop; not +// part of the public tooling. +package main + +import ( + "errors" + "fmt" + "os" + "strconv" + + pg_query "github.com/sqlc-dev/oliphant" + "github.com/sqlc-dev/oliphant/internal/testfile" + "github.com/sqlc-dev/oliphant/parser" +) + +func main() { + path := os.Args[1] + limit := 5 + if len(os.Args) > 2 { + limit, _ = strconv.Atoi(os.Args[2]) + } + cases, err := testfile.Read(path) + if err != nil { + panic(err) + } + meta, err := testfile.ReadMetadata(path) + if err != nil { + panic(err) + } + todo := map[string]bool{} + for _, name := range meta.Todo { + todo[name] = true + } + shown := 0 + for _, c := range cases { + if !todo[c.Name] { + continue + } + got, perr := pg_query.ParseToJSON(c.Input) + if perr != nil { + var pe *parser.Error + if errors.As(perr, &pe) { + got = testfile.RenderError(testfile.ErrorExpectation{ + Message: pe.Message, + Cursorpos: pe.Cursorpos, + Filename: pe.Filename, + Funcname: pe.Funcname, + Context: pe.Context, + }) + } else { + got = "UNIMPLEMENTED: " + perr.Error() + } + } + if got == c.Expected { + continue + } + fmt.Printf("== %s\nINPUT: %s\nWANT: %s\nGOT: %s\n\n", c.Name, c.Input, c.Expected, got) + shown++ + if shown >= limit { + break + } + } +} diff --git a/compat_test.go b/compat_test.go index 681a7ab..517d9c8 100644 --- a/compat_test.go +++ b/compat_test.go @@ -43,10 +43,6 @@ func TestNotImplementedErrors(t *testing.T) { check("Fingerprint", err) _, err = pg_query.FingerprintToUInt64("SELECT 1") check("FingerprintToUInt64", err) - _, err = pg_query.SplitWithParser("SELECT 1", false) - check("SplitWithParser", err) - _, err = pg_query.IsUtilityStmt("SELECT 1") - check("IsUtilityStmt", err) _, err = pg_query.ParsePlPgSqlToJSON("SELECT 1") check("ParsePlPgSqlToJSON", err) _, err = pg_query.Summary("SELECT 1", 0) @@ -90,6 +86,35 @@ func TestScanTokens(t *testing.T) { } } +// TestSplitWithParser mirrors pg_query_go's parser-based split tests. +func TestSplitWithParser(t *testing.T) { + stmts, err := pg_query.SplitWithParser("CREATE RULE x AS ON SELECT TO tbl DO (SELECT 1; SELECT 2); SELECT 3", true) + if err != nil { + t.Fatal(err) + } + want := []string{"CREATE RULE x AS ON SELECT TO tbl DO (SELECT 1; SELECT 2)", "SELECT 3"} + if len(stmts) != len(want) || stmts[0] != want[0] || stmts[1] != want[1] { + t.Fatalf("SplitWithParser = %q, want %q", stmts, want) + } +} + +// TestIsUtilityStmt pins the statement classification split. +func TestIsUtilityStmt(t *testing.T) { + got, err := pg_query.IsUtilityStmt("SELECT 1; VACUUM; INSERT INTO t VALUES (1); CREATE TABLE t (a int)") + if err != nil { + t.Fatal(err) + } + want := []bool{false, true, false, true} + if len(got) != len(want) { + t.Fatalf("IsUtilityStmt returned %d results, want %d", len(got), len(want)) + } + for i := range want { + if got[i] != want[i] { + t.Errorf("IsUtilityStmt[%d] = %v, want %v", i, got[i], want[i]) + } + } +} + // TestSplitWithScanner mirrors pg_query_go's scanner-based split tests. func TestSplitWithScanner(t *testing.T) { stmts, err := pg_query.SplitWithScanner("SELECT /* comment with ; */ 1; SELECT 2", true) diff --git a/internal/parse/ddl_alter_generic.go b/internal/parse/ddl_alter_generic.go new file mode 100644 index 0000000..c5a51b9 --- /dev/null +++ b/internal/parse/ddl_alter_generic.go @@ -0,0 +1,974 @@ +package parse + +// The unified ALTER dispatcher: RenameStmt, AlterObjectSchemaStmt, +// AlterOwnerStmt, AlterObjectDependsStmt, and the object-specific ALTER +// statements that share their prefixes (AlterOperatorStmt, AlterTypeStmt, +// AlterCollationStmt, AlterSystemStmt, AlterTblSpcStmt, AlterStatsStmt, +// AlterDomainStmt, AlterDatabase*Stmt, AlterEventTrigStmt). Each ALTER +// arm parses the object reference once and picks the statement +// from the following token, exactly as the LALR tables do. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +// newRenameStmt builds a RenameStmt with C's zero-valued defaults +// (relationType OBJECT_ACCESS_METHOD and behavior DROP_RESTRICT are the +// proto spellings of C zero). +func newRenameStmt(t ast.ObjectType) *ast.RenameStmt { + return &ast.RenameStmt{ + RenameType: t, + RelationType: ast.ObjectType_OBJECT_ACCESS_METHOD, + Behavior: ast.DropBehavior_DROP_RESTRICT, + } +} + +func nRenameStmt(n *ast.RenameStmt) *ast.Node { + return &ast.Node{Node: &ast.Node_RenameStmt{RenameStmt: n}} +} + +func nAlterObjectSchemaStmt(n *ast.AlterObjectSchemaStmt) *ast.Node { + return &ast.Node{Node: &ast.Node_AlterObjectSchemaStmt{AlterObjectSchemaStmt: n}} +} + +func nAlterOwnerStmt(n *ast.AlterOwnerStmt) *ast.Node { + return &ast.Node{Node: &ast.Node_AlterOwnerStmt{AlterOwnerStmt: n}} +} + +// alterTail flags which generic ALTER tails an object kind supports. +type alterTail int + +const ( + tailRename alterTail = 1 << iota + tailSchema + tailOwner + tailDepends +) + +// parseAlterGenericTail parses RENAME TO / SET SCHEMA / OWNER TO / +// [NO] DEPENDS ON EXTENSION for an object addressed by a Node (object) or +// relation, returning nil if the lookahead is none of the supported tails. +func (p *parser) parseAlterGenericTail(t ast.ObjectType, object *ast.Node, rel *ast.RangeVar, missingOk bool, tails alterTail) *ast.Node { + switch p.kind() { + case ast.Token_RENAME: + if tails&tailRename == 0 { + return nil + } + p.next() + p.expect(ast.Token_TO) + n := newRenameStmt(t) + n.Object = object + n.Relation = rel + n.MissingOk = missingOk + n.Newname = p.name() + return nRenameStmt(n) + case ast.Token_SET: + if tails&tailSchema == 0 || p.kindN(1) != ast.Token_SCHEMA { + return nil + } + p.next() + p.next() + n := &ast.AlterObjectSchemaStmt{ + ObjectType: t, + Object: object, + Relation: rel, + MissingOk: missingOk, + Newschema: p.name(), + } + return nAlterObjectSchemaStmt(n) + case ast.Token_OWNER: + if tails&tailOwner == 0 { + return nil + } + p.next() + p.expect(ast.Token_TO) + n := &ast.AlterOwnerStmt{ + ObjectType: t, + Object: object, + Relation: rel, + Newowner: p.parseRoleSpec(), + } + return nAlterOwnerStmt(n) + case ast.Token_DEPENDS, ast.Token_NO: + if tails&tailDepends == 0 { + return nil + } + if p.kind() == ast.Token_NO && p.kindN(1) != ast.Token_DEPENDS { + return nil + } + n := &ast.AlterObjectDependsStmt{ + ObjectType: t, + Object: object, + Relation: rel, + Remove: p.have(ast.Token_NO), + } + p.expect(ast.Token_DEPENDS) + p.expect(ast.Token_ON) + p.expect(ast.Token_EXTENSION) + n.Extname = &ast.String{Sval: p.name()} + return &ast.Node{Node: &ast.Node_AlterObjectDependsStmt{AlterObjectDependsStmt: n}} + } + return nil +} + +// roleSpecToRoleId applies gram.y's RoleId restrictions to a parsed +// RoleSpec. +func (p *parser) roleSpecToRoleId(spec *ast.RoleSpec, loc int32) string { + switch spec.Roletype { + case ast.RoleSpecType_ROLESPEC_CSTRING: + return spec.Rolename + case ast.RoleSpecType_ROLESPEC_PUBLIC: + p.ereport("base_yyparse", `role name "public" is reserved`, loc) + case ast.RoleSpecType_ROLESPEC_SESSION_USER: + p.ereport("base_yyparse", "SESSION_USER cannot be used as a role name here", loc) + case ast.RoleSpecType_ROLESPEC_CURRENT_USER: + p.ereport("base_yyparse", "CURRENT_USER cannot be used as a role name here", loc) + case ast.RoleSpecType_ROLESPEC_CURRENT_ROLE: + p.ereport("base_yyparse", "CURRENT_ROLE cannot be used as a role name here", loc) + } + return "" +} + +// parseAlterDispatch routes a statement beginning with ALTER. The ALTER +// token is not yet consumed. +func (p *parser) parseAlterDispatch() *ast.Node { + alterTok := p.expect(ast.Token_ALTER) + switch p.kind() { + case ast.Token_PUBLICATION: + p.next() + pubname := p.name() + switch p.kind() { + case ast.Token_RENAME, ast.Token_OWNER: + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_PUBLICATION, nStr(pubname), nil, false, + tailRename|tailOwner); n != nil { + if r := n.GetRenameStmt(); r != nil { + r.Object = nStr(pubname) + } + return n + } + p.syntaxErrorAt() + } + return p.parseAlterPublicationStmt(pubname) + + case ast.Token_SUBSCRIPTION: + p.next() + subname := p.name() + switch p.kind() { + case ast.Token_RENAME, ast.Token_OWNER: + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_SUBSCRIPTION, nStr(subname), nil, false, + tailRename|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + } + return p.parseAlterSubscriptionStmt(subname, alterTok.Start) + case ast.Token_AGGREGATE: + p.next() + obj := p.parseAggregateWithArgtypes() + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_AGGREGATE, obj, nil, false, + tailRename|tailSchema|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + + case ast.Token_COLLATION: + p.next() + names := p.anyName() + if p.kind() == ast.Token_REFRESH { + // gram.y: AlterCollationStmt + p.next() + p.expect(ast.Token_VERSION_P) + return &ast.Node{Node: &ast.Node_AlterCollationStmt{AlterCollationStmt: &ast.AlterCollationStmt{ + Collname: names, + }}} + } + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_COLLATION, nList(names), nil, false, + tailRename|tailSchema|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + + case ast.Token_CONVERSION_P: + p.next() + obj := nList(p.anyName()) + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_CONVERSION, obj, nil, false, + tailRename|tailSchema|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + + case ast.Token_DATABASE: + p.next() + dbname := p.name() + switch p.kind() { + case ast.Token_RENAME: + p.next() + p.expect(ast.Token_TO) + n := newRenameStmt(ast.ObjectType_OBJECT_DATABASE) + n.Subname = dbname + n.Newname = p.name() + return nRenameStmt(n) + case ast.Token_OWNER: + p.next() + p.expect(ast.Token_TO) + return nAlterOwnerStmt(&ast.AlterOwnerStmt{ + ObjectType: ast.ObjectType_OBJECT_DATABASE, + Object: nStr(dbname), + Newowner: p.parseRoleSpec(), + }) + case ast.Token_REFRESH: + p.next() + p.expect(ast.Token_COLLATION) + p.expect(ast.Token_VERSION_P) + return &ast.Node{Node: &ast.Node_AlterDatabaseRefreshCollStmt{ + AlterDatabaseRefreshCollStmt: &ast.AlterDatabaseRefreshCollStmt{Dbname: dbname}, + }} + case ast.Token_SET: + if p.kindN(1) == ast.Token_TABLESPACE { + p.next() + p.next() + ntok := p.peek() + return &ast.Node{Node: &ast.Node_AlterDatabaseStmt{AlterDatabaseStmt: &ast.AlterDatabaseStmt{ + Dbname: dbname, + Options: []*ast.Node{makeDefElem("tablespace", nStr(p.name()), ntok.Start)}, + }}} + } + fallthrough + case ast.Token_RESET: + // gram.y: AlterDatabaseSetStmt + return &ast.Node{Node: &ast.Node_AlterDatabaseSetStmt{AlterDatabaseSetStmt: &ast.AlterDatabaseSetStmt{ + Dbname: dbname, + Setstmt: p.parseSetResetClause(), + }}} + default: + // gram.y: AlterDatabaseStmt: [WITH] createdb_opt_list + n := &ast.AlterDatabaseStmt{Dbname: dbname} + p.parseOptWith() + n.Options = p.parseCreatedbOptItems() + return &ast.Node{Node: &ast.Node_AlterDatabaseStmt{AlterDatabaseStmt: n}} + } + + case ast.Token_DOMAIN_P: + p.next() + names := p.anyName() + switch p.kind() { + case ast.Token_RENAME: + if p.kindN(1) == ast.Token_CONSTRAINT { + p.next() + p.next() + n := newRenameStmt(ast.ObjectType_OBJECT_DOMCONSTRAINT) + n.Object = nList(names) + n.Subname = p.name() + p.expect(ast.Token_TO) + n.Newname = p.name() + return nRenameStmt(n) + } + case ast.Token_SET: + // SET SCHEMA is generic; SET DEFAULT / SET NOT NULL are + // AlterDomainStmt. + if p.kindN(1) != ast.Token_SCHEMA { + return p.parseAlterDomainStmt(names) + } + case ast.Token_DROP, ast.Token_ADD_P, ast.Token_VALIDATE: + return p.parseAlterDomainStmt(names) + } + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_DOMAIN, nList(names), nil, false, + tailRename|tailSchema|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + + case ast.Token_EXTENSION: + p.next() + return p.parseAlterExtensionStmt() + + case ast.Token_DEFAULT: + if p.kindN(1) == ast.Token_PRIVILEGES { + p.next() + p.next() + return p.parseAlterDefaultPrivilegesStmt() + } + + case ast.Token_POLICY: + p.next() + missingOk := false + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + missingOk = true + } + name := p.name() + p.expect(ast.Token_ON) + rel := p.parseQualifiedName() + if p.kind() == ast.Token_RENAME { + p.next() + p.expect(ast.Token_TO) + r := newRenameStmt(ast.ObjectType_OBJECT_POLICY) + r.Relation = rel + r.Subname = name + r.MissingOk = missingOk + r.Newname = p.name() + return nRenameStmt(r) + } + if missingOk { + // Only the RENAME form allows IF EXISTS. + p.syntaxErrorAt() + } + return p.parseAlterPolicyStmt(name, rel) + + case ast.Token_FUNCTION, ast.Token_PROCEDURE, ast.Token_ROUTINE: + var objtype ast.ObjectType + switch p.next().Kind { + case ast.Token_FUNCTION: + objtype = ast.ObjectType_OBJECT_FUNCTION + case ast.Token_PROCEDURE: + objtype = ast.ObjectType_OBJECT_PROCEDURE + default: + objtype = ast.ObjectType_OBJECT_ROUTINE + } + obj := p.parseFunctionWithArgtypes() + if n := p.parseAlterGenericTail(objtype, obj, nil, false, + tailRename|tailSchema|tailOwner|tailDepends); n != nil { + return n + } + return p.parseAlterFunctionStmt(objtype, obj.GetObjectWithArgs()) + + case ast.Token_GROUP_P: + p.next() + stok := p.peek() + spec := p.parseRoleSpec() + if p.kind() == ast.Token_RENAME { + p.next() + p.expect(ast.Token_TO) + n := newRenameStmt(ast.ObjectType_OBJECT_ROLE) + n.Subname = p.roleSpecToRoleId(spec, stok.Start) + rtok := p.peek() + n.Newname = p.roleSpecToRoleId(p.parseRoleSpec(), rtok.Start) + return nRenameStmt(n) + } + return p.parseAlterGroupStmtRest(spec) + + case ast.Token_PROCEDURAL: + if p.kindN(1) != ast.Token_LANGUAGE { + break + } + p.next() + fallthrough + case ast.Token_LANGUAGE: + p.next() + obj := nStr(p.name()) + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_LANGUAGE, obj, nil, false, + tailRename|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + + case ast.Token_LARGE_P: + p.next() + p.expect(ast.Token_OBJECT_P) + obj := p.parseNumericOnly() + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_LARGEOBJECT, obj, nil, false, + tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + + case ast.Token_OPERATOR: + p.next() + switch p.kind() { + case ast.Token_CLASS, ast.Token_FAMILY: + isFamily := p.next().Kind == ast.Token_FAMILY + objtype := ast.ObjectType_OBJECT_OPCLASS + if isFamily { + objtype = ast.ObjectType_OBJECT_OPFAMILY + } + names := p.anyName() + p.expect(ast.Token_USING) + amname := p.name() + obj := nList(append([]*ast.Node{nStr(amname)}, names...)) + if isFamily { + switch p.kind() { + case ast.Token_ADD_P, ast.Token_DROP: + return p.parseAlterOpFamilyStmtImpl(names, amname) + } + } + if n := p.parseAlterGenericTail(objtype, obj, nil, false, + tailRename|tailSchema|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + } + obj := p.parseOperatorWithArgtypes() + if p.kind() == ast.Token_SET && p.kindN(1) == ast.Token('(') { + // gram.y: AlterOperatorStmt + p.next() + p.next() + n := &ast.AlterOperatorStmt{Opername: obj.GetObjectWithArgs()} + n.Options = p.parseOperatorDefList() + p.expect(ast.Token(')')) + return &ast.Node{Node: &ast.Node_AlterOperatorStmt{AlterOperatorStmt: n}} + } + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_OPERATOR, obj, nil, false, + tailSchema|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + + case ast.Token_ROLE, ast.Token_USER: + if p.kindN(1) == ast.Token_MAPPING { + p.next() + p.next() + return p.parseAlterUserMappingStmt() + } + p.next() + if p.kind() == ast.Token_ALL { + p.next() + n := &ast.AlterRoleSetStmt{} + if p.have(ast.Token_IN_P) { + p.expect(ast.Token_DATABASE) + n.Database = p.name() + } + n.Setstmt = p.parseSetResetClause() + return &ast.Node{Node: &ast.Node_AlterRoleSetStmt{AlterRoleSetStmt: n}} + } + stok := p.peek() + spec := p.parseRoleSpec() + if p.kind() == ast.Token_RENAME { + p.next() + p.expect(ast.Token_TO) + n := newRenameStmt(ast.ObjectType_OBJECT_ROLE) + n.Subname = p.roleSpecToRoleId(spec, stok.Start) + rtok := p.peek() + n.Newname = p.roleSpecToRoleId(p.parseRoleSpec(), rtok.Start) + return nRenameStmt(n) + } + return p.parseAlterRoleStmtRest(spec) + + case ast.Token_RULE: + p.next() + subname := p.name() + p.expect(ast.Token_ON) + rel := p.parseQualifiedName() + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_RULE, nil, rel, false, + tailRename); n != nil { + n.GetRenameStmt().Subname = subname + return n + } + p.syntaxErrorAt() + + case ast.Token_TRIGGER: + p.next() + subname := p.name() + p.expect(ast.Token_ON) + rel := p.parseQualifiedName() + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_TRIGGER, nil, rel, false, + tailRename|tailDepends); n != nil { + if r := n.GetRenameStmt(); r != nil { + r.Subname = subname + } else { + n.GetAlterObjectDependsStmt().Object = nList([]*ast.Node{nStr(subname)}) + } + return n + } + p.syntaxErrorAt() + + case ast.Token_EVENT: + if p.kindN(1) != ast.Token_TRIGGER { + break + } + p.next() + p.next() + name := p.name() + switch p.kind() { + case ast.Token_ENABLE_P: + // gram.y: AlterEventTrigStmt / enable_trigger + p.next() + n := &ast.AlterEventTrigStmt{Trigname: name, Tgenabled: "O"} + switch p.kind() { + case ast.Token_REPLICA: + p.next() + n.Tgenabled = "R" + case ast.Token_ALWAYS: + p.next() + n.Tgenabled = "A" + } + return &ast.Node{Node: &ast.Node_AlterEventTrigStmt{AlterEventTrigStmt: n}} + case ast.Token_DISABLE_P: + p.next() + return &ast.Node{Node: &ast.Node_AlterEventTrigStmt{AlterEventTrigStmt: &ast.AlterEventTrigStmt{ + Trigname: name, Tgenabled: "D", + }}} + } + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_EVENT_TRIGGER, nStr(name), nil, false, + tailRename|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + + case ast.Token_SERVER: + p.next() + name := p.name() + switch p.kind() { + case ast.Token_RENAME, ast.Token_OWNER: + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_FOREIGN_SERVER, nStr(name), nil, false, + tailRename|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + } + return p.parseAlterForeignServerStmt(name) + + case ast.Token_SCHEMA: + p.next() + obj := nStr(p.name()) + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_SCHEMA, nil, nil, false, + tailRename|tailOwner); n != nil { + // object_type_name statements carry the name as subname for + // RENAME and as object for OWNER. + if r := n.GetRenameStmt(); r != nil { + r.Subname = asString(obj).Sval + } else { + n.GetAlterOwnerStmt().Object = obj + } + return n + } + p.syntaxErrorAt() + + case ast.Token_STATISTICS: + p.next() + missingOk := false + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + missingOk = true + } + names := p.anyName() + if p.kind() == ast.Token_SET && p.kindN(1) == ast.Token_STATISTICS { + // gram.y: AlterStatsStmt + p.next() + p.next() + return &ast.Node{Node: &ast.Node_AlterStatsStmt{AlterStatsStmt: &ast.AlterStatsStmt{ + Defnames: names, + MissingOk: missingOk, + Stxstattarget: p.parseSetStatisticsValue(), + }}} + } + if !missingOk { + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_STATISTIC_EXT, nList(names), nil, false, + tailRename|tailSchema|tailOwner); n != nil { + return n + } + } + p.syntaxErrorAt() + + case ast.Token_SYSTEM_P: + // gram.y: AlterSystemStmt + p.next() + n := &ast.AlterSystemStmt{} + switch { + case p.have(ast.Token_SET): + n.Setstmt = p.parseGenericSet() + case p.have(ast.Token_RESET): + n.Setstmt = &ast.VariableSetStmt{Kind: ast.VariableSetKind_VAR_RESET} + if p.have(ast.Token_ALL) { + n.Setstmt.Kind = ast.VariableSetKind_VAR_RESET_ALL + } else { + n.Setstmt.Name = p.parseVarName() + } + default: + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_AlterSystemStmt{AlterSystemStmt: n}} + + case ast.Token_TABLESPACE: + p.next() + name := p.name() + switch p.kind() { + case ast.Token_SET, ast.Token_RESET: + // gram.y: AlterTblSpcStmt + isReset := p.next().Kind == ast.Token_RESET + n := &ast.AlterTableSpaceOptionsStmt{ + Tablespacename: name, + IsReset: isReset, + } + n.Options = p.parseReloptions() + return &ast.Node{Node: &ast.Node_AlterTableSpaceOptionsStmt{AlterTableSpaceOptionsStmt: n}} + case ast.Token_RENAME: + p.next() + p.expect(ast.Token_TO) + n := newRenameStmt(ast.ObjectType_OBJECT_TABLESPACE) + n.Subname = name + n.Newname = p.name() + return nRenameStmt(n) + case ast.Token_OWNER: + p.next() + p.expect(ast.Token_TO) + return nAlterOwnerStmt(&ast.AlterOwnerStmt{ + ObjectType: ast.ObjectType_OBJECT_TABLESPACE, + Object: nStr(name), + Newowner: p.parseRoleSpec(), + }) + } + p.syntaxErrorAt() + + case ast.Token_TEXT_P: + if p.kindN(1) != ast.Token_SEARCH { + break + } + p.next() + p.next() + var objtype ast.ObjectType + var tails alterTail + kindTok := p.next() + switch kindTok.Kind { + case ast.Token_PARSER: + objtype, tails = ast.ObjectType_OBJECT_TSPARSER, tailRename|tailSchema + case ast.Token_DICTIONARY: + objtype, tails = ast.ObjectType_OBJECT_TSDICTIONARY, tailRename|tailSchema|tailOwner + case ast.Token_TEMPLATE: + objtype, tails = ast.ObjectType_OBJECT_TSTEMPLATE, tailRename|tailSchema + case ast.Token_CONFIGURATION: + objtype, tails = ast.ObjectType_OBJECT_TSCONFIGURATION, tailRename|tailSchema|tailOwner + default: + p.syntaxError(kindTok) + } + names := p.anyName() + if objtype == ast.ObjectType_OBJECT_TSDICTIONARY && p.kind() == ast.Token('(') { + // gram.y: AlterTSDictionaryStmt + return &ast.Node{Node: &ast.Node_AlterTsdictionaryStmt{AlterTsdictionaryStmt: &ast.AlterTSDictionaryStmt{ + Dictname: names, + Options: p.parseDefinition(), + }}} + } + if objtype == ast.ObjectType_OBJECT_TSCONFIGURATION { + switch p.kind() { + case ast.Token_ADD_P, ast.Token_ALTER, ast.Token_DROP: + return p.parseAlterTSConfigurationStmt(names) + } + } + if n := p.parseAlterGenericTail(objtype, nList(names), nil, false, tails); n != nil { + return n + } + p.syntaxErrorAt() + + case ast.Token_TYPE_P: + p.next() + return p.parseAlterTypeDispatch() + + case ast.Token_TABLE: + p.next() + return p.parseAlterTableStmt(ast.ObjectType_OBJECT_TABLE, true, true) + case ast.Token_INDEX: + p.next() + return p.parseAlterTableStmt(ast.ObjectType_OBJECT_INDEX, false, true) + case ast.Token_VIEW: + p.next() + return p.parseAlterTableStmt(ast.ObjectType_OBJECT_VIEW, false, false) + case ast.Token_MATERIALIZED: + if p.kindN(1) == ast.Token_VIEW { + p.next() + p.next() + return p.parseAlterTableStmt(ast.ObjectType_OBJECT_MATVIEW, false, true) + } + case ast.Token_FOREIGN: + switch p.kindN(1) { + case ast.Token_TABLE: + p.next() + p.next() + return p.parseAlterTableStmt(ast.ObjectType_OBJECT_FOREIGN_TABLE, true, false) + case ast.Token_DATA_P: + p.next() + p.next() + p.expect(ast.Token_WRAPPER) + name := p.name() + switch p.kind() { + case ast.Token_RENAME, ast.Token_OWNER: + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_FDW, nStr(name), nil, false, + tailRename|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + } + return p.parseAlterFdwStmt(name) + } + + case ast.Token_SEQUENCE: + p.next() + missingOk := false + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + missingOk = true + } + rel := p.parseQualifiedName() + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_SEQUENCE, nil, rel, missingOk, + tailRename|tailSchema); n != nil { + return n + } + if p.seqOptElemStarts() { + n := &ast.AlterSeqStmt{Sequence: rel, MissingOk: missingOk} + n.Options = p.parseSeqOptList() + return &ast.Node{Node: &ast.Node_AlterSeqStmt{AlterSeqStmt: n}} + } + n := &ast.AlterTableStmt{ + Objtype: ast.ObjectType_OBJECT_SEQUENCE, + Relation: rel, + MissingOk: missingOk, + } + n.Cmds = p.parseAlterTableCmds() + return &ast.Node{Node: &ast.Node_AlterTableStmt{AlterTableStmt: n}} + } + p.syntaxErrorAt() + return nil +} + +// parseAlterDomainStmt is gram.y's AlterDomainStmt; ALTER DOMAIN any_name +// consumed. +func (p *parser) parseAlterDomainStmt(names []*ast.Node) *ast.Node { + n := &ast.AlterDomainStmt{ + TypeName: names, + Behavior: ast.DropBehavior_DROP_RESTRICT, + } + switch { + case p.have(ast.Token_SET): + switch { + case p.have(ast.Token_DEFAULT): + n.Subtype = "T" + n.Def = p.parseAExpr(0) + case p.have(ast.Token_NOT): + p.expect(ast.Token_NULL_P) + n.Subtype = "O" + default: + p.syntaxErrorAt() + } + case p.have(ast.Token_DROP): + switch { + case p.have(ast.Token_DEFAULT): + n.Subtype = "T" + case p.have(ast.Token_NOT): + p.expect(ast.Token_NULL_P) + n.Subtype = "N" + case p.have(ast.Token_CONSTRAINT): + n.Subtype = "X" + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + n.MissingOk = true + } + n.Name = p.name() + n.Behavior = p.parseOptDropBehavior() + default: + p.syntaxErrorAt() + } + case p.have(ast.Token_ADD_P): + n.Subtype = "C" + n.Def = p.parseDomainConstraint() + case p.have(ast.Token_VALIDATE): + p.expect(ast.Token_CONSTRAINT) + n.Subtype = "V" + n.Name = p.name() + default: + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_AlterDomainStmt{AlterDomainStmt: n}} +} + +// parseDomainConstraint is gram.y's DomainConstraint. +func (p *parser) parseDomainConstraint() *ast.Node { + tok := p.peek() + if tok.Kind == ast.Token_CONSTRAINT { + p.next() + name := p.name() + c := p.parseDomainConstraintElem() + c.Conname = name + c.Location = tok.Start + return nConstraint(c) + } + return nConstraint(p.parseDomainConstraintElem()) +} + +// parseDomainConstraintElem is gram.y's DomainConstraintElem. +func (p *parser) parseDomainConstraintElem() *ast.Constraint { + tok := p.peek() + n := &ast.Constraint{Location: tok.Start} + switch tok.Kind { + case ast.Token_CHECK: + p.next() + n.Contype = ast.ConstrType_CONSTR_CHECK + p.expect(ast.Token('(')) + n.RawExpr = p.parseAExpr(0) + p.expect(ast.Token(')')) + cas, casLoc := p.parseConstraintAttributeSpec() + p.processCASbits(cas, casLoc, "CHECK", nil, nil, &n.SkipValidation, &n.IsNoInherit) + n.InitiallyValid = !n.SkipValidation + case ast.Token_NOT: + p.next() + p.expect(ast.Token_NULL_P) + n.Contype = ast.ConstrType_CONSTR_NOTNULL + n.Keys = []*ast.Node{nStr("value")} + cas, casLoc := p.parseConstraintAttributeSpec() + p.processCASbits(cas, casLoc, "NOT NULL", nil, nil, nil, &n.IsNoInherit) + n.InitiallyValid = true + default: + p.syntaxErrorAt() + } + return n +} + +// parseCreatedbOptItems is gram.y's createdb_opt_items. +func (p *parser) parseCreatedbOptItems() []*ast.Node { + var list []*ast.Node + for { + tok := p.peek() + var name string + switch tok.Kind { + case ast.Token_IDENT: + p.next() + name = tok.Str + case ast.Token_CONNECTION: + p.next() + p.expect(ast.Token_LIMIT) + name = "connection_limit" + case ast.Token_ENCODING, ast.Token_LOCATION, ast.Token_OWNER, + ast.Token_TABLESPACE, ast.Token_TEMPLATE: + p.next() + name = tok.Str + default: + return list + } + p.have(ast.Token('=')) + var arg *ast.Node + switch p.kind() { + case ast.Token_ICONST, ast.Token_FCONST, ast.Token('+'), ast.Token('-'): + arg = p.parseNumericOnly() + case ast.Token_DEFAULT: + p.next() + default: + arg = nStr(p.parseOptBooleanOrString()) + } + list = append(list, makeDefElem(name, arg, tok.Start)) + } +} + +// parseGenericSet is gram.y's generic_set (used by ALTER SYSTEM SET). +func (p *parser) parseGenericSet() *ast.VariableSetStmt { + name := p.parseVarName() + if !p.have(ast.Token_TO) && !p.have(ast.Token('=')) { + p.syntaxErrorAt() + } + if p.kind() == ast.Token_DEFAULT { + p.next() + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_DEFAULT, + Name: name, + } + } + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_VALUE, + Name: name, + Args: p.parseVarList(), + } +} + +// parseOperatorDefList is gram.y's operator_def_list. +func (p *parser) parseOperatorDefList() []*ast.Node { + list := []*ast.Node{p.parseOperatorDefElem()} + for p.have(ast.Token(',')) { + list = append(list, p.parseOperatorDefElem()) + } + return list +} + +// parseOperatorDefElem is gram.y's operator_def_elem. +func (p *parser) parseOperatorDefElem() *ast.Node { + tok := p.peek() + name := p.colLabel() + if !p.have(ast.Token('=')) { + return makeDefElem(name, nil, tok.Start) + } + if p.have(ast.Token_NONE) { + return makeDefElem(name, nil, tok.Start) + } + return makeDefElem(name, p.parseOperatorDefArg(), tok.Start) +} + +// parseOperatorDefArg is gram.y's operator_def_arg. +func (p *parser) parseOperatorDefArg() *ast.Node { + tok := p.peek() + switch tok.Kind { + case ast.Token_SCONST: + p.next() + return nStr(tok.Str) + case ast.Token_ICONST, ast.Token_FCONST: + return p.parseNumericOnly() + case ast.Token('+'), ast.Token('-'): + if p.kindN(1) == ast.Token_ICONST || p.kindN(1) == ast.Token_FCONST { + return p.parseNumericOnly() + } + return nList(p.parseQualAllOp()) + case ast.Token_Op, ast.Token('*'), ast.Token('/'), ast.Token('%'), + ast.Token('^'), ast.Token('<'), ast.Token('>'), ast.Token('='), + ast.Token_LESS_EQUALS, ast.Token_GREATER_EQUALS, ast.Token_NOT_EQUALS, + ast.Token_OPERATOR: + return nList(p.parseQualAllOp()) + } + if tok.KeywordKind == ast.KeywordKind_RESERVED_KEYWORD { + p.next() + return nStr(tok.Str) + } + return nTypeName(p.parseFuncType()) +} + +// parseAlterTSConfigurationStmt is gram.y's AlterTSConfigurationStmt; +// ALTER TEXT SEARCH CONFIGURATION any_name consumed. +func (p *parser) parseAlterTSConfigurationStmt(names []*ast.Node) *ast.Node { + n := &ast.AlterTSConfigurationStmt{Cfgname: names} + anyWith := func() { + if !p.have(ast.Token_WITH) && !p.have(ast.Token_WITH_LA) { + p.syntaxErrorAt() + } + } + switch { + case p.have(ast.Token_ADD_P): + p.expect(ast.Token_MAPPING) + p.expect(ast.Token_FOR) + n.Kind = ast.AlterTSConfigType_ALTER_TSCONFIG_ADD_MAPPING + n.Tokentype = p.nameList() + anyWith() + n.Dicts = p.parseAnyNameList() + case p.have(ast.Token_ALTER): + p.expect(ast.Token_MAPPING) + switch { + case p.have(ast.Token_FOR): + n.Tokentype = p.nameList() + if p.have(ast.Token_REPLACE) { + n.Kind = ast.AlterTSConfigType_ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN + n.Replace = true + old := nList(p.anyName()) + anyWith() + n.Dicts = []*ast.Node{old, nList(p.anyName())} + } else { + n.Kind = ast.AlterTSConfigType_ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN + n.Override = true + anyWith() + n.Dicts = p.parseAnyNameList() + } + case p.have(ast.Token_REPLACE): + n.Kind = ast.AlterTSConfigType_ALTER_TSCONFIG_REPLACE_DICT + n.Replace = true + old := nList(p.anyName()) + anyWith() + n.Dicts = []*ast.Node{old, nList(p.anyName())} + default: + p.syntaxErrorAt() + } + case p.have(ast.Token_DROP): + p.expect(ast.Token_MAPPING) + n.Kind = ast.AlterTSConfigType_ALTER_TSCONFIG_DROP_MAPPING + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + n.MissingOk = true + } + p.expect(ast.Token_FOR) + n.Tokentype = p.nameList() + default: + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_AlterTsconfigurationStmt{AlterTsconfigurationStmt: n}} +} diff --git a/internal/parse/ddl_altertable.go b/internal/parse/ddl_altertable.go new file mode 100644 index 0000000..bdfce58 --- /dev/null +++ b/internal/parse/ddl_altertable.go @@ -0,0 +1,839 @@ +package parse + +// AlterTableStmt (ALTER TABLE/INDEX/SEQUENCE/VIEW/MATERIALIZED VIEW/FOREIGN +// TABLE), AlterTableMoveAllStmt, AlterCompositeTypeStmt, and the +// alter_table_cmd machinery. + +import ( + "fmt" + + "github.com/sqlc-dev/oliphant/ast" +) + +func nAlterTableCmd(n *ast.AlterTableCmd) *ast.Node { + return &ast.Node{Node: &ast.Node_AlterTableCmd{AlterTableCmd: n}} +} + +func newAlterTableCmd(subtype ast.AlterTableType) *ast.AlterTableCmd { + // makeNode zeroes the C struct; behavior 0 is DROP_RESTRICT. + return &ast.AlterTableCmd{Subtype: subtype, Behavior: ast.DropBehavior_DROP_RESTRICT} +} + +// parseAlterTableStmt parses the AlterTableStmt family. ALTER and the +// object-kind keywords (TABLE / INDEX / SEQUENCE / VIEW / MATERIALIZED +// VIEW / FOREIGN TABLE) are consumed by the dispatcher, which passes the +// objtype; relExpr says whether the target uses relation_expr (TABLE, +// FOREIGN TABLE) or qualified_name. +func (p *parser) parseAlterTableStmt(objtype ast.ObjectType, relExpr, allowMoveAll bool) *ast.Node { + // ALTER TABLE/INDEX/MATERIALIZED VIEW ALL IN TABLESPACE ... + if allowMoveAll && p.kind() == ast.Token_ALL { + p.next() + p.expect(ast.Token_IN_P) + p.expect(ast.Token_TABLESPACE) + n := &ast.AlterTableMoveAllStmt{Objtype: objtype} + n.OrigTablespacename = p.name() + if p.have(ast.Token_OWNED) { + p.expect(ast.Token_BY) + n.Roles = p.parseRoleList() + } + p.expect(ast.Token_SET) + p.expect(ast.Token_TABLESPACE) + n.NewTablespacename = p.name() + n.Nowait = p.have(ast.Token_NOWAIT) + return &ast.Node{Node: &ast.Node_AlterTableMoveAllStmt{AlterTableMoveAllStmt: n}} + } + + n := &ast.AlterTableStmt{Objtype: objtype} + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + n.MissingOk = true + } + if relExpr { + n.Relation = p.parseRelationExpr().GetRangeVar() + } else { + n.Relation = p.parseQualifiedName() + } + + // The RENAME / SET SCHEMA / DEPENDS ON EXTENSION productions share this + // prefix (RenameStmt, AlterObjectSchemaStmt, AlterObjectDependsStmt). + switch p.kind() { + case ast.Token_RENAME: + p.next() + r := newRenameStmt(objtype) + r.Relation = n.Relation + r.MissingOk = n.MissingOk + switch { + case p.have(ast.Token_TO): + r.Newname = p.name() + case objtype == ast.ObjectType_OBJECT_TABLE && p.kind() == ast.Token_CONSTRAINT: + p.next() + r.RenameType = ast.ObjectType_OBJECT_TABCONSTRAINT + r.Subname = p.name() + p.expect(ast.Token_TO) + r.Newname = p.name() + default: + // RENAME [COLUMN] name TO name (not available for INDEX or + // SEQUENCE). + if objtype == ast.ObjectType_OBJECT_INDEX || + objtype == ast.ObjectType_OBJECT_SEQUENCE { + p.syntaxErrorAt() + } + p.have(ast.Token_COLUMN) + r.RenameType = ast.ObjectType_OBJECT_COLUMN + r.RelationType = objtype + r.Subname = p.name() + p.expect(ast.Token_TO) + r.Newname = p.name() + } + return nRenameStmt(r) + case ast.Token_SET: + if p.kindN(1) == ast.Token_SCHEMA && objtype != ast.ObjectType_OBJECT_INDEX { + p.next() + p.next() + return nAlterObjectSchemaStmt(&ast.AlterObjectSchemaStmt{ + ObjectType: objtype, + Relation: n.Relation, + MissingOk: n.MissingOk, + Newschema: p.name(), + }) + } + case ast.Token_DEPENDS, ast.Token_NO: + if objtype == ast.ObjectType_OBJECT_INDEX || objtype == ast.ObjectType_OBJECT_MATVIEW { + if d := p.parseAlterGenericTail(objtype, nil, n.Relation, false, tailDepends); d != nil { + return d + } + } + } + n.Cmds = p.parseAlterTableCmds() + return &ast.Node{Node: &ast.Node_AlterTableStmt{AlterTableStmt: n}} +} + +// parseAlterTableCmds is gram.y's alter_table_cmds, plus the partition_cmd +// and index_partition_cmd singletons (ATTACH/DETACH PARTITION). +func (p *parser) parseAlterTableCmds() []*ast.Node { + list := []*ast.Node{p.parseAlterTableCmd()} + for p.have(ast.Token(',')) { + list = append(list, p.parseAlterTableCmd()) + } + return list +} + +// parseAlterTableCmd is gram.y's alter_table_cmd / partition_cmd / +// index_partition_cmd. +func (p *parser) parseAlterTableCmd() *ast.Node { + tok := p.peek() + switch tok.Kind { + case ast.Token_ATTACH: + // partition_cmd: ATTACH PARTITION qualified_name [PartitionBoundSpec] + p.next() + p.expect(ast.Token_PARTITION) + n := newAlterTableCmd(ast.AlterTableType_AT_AttachPartition) + cmd := &ast.PartitionCmd{Name: p.parseQualifiedName()} + switch p.kind() { + case ast.Token_FOR, ast.Token_DEFAULT: + cmd.Bound = p.parsePartitionBoundSpec() + } + n.Def = &ast.Node{Node: &ast.Node_PartitionCmd{PartitionCmd: cmd}} + return nAlterTableCmd(n) + + case ast.Token_DETACH: + p.next() + p.expect(ast.Token_PARTITION) + cmd := &ast.PartitionCmd{Name: p.parseQualifiedName()} + subtype := ast.AlterTableType_AT_DetachPartition + if p.have(ast.Token_FINALIZE) { + subtype = ast.AlterTableType_AT_DetachPartitionFinalize + } else { + cmd.Concurrent = p.have(ast.Token_CONCURRENTLY) + } + n := newAlterTableCmd(subtype) + n.Def = &ast.Node{Node: &ast.Node_PartitionCmd{PartitionCmd: cmd}} + return nAlterTableCmd(n) + + case ast.Token_ADD_P: + p.next() + switch p.kind() { + case ast.Token_CONSTRAINT, ast.Token_CHECK, ast.Token_UNIQUE, + ast.Token_PRIMARY, ast.Token_EXCLUDE, ast.Token_FOREIGN: + n := newAlterTableCmd(ast.AlterTableType_AT_AddConstraint) + n.Def = p.parseTableConstraint() + return nAlterTableCmd(n) + case ast.Token_COLUMN: + p.next() + } + n := newAlterTableCmd(ast.AlterTableType_AT_AddColumn) + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + n.MissingOk = true + } + n.Def = p.parseColumnDef() + return nAlterTableCmd(n) + + case ast.Token_ALTER: + p.next() + if p.kind() == ast.Token_CONSTRAINT { + // ALTER CONSTRAINT name ConstraintAttributeSpec + p.next() + n := newAlterTableCmd(ast.AlterTableType_AT_AlterConstraint) + c := &ast.Constraint{ + Contype: ast.ConstrType_CONSTR_FOREIGN, + Conname: p.name(), + } + cas, casLoc := p.parseConstraintAttributeSpec() + p.processCASbits(cas, casLoc, "FOREIGN KEY", &c.Deferrable, &c.Initdeferred, nil, nil) + n.Def = nConstraint(c) + return nAlterTableCmd(n) + } + p.have(ast.Token_COLUMN) + if p.kind() == ast.Token_ICONST { + // ALTER opt_column Iconst SET STATISTICS set_statistics_value + itok := p.peek() + num := p.iconst() + p.expect(ast.Token_SET) + p.expect(ast.Token_STATISTICS) + if num <= 0 || num > 32767 { + p.ereport("base_yyparse", "column number must be in range from 1 to 32767", itok.Start) + } + n := newAlterTableCmd(ast.AlterTableType_AT_SetStatistics) + n.Num = num + n.Def = p.parseSetStatisticsValue() + return nAlterTableCmd(n) + } + return p.parseAlterColumnCmd() + + case ast.Token_DROP: + p.next() + switch p.kind() { + case ast.Token_CONSTRAINT: + p.next() + n := newAlterTableCmd(ast.AlterTableType_AT_DropConstraint) + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + n.MissingOk = true + } + n.Name = p.name() + n.Behavior = p.parseOptDropBehavior() + return nAlterTableCmd(n) + case ast.Token_COLUMN: + p.next() + } + n := newAlterTableCmd(ast.AlterTableType_AT_DropColumn) + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + n.MissingOk = true + } + n.Name = p.colId() + n.Behavior = p.parseOptDropBehavior() + return nAlterTableCmd(n) + + case ast.Token_VALIDATE: + p.next() + p.expect(ast.Token_CONSTRAINT) + n := newAlterTableCmd(ast.AlterTableType_AT_ValidateConstraint) + n.Name = p.name() + return nAlterTableCmd(n) + + case ast.Token_SET: + p.next() + switch p.kind() { + case ast.Token_WITHOUT: + p.next() + switch { + case p.have(ast.Token_OIDS): + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_DropOids)) + case p.have(ast.Token_CLUSTER): + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_DropCluster)) + } + p.syntaxErrorAt() + case ast.Token_LOGGED: + p.next() + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_SetLogged)) + case ast.Token_UNLOGGED: + p.next() + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_SetUnLogged)) + case ast.Token_ACCESS: + p.next() + p.expect(ast.Token_METHOD) + n := newAlterTableCmd(ast.AlterTableType_AT_SetAccessMethod) + if !p.have(ast.Token_DEFAULT) { + n.Name = p.colId() + } + return nAlterTableCmd(n) + case ast.Token_TABLESPACE: + p.next() + n := newAlterTableCmd(ast.AlterTableType_AT_SetTableSpace) + n.Name = p.name() + return nAlterTableCmd(n) + case ast.Token('('): + n := newAlterTableCmd(ast.AlterTableType_AT_SetRelOptions) + n.Def = nList(p.parseReloptions()) + return nAlterTableCmd(n) + } + p.syntaxErrorAt() + + case ast.Token_RESET: + p.next() + n := newAlterTableCmd(ast.AlterTableType_AT_ResetRelOptions) + n.Def = nList(p.parseReloptions()) + return nAlterTableCmd(n) + + case ast.Token_REPLICA: + p.next() + p.expect(ast.Token_IDENTITY_P) + n := newAlterTableCmd(ast.AlterTableType_AT_ReplicaIdentity) + r := &ast.ReplicaIdentityStmt{} + switch { + case p.have(ast.Token_NOTHING): + r.IdentityType = "n" + case p.have(ast.Token_FULL): + r.IdentityType = "f" + case p.have(ast.Token_DEFAULT): + r.IdentityType = "d" + case p.have(ast.Token_USING): + p.expect(ast.Token_INDEX) + r.IdentityType = "i" + r.Name = p.name() + default: + p.syntaxErrorAt() + } + n.Def = &ast.Node{Node: &ast.Node_ReplicaIdentityStmt{ReplicaIdentityStmt: r}} + return nAlterTableCmd(n) + + case ast.Token_ENABLE_P: + p.next() + switch { + case p.have(ast.Token_TRIGGER): + switch { + case p.have(ast.Token_ALL): + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_EnableTrigAll)) + case p.have(ast.Token_USER): + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_EnableTrigUser)) + } + n := newAlterTableCmd(ast.AlterTableType_AT_EnableTrig) + n.Name = p.name() + return nAlterTableCmd(n) + case p.have(ast.Token_ALWAYS): + switch { + case p.have(ast.Token_TRIGGER): + n := newAlterTableCmd(ast.AlterTableType_AT_EnableAlwaysTrig) + n.Name = p.name() + return nAlterTableCmd(n) + case p.have(ast.Token_RULE): + n := newAlterTableCmd(ast.AlterTableType_AT_EnableAlwaysRule) + n.Name = p.name() + return nAlterTableCmd(n) + } + p.syntaxErrorAt() + case p.have(ast.Token_REPLICA): + switch { + case p.have(ast.Token_TRIGGER): + n := newAlterTableCmd(ast.AlterTableType_AT_EnableReplicaTrig) + n.Name = p.name() + return nAlterTableCmd(n) + case p.have(ast.Token_RULE): + n := newAlterTableCmd(ast.AlterTableType_AT_EnableReplicaRule) + n.Name = p.name() + return nAlterTableCmd(n) + } + p.syntaxErrorAt() + case p.have(ast.Token_RULE): + n := newAlterTableCmd(ast.AlterTableType_AT_EnableRule) + n.Name = p.name() + return nAlterTableCmd(n) + case p.have(ast.Token_ROW): + p.expect(ast.Token_LEVEL) + p.expect(ast.Token_SECURITY) + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_EnableRowSecurity)) + } + p.syntaxErrorAt() + + case ast.Token_DISABLE_P: + p.next() + switch { + case p.have(ast.Token_TRIGGER): + switch { + case p.have(ast.Token_ALL): + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_DisableTrigAll)) + case p.have(ast.Token_USER): + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_DisableTrigUser)) + } + n := newAlterTableCmd(ast.AlterTableType_AT_DisableTrig) + n.Name = p.name() + return nAlterTableCmd(n) + case p.have(ast.Token_RULE): + n := newAlterTableCmd(ast.AlterTableType_AT_DisableRule) + n.Name = p.name() + return nAlterTableCmd(n) + case p.have(ast.Token_ROW): + p.expect(ast.Token_LEVEL) + p.expect(ast.Token_SECURITY) + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_DisableRowSecurity)) + } + p.syntaxErrorAt() + + case ast.Token_FORCE: + p.next() + p.expect(ast.Token_ROW) + p.expect(ast.Token_LEVEL) + p.expect(ast.Token_SECURITY) + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_ForceRowSecurity)) + + case ast.Token_NO: + p.next() + switch { + case p.have(ast.Token_INHERIT): + n := newAlterTableCmd(ast.AlterTableType_AT_DropInherit) + n.Def = nRangeVar(p.parseQualifiedName()) + return nAlterTableCmd(n) + case p.have(ast.Token_FORCE): + p.expect(ast.Token_ROW) + p.expect(ast.Token_LEVEL) + p.expect(ast.Token_SECURITY) + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_NoForceRowSecurity)) + } + p.syntaxErrorAt() + + case ast.Token_INHERIT: + p.next() + n := newAlterTableCmd(ast.AlterTableType_AT_AddInherit) + n.Def = nRangeVar(p.parseQualifiedName()) + return nAlterTableCmd(n) + + case ast.Token_OF: + p.next() + ntok := p.peek() + def := makeTypeNameFromNameList(p.anyName()) + def.Location = ntok.Start + n := newAlterTableCmd(ast.AlterTableType_AT_AddOf) + n.Def = nTypeName(def) + return nAlterTableCmd(n) + + case ast.Token_NOT: + p.next() + p.expect(ast.Token_OF) + return nAlterTableCmd(newAlterTableCmd(ast.AlterTableType_AT_DropOf)) + + case ast.Token_OWNER: + p.next() + p.expect(ast.Token_TO) + n := newAlterTableCmd(ast.AlterTableType_AT_ChangeOwner) + n.Newowner = p.parseRoleSpec() + return nAlterTableCmd(n) + + case ast.Token_CLUSTER: + p.next() + p.expect(ast.Token_ON) + n := newAlterTableCmd(ast.AlterTableType_AT_ClusterOn) + n.Name = p.name() + return nAlterTableCmd(n) + + case ast.Token_OPTIONS: + n := newAlterTableCmd(ast.AlterTableType_AT_GenericOptions) + n.Def = nList(p.parseAlterGenericOptions()) + return nAlterTableCmd(n) + } + p.syntaxErrorAt() + return nil +} + +// parseSetStatisticsValue is gram.y's set_statistics_value. +func (p *parser) parseSetStatisticsValue() *ast.Node { + if p.have(ast.Token_DEFAULT) { + return nil + } + return nInteger(p.parseSignedIconst()) +} + +// parseAlterColumnCmd handles the ALTER [COLUMN] ColId ... alternatives of +// alter_table_cmd; ALTER opt_column are consumed. +func (p *parser) parseAlterColumnCmd() *ast.Node { + ctok := p.peek() + colname := p.colId() + switch p.kind() { + case ast.Token_SET: + p.next() + switch p.kind() { + case ast.Token_DEFAULT: + p.next() + n := newAlterTableCmd(ast.AlterTableType_AT_ColumnDefault) + n.Name = colname + n.Def = p.parseAExpr(0) + return nAlterTableCmd(n) + case ast.Token_NOT: + p.next() + p.expect(ast.Token_NULL_P) + n := newAlterTableCmd(ast.AlterTableType_AT_SetNotNull) + n.Name = colname + return nAlterTableCmd(n) + case ast.Token_EXPRESSION: + p.next() + p.expect(ast.Token_AS) + p.expect(ast.Token('(')) + n := newAlterTableCmd(ast.AlterTableType_AT_SetExpression) + n.Name = colname + n.Def = p.parseAExpr(0) + p.expect(ast.Token(')')) + return nAlterTableCmd(n) + case ast.Token_STATISTICS: + p.next() + n := newAlterTableCmd(ast.AlterTableType_AT_SetStatistics) + n.Name = colname + n.Def = p.parseSetStatisticsValue() + return nAlterTableCmd(n) + case ast.Token('('): + n := newAlterTableCmd(ast.AlterTableType_AT_SetOptions) + n.Name = colname + n.Def = nList(p.parseReloptions()) + return nAlterTableCmd(n) + case ast.Token_STORAGE: + p.next() + n := newAlterTableCmd(ast.AlterTableType_AT_SetStorage) + n.Name = colname + n.Def = nStr(p.parseColIdOrDefault()) + return nAlterTableCmd(n) + case ast.Token_COMPRESSION: + p.next() + n := newAlterTableCmd(ast.AlterTableType_AT_SetCompression) + n.Name = colname + n.Def = nStr(p.parseColIdOrDefault()) + return nAlterTableCmd(n) + case ast.Token_DATA_P: + p.next() + p.expect(ast.Token_TYPE_P) + return p.parseAlterColumnType(colname, ctok.Start) + case ast.Token_GENERATED: + // alter_identity_column_option: SET GENERATED generated_when + return p.parseAlterIdentityOptions(colname, true) + default: + // alter_identity_column_option: SET SeqOptElem + if p.seqOptElemStarts() || p.kind() == ast.Token_AS { + return p.parseAlterIdentityOptions(colname, true) + } + } + p.syntaxErrorAt() + case ast.Token_RESET: + p.next() + n := newAlterTableCmd(ast.AlterTableType_AT_ResetOptions) + n.Name = colname + n.Def = nList(p.parseReloptions()) + return nAlterTableCmd(n) + case ast.Token_DROP: + p.next() + switch { + case p.have(ast.Token_NOT): + p.expect(ast.Token_NULL_P) + n := newAlterTableCmd(ast.AlterTableType_AT_DropNotNull) + n.Name = colname + return nAlterTableCmd(n) + case p.have(ast.Token_DEFAULT): + n := newAlterTableCmd(ast.AlterTableType_AT_ColumnDefault) + n.Name = colname + return nAlterTableCmd(n) + case p.have(ast.Token_EXPRESSION): + n := newAlterTableCmd(ast.AlterTableType_AT_DropExpression) + n.Name = colname + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + n.MissingOk = true + } + return nAlterTableCmd(n) + case p.have(ast.Token_IDENTITY_P): + n := newAlterTableCmd(ast.AlterTableType_AT_DropIdentity) + n.Name = colname + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + n.MissingOk = true + } + return nAlterTableCmd(n) + } + p.syntaxErrorAt() + case ast.Token_TYPE_P: + p.next() + return p.parseAlterColumnType(colname, ctok.Start) + case ast.Token_ADD_P: + // ALTER col ADD GENERATED generated_when AS IDENTITY [(seqopts)] + p.next() + gtok := p.expect(ast.Token_GENERATED) + c := &ast.Constraint{ + Contype: ast.ConstrType_CONSTR_IDENTITY, + Location: gtok.Start, + } + c.GeneratedWhen = p.parseGeneratedWhen() + p.expect(ast.Token_AS) + p.expect(ast.Token_IDENTITY_P) + if p.have(ast.Token('(')) { + c.Options = p.parseSeqOptList() + p.expect(ast.Token(')')) + } + n := newAlterTableCmd(ast.AlterTableType_AT_AddIdentity) + n.Name = colname + n.Def = nConstraint(c) + return nAlterTableCmd(n) + case ast.Token_RESTART: + return p.parseAlterIdentityOptions(colname, false) + case ast.Token_OPTIONS: + n := newAlterTableCmd(ast.AlterTableType_AT_AlterColumnGenericOptions) + n.Name = colname + n.Def = nList(p.parseAlterGenericOptions()) + return nAlterTableCmd(n) + } + p.syntaxErrorAt() + return nil +} + +// parseAlterColumnType finishes ALTER [COLUMN] col [SET DATA] TYPE: +// +// Typename opt_collate_clause alter_using +func (p *parser) parseAlterColumnType(colname string, colLoc int32) *ast.Node { + n := newAlterTableCmd(ast.AlterTableType_AT_AlterColumnType) + n.Name = colname + def := &ast.ColumnDef{Location: colLoc} + def.TypeName = p.parseTypename() + if p.kind() == ast.Token_COLLATE { + ctok := p.next() + def.CollClause = &ast.CollateClause{ + Collname: p.anyName(), + Location: ctok.Start, + } + } + if p.have(ast.Token_USING) { + def.RawDefault = p.parseAExpr(0) + } + n.Def = nColumnDef(def) + return nAlterTableCmd(n) +} + +// parseAlterIdentityOptions is gram.y's +// alter_identity_column_option_list; firstIsSet marks that the caller's +// lookahead sits after a consumed SET. +func (p *parser) parseAlterIdentityOptions(colname string, firstIsSet bool) *ast.Node { + n := newAlterTableCmd(ast.AlterTableType_AT_SetIdentity) + n.Name = colname + var opts []*ast.Node + first := true + for { + var setConsumed bool + if first { + setConsumed = firstIsSet + first = false + } else { + switch p.kind() { + case ast.Token_RESTART: + case ast.Token_SET: + p.next() + setConsumed = true + default: + n.Def = nList(opts) + return nAlterTableCmd(n) + } + } + if !setConsumed { + if p.kind() != ast.Token_RESTART { + n.Def = nList(opts) + return nAlterTableCmd(n) + } + rtok := p.next() + switch p.kind() { + case ast.Token_WITH, ast.Token_WITH_LA, ast.Token_ICONST, + ast.Token_FCONST, ast.Token('+'), ast.Token('-'): + p.parseOptWith() + opts = append(opts, makeDefElem("restart", p.parseNumericOnly(), rtok.Start)) + default: + opts = append(opts, makeDefElem("restart", nil, rtok.Start)) + } + continue + } + // SET GENERATED generated_when | SET SeqOptElem + if p.kind() == ast.Token_GENERATED { + stok := p.toks[p.pos-1] + p.next() + when := p.parseGeneratedWhen() + ival := int32('a') + if when == attributeIdentityByDefault { + ival = 'd' + } + opts = append(opts, makeDefElem("generated", nInteger(ival), stok.Start)) + continue + } + etok := p.peek() + el := p.parseSeqOptElem() + name := el.GetDefElem().GetDefname() + if name == "as" || name == "restart" || name == "owned_by" { + p.ereport("base_yyparse", + fmt.Sprintf("sequence option %q not supported here", name), etok.Start) + } + opts = append(opts, el) + } +} + +// parseAlterGenericOptions is gram.y's alter_generic_options: +// +// OPTIONS '(' alter_generic_option_list ')' +func (p *parser) parseAlterGenericOptions() []*ast.Node { + p.expect(ast.Token_OPTIONS) + p.expect(ast.Token('(')) + list := []*ast.Node{p.parseAlterGenericOptionElem()} + for p.have(ast.Token(',')) { + list = append(list, p.parseAlterGenericOptionElem()) + } + p.expect(ast.Token(')')) + return list +} + +// parseAlterGenericOptionElem is gram.y's alter_generic_option_elem. +func (p *parser) parseAlterGenericOptionElem() *ast.Node { + switch p.kind() { + case ast.Token_SET: + p.next() + el := p.parseGenericOptionElem() + el.GetDefElem().Defaction = ast.DefElemAction_DEFELEM_SET + return el + case ast.Token_ADD_P: + p.next() + el := p.parseGenericOptionElem() + el.GetDefElem().Defaction = ast.DefElemAction_DEFELEM_ADD + return el + case ast.Token_DROP: + p.next() + ntok := p.peek() + name := p.colLabel() + return makeDefElemExtended("", name, nil, ast.DefElemAction_DEFELEM_DROP, ntok.Start) + } + return p.parseGenericOptionElem() +} + +// parseAlterTypeDispatch routes ALTER TYPE_P any_name ...; the composite +// AlterCompositeTypeStmt lives here, with the rest of the ALTER TYPE +// family (enum, owner, rename, schema, generic) added in milestone 7. +func (p *parser) parseAlterTypeDispatch() *ast.Node { + ntok := p.peek() + names := p.anyName() + switch p.kind() { + case ast.Token_ADD_P, ast.Token_DROP, ast.Token_ALTER: + if p.kindN(1) == ast.Token_ATTRIBUTE { + // gram.y: AlterCompositeTypeStmt: ALTER TYPE_P any_name + // alter_type_cmds + n := &ast.AlterTableStmt{ + Objtype: ast.ObjectType_OBJECT_TYPE, + Relation: p.makeRangeVarFromAnyName(names, ntok.Start), + } + n.Cmds = []*ast.Node{p.parseAlterTypeCmd()} + for p.have(ast.Token(',')) { + n.Cmds = append(n.Cmds, p.parseAlterTypeCmd()) + } + return &ast.Node{Node: &ast.Node_AlterTableStmt{AlterTableStmt: n}} + } + if p.kind() == ast.Token_ADD_P && p.kindN(1) == ast.Token_VALUE_P { + return p.parseAlterEnumStmt(names) + } + if p.kind() == ast.Token_DROP && p.kindN(1) == ast.Token_VALUE_P { + // gram.y: AlterEnumStmt's DROP VALUE arm always errors. + dtok := p.next() + p.next() + p.sconst() + p.ereport("base_yyparse", "dropping an enum value is not implemented", dtok.Start) + } + case ast.Token_RENAME: + switch p.kindN(1) { + case ast.Token_ATTRIBUTE: + // RenameStmt: ALTER TYPE_P any_name RENAME ATTRIBUTE ... + p.next() + p.next() + r := newRenameStmt(ast.ObjectType_OBJECT_ATTRIBUTE) + r.RelationType = ast.ObjectType_OBJECT_TYPE + r.Relation = p.makeRangeVarFromAnyName(names, ntok.Start) + r.Subname = p.name() + p.expect(ast.Token_TO) + r.Newname = p.name() + r.Behavior = p.parseOptDropBehavior() + return nRenameStmt(r) + case ast.Token_VALUE_P: + return p.parseAlterEnumStmt(names) + } + case ast.Token_SET: + if p.kindN(1) == ast.Token('(') { + // gram.y: AlterTypeStmt: ALTER TYPE_P any_name SET '(' ... ')' + p.next() + p.next() + n := &ast.AlterTypeStmt{TypeName: names} + n.Options = p.parseOperatorDefList() + p.expect(ast.Token(')')) + return &ast.Node{Node: &ast.Node_AlterTypeStmt{AlterTypeStmt: n}} + } + } + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_TYPE, nList(names), nil, false, + tailRename|tailSchema|tailOwner); n != nil { + return n + } + p.syntaxErrorAt() + return nil +} + +// parseAlterEnumStmt is gram.y's AlterEnumStmt; ALTER TYPE_P any_name +// consumed, lookahead at ADD VALUE or RENAME VALUE. +func (p *parser) parseAlterEnumStmt(names []*ast.Node) *ast.Node { + n := &ast.AlterEnumStmt{TypeName: names} + if p.have(ast.Token_ADD_P) { + p.expect(ast.Token_VALUE_P) + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + n.SkipIfNewValExists = true + } + n.NewVal = p.sconst() + n.NewValIsAfter = true + switch { + case p.have(ast.Token_BEFORE): + n.NewValNeighbor = p.sconst() + n.NewValIsAfter = false + case p.have(ast.Token_AFTER): + n.NewValNeighbor = p.sconst() + } + return &ast.Node{Node: &ast.Node_AlterEnumStmt{AlterEnumStmt: n}} + } + p.expect(ast.Token_RENAME) + p.expect(ast.Token_VALUE_P) + n.OldVal = p.sconst() + p.expect(ast.Token_TO) + n.NewVal = p.sconst() + return &ast.Node{Node: &ast.Node_AlterEnumStmt{AlterEnumStmt: n}} +} + +// parseAlterTypeCmd is gram.y's alter_type_cmd. +func (p *parser) parseAlterTypeCmd() *ast.Node { + switch p.kind() { + case ast.Token_ADD_P: + p.next() + p.expect(ast.Token_ATTRIBUTE) + n := newAlterTableCmd(ast.AlterTableType_AT_AddColumn) + n.Def = p.parseTableFuncElement() + n.Behavior = p.parseOptDropBehavior() + return nAlterTableCmd(n) + case ast.Token_DROP: + p.next() + p.expect(ast.Token_ATTRIBUTE) + n := newAlterTableCmd(ast.AlterTableType_AT_DropColumn) + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + n.MissingOk = true + } + n.Name = p.colId() + n.Behavior = p.parseOptDropBehavior() + return nAlterTableCmd(n) + case ast.Token_ALTER: + p.next() + p.expect(ast.Token_ATTRIBUTE) + ctok := p.peek() + colname := p.colId() + if p.have(ast.Token_SET) { + p.expect(ast.Token_DATA_P) + } + p.expect(ast.Token_TYPE_P) + cmd := p.parseAlterColumnType(colname, ctok.Start) + cmd.GetAlterTableCmd().Behavior = p.parseOptDropBehavior() + return cmd + } + p.syntaxErrorAt() + return nil +} diff --git a/internal/parse/ddl_create.go b/internal/parse/ddl_create.go new file mode 100644 index 0000000..de8f3c5 --- /dev/null +++ b/internal/parse/ddl_create.go @@ -0,0 +1,1456 @@ +package parse + +// CreateStmt (CREATE TABLE), CreateAsStmt (CREATE TABLE AS, including the +// AS EXECUTE variant that lives in gram.y's ExecuteStmt), CreateSeqStmt/ +// AlterSeqStmt, ViewStmt, IndexStmt, CreateMatViewStmt, RefreshMatViewStmt, +// and their shared table-element/constraint machinery. + +import ( + "fmt" + + "github.com/sqlc-dev/oliphant/ast" +) + +func nCreateStmt(n *ast.CreateStmt) *ast.Node { + return &ast.Node{Node: &ast.Node_CreateStmt{CreateStmt: n}} +} + +func nConstraint(n *ast.Constraint) *ast.Node { + return &ast.Node{Node: &ast.Node_Constraint{Constraint: n}} +} + +func nColumnDef(n *ast.ColumnDef) *ast.Node { + return &ast.Node{Node: &ast.Node_ColumnDef{ColumnDef: n}} +} + +// parseCreateTableOrAs parses CREATE [OptTemp] TABLE ...: CreateStmt, +// CreateAsStmt, or the CREATE TABLE ... AS EXECUTE form of ExecuteStmt. +// CREATE and OptTemp are consumed, TABLE is not. +func (p *parser) parseCreateTableOrAs(persistence string) *ast.Node { + p.expect(ast.Token_TABLE) + ifNotExists := false + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + ifNotExists = true + } + rel := p.parseQualifiedName() + rel.Relpersistence = persistence + + switch p.kind() { + case ast.Token_OF: + // gram.y: CreateStmt: ... qualified_name OF any_name ... + p.next() + ntok := p.peek() + of := makeTypeNameFromNameList(p.anyName()) + of.Location = ntok.Start + n := &ast.CreateStmt{ + Relation: rel, + OfTypename: of, + IfNotExists: ifNotExists, + } + if p.have(ast.Token('(')) { + n.TableElts = p.parseTypedTableElementList() + p.expect(ast.Token(')')) + } + p.finishCreateStmtTail(n) + return nCreateStmt(n) + + case ast.Token_PARTITION: + // gram.y: CreateStmt: ... qualified_name PARTITION OF ... + p.next() + p.expect(ast.Token_OF) + parent := p.parseQualifiedName() + n := &ast.CreateStmt{ + Relation: rel, + InhRelations: []*ast.Node{nRangeVar(parent)}, + IfNotExists: ifNotExists, + } + if p.have(ast.Token('(')) { + n.TableElts = p.parseTypedTableElementList() + p.expect(ast.Token(')')) + } + n.Partbound = p.parsePartitionBoundSpec() + p.finishCreateStmtTail(n) + return nCreateStmt(n) + + case ast.Token('('): + // Either CreateStmt's '(' OptTableElementList ')' or a + // create_as_target column list. The LALR tables keep both alive + // through the parens; commit to CREATE TABLE AS only once the AS + // is seen. + mark := p.mark() + var into *ast.IntoClause + err := p.try(func() { + into = p.parseCreateAsTarget(rel) + p.expect(ast.Token_AS) + }) + if err == nil { + return p.finishCreateTableAs(into, ifNotExists) + } + p.reset(mark) + n := &ast.CreateStmt{Relation: rel, IfNotExists: ifNotExists} + p.expect(ast.Token('(')) + if p.kind() != ast.Token(')') { + n.TableElts = p.parseTableElementList() + } + p.expect(ast.Token(')')) + if p.have(ast.Token_INHERITS) { + p.expect(ast.Token('(')) + n.InhRelations = p.parseQualifiedNameList() + p.expect(ast.Token(')')) + } + p.finishCreateStmtTail(n) + return nCreateStmt(n) + + default: + // create_as_target without a column list. + into := p.parseCreateAsTarget(rel) + p.expect(ast.Token_AS) + return p.finishCreateTableAs(into, ifNotExists) + } +} + +// finishCreateStmtTail parses the common CreateStmt tail: OptPartitionSpec +// table_access_method_clause OptWith OnCommitOption OptTableSpace. +func (p *parser) finishCreateStmtTail(n *ast.CreateStmt) { + n.Partspec = p.parseOptPartitionSpec() + if p.have(ast.Token_USING) { + n.AccessMethod = p.name() + } + n.Options = p.parseOptWithReloptions() + n.Oncommit = p.parseOnCommitOption() + if p.have(ast.Token_TABLESPACE) { + n.Tablespacename = p.name() + } +} + +// parseOptWithReloptions is gram.y's OptWith: +// +// WITH reloptions | WITHOUT OIDS | empty +func (p *parser) parseOptWithReloptions() []*ast.Node { + switch p.kind() { + case ast.Token_WITH: + if p.kindN(1) == ast.Token('(') { + p.next() + return p.parseReloptions() + } + // WITH can only start "WITH reloptions" here; bison shifts it and + // fails at the following token. + p.next() + p.syntaxErrorAt() + case ast.Token_WITHOUT: + if p.kindN(1) == ast.Token_OIDS { + p.next() + p.next() + } + } + return nil +} + +// parseOnCommitOption is gram.y's OnCommitOption. +func (p *parser) parseOnCommitOption() ast.OnCommitAction { + if p.kind() == ast.Token_ON && p.kindN(1) == ast.Token_COMMIT { + p.next() + p.next() + switch p.kind() { + case ast.Token_DROP: + p.next() + return ast.OnCommitAction_ONCOMMIT_DROP + case ast.Token_DELETE_P: + p.next() + p.expect(ast.Token_ROWS) + return ast.OnCommitAction_ONCOMMIT_DELETE_ROWS + case ast.Token_PRESERVE: + p.next() + p.expect(ast.Token_ROWS) + return ast.OnCommitAction_ONCOMMIT_PRESERVE_ROWS + } + p.syntaxErrorAt() + } + return ast.OnCommitAction_ONCOMMIT_NOOP +} + +// parseCreateAsTarget is gram.y's create_as_target (minus the persistence, +// which the caller has already stored into rel): +// +// qualified_name opt_column_list table_access_method_clause OptWith +// OnCommitOption OptTableSpace +func (p *parser) parseCreateAsTarget(rel *ast.RangeVar) *ast.IntoClause { + into := &ast.IntoClause{Rel: rel} + if p.have(ast.Token('(')) { + into.ColNames = p.columnList() + p.expect(ast.Token(')')) + } + if p.have(ast.Token_USING) { + into.AccessMethod = p.name() + } + into.Options = p.parseOptWithReloptions() + into.OnCommit = p.parseOnCommitOption() + if p.have(ast.Token_TABLESPACE) { + into.TableSpaceName = p.name() + } + return into +} + +// finishCreateTableAs parses the query and opt_with_data after AS, +// producing CreateTableAsStmt for both the SelectStmt and EXECUTE forms. +func (p *parser) finishCreateTableAs(into *ast.IntoClause, ifNotExists bool) *ast.Node { + ctas := &ast.CreateTableAsStmt{ + Into: into, + Objtype: ast.ObjectType_OBJECT_TABLE, + IfNotExists: ifNotExists, + } + if p.have(ast.Token_EXECUTE) { + // gram.y: ExecuteStmt: CREATE OptTemp TABLE create_as_target AS + // EXECUTE name execute_param_clause opt_with_data + e := &ast.ExecuteStmt{Name: p.name()} + if p.have(ast.Token('(')) { + e.Params = p.parseExprList() + p.expect(ast.Token(')')) + } + ctas.Query = &ast.Node{Node: &ast.Node_ExecuteStmt{ExecuteStmt: e}} + } else { + ctas.Query = p.parseSelectStmt() + } + into.SkipData = !p.parseOptWithData() + return &ast.Node{Node: &ast.Node_CreateTableAsStmt{CreateTableAsStmt: ctas}} +} + +// parseOptWithData is gram.y's opt_with_data. +func (p *parser) parseOptWithData() bool { + if p.kind() == ast.Token_WITH { + switch { + case p.kindN(1) == ast.Token_DATA_P: + p.next() + p.next() + return true + case p.kindN(1) == ast.Token_NO && p.kindN(2) == ast.Token_DATA_P: + p.next() + p.next() + p.next() + return false + } + } + return true +} + +// parseTableElementList is gram.y's TableElementList. +func (p *parser) parseTableElementList() []*ast.Node { + list := []*ast.Node{p.parseTableElement()} + for p.have(ast.Token(',')) { + list = append(list, p.parseTableElement()) + } + return list +} + +// parseTableElement is gram.y's TableElement: columnDef | TableLikeClause | +// TableConstraint. +func (p *parser) parseTableElement() *ast.Node { + switch p.kind() { + case ast.Token_LIKE: + return p.parseTableLikeClause() + case ast.Token_CONSTRAINT, ast.Token_CHECK, ast.Token_UNIQUE, + ast.Token_PRIMARY, ast.Token_EXCLUDE, ast.Token_FOREIGN: + return p.parseTableConstraint() + } + return p.parseColumnDef() +} + +// parseTypedTableElementList is gram.y's TypedTableElementList. +func (p *parser) parseTypedTableElementList() []*ast.Node { + list := []*ast.Node{p.parseTypedTableElement()} + for p.have(ast.Token(',')) { + list = append(list, p.parseTypedTableElement()) + } + return list +} + +// parseTypedTableElement is gram.y's TypedTableElement: columnOptions | +// TableConstraint. +func (p *parser) parseTypedTableElement() *ast.Node { + switch p.kind() { + case ast.Token_CONSTRAINT, ast.Token_CHECK, ast.Token_UNIQUE, + ast.Token_PRIMARY, ast.Token_EXCLUDE, ast.Token_FOREIGN: + return p.parseTableConstraint() + } + // gram.y: columnOptions: ColId [WITH OPTIONS] ColQualList + tok := p.peek() + n := &ast.ColumnDef{ + Colname: p.colId(), + IsLocal: true, + Location: tok.Start, + } + if p.kind() == ast.Token_WITH && p.kindN(1) == ast.Token_OPTIONS { + p.next() + p.next() + } + n.Constraints, n.CollClause = p.parseColQualList() + return nColumnDef(n) +} + +// parseColumnDef is gram.y's columnDef: +// +// ColId Typename opt_column_storage opt_column_compression +// create_generic_options ColQualList +func (p *parser) parseColumnDef() *ast.Node { + tok := p.peek() + n := &ast.ColumnDef{ + Colname: p.colId(), + IsLocal: true, + Location: tok.Start, + } + n.TypeName = p.parseTypename() + if p.kind() == ast.Token_STORAGE { + p.next() + n.StorageName = p.parseColIdOrDefault() + } + if p.kind() == ast.Token_COMPRESSION { + p.next() + n.Compression = p.parseColIdOrDefault() + } + n.Fdwoptions = p.parseCreateGenericOptions() + n.Constraints, n.CollClause = p.parseColQualList() + return nColumnDef(n) +} + +// parseColIdOrDefault handles column_storage/column_compression's +// ColId-or-DEFAULT alternative. +func (p *parser) parseColIdOrDefault() string { + if p.have(ast.Token_DEFAULT) { + return "default" + } + return p.colId() +} + +// parseColQualList is gram.y's ColQualList plus SplitColQualList: collect +// column constraints, splitting out a single CollateClause. +func (p *parser) parseColQualList() ([]*ast.Node, *ast.CollateClause) { + var constraints []*ast.Node + var coll *ast.CollateClause + for { + tok := p.peek() + switch tok.Kind { + case ast.Token_COLLATE: + p.next() + c := &ast.CollateClause{Collname: p.anyName(), Location: tok.Start} + // gram.y: SplitColQualList + if coll != nil { + p.ereport("SplitColQualList", "multiple COLLATE clauses not allowed", c.Location) + } + coll = c + case ast.Token_CONSTRAINT: + p.next() + name := p.name() + c := p.parseColConstraintElem() + c.Conname = name + c.Location = tok.Start + constraints = append(constraints, nConstraint(c)) + case ast.Token_NOT: + // bison always shifts NOT here (nothing else in the follow set + // starts with it), so a bad token after NOT is reported at that + // token, not at NOT. + p.next() + switch { + case p.have(ast.Token_NULL_P): + constraints = append(constraints, nConstraint(&ast.Constraint{ + Contype: ast.ConstrType_CONSTR_NOTNULL, + Location: tok.Start, + })) + case p.have(ast.Token_DEFERRABLE): + constraints = append(constraints, nConstraint(&ast.Constraint{ + Contype: ast.ConstrType_CONSTR_ATTR_NOT_DEFERRABLE, + Location: tok.Start, + })) + default: + p.syntaxErrorAt() + } + case ast.Token_DEFERRABLE: + p.next() + constraints = append(constraints, nConstraint(&ast.Constraint{ + Contype: ast.ConstrType_CONSTR_ATTR_DEFERRABLE, + Location: tok.Start, + })) + case ast.Token_INITIALLY: + p.next() + switch { + case p.have(ast.Token_DEFERRED): + constraints = append(constraints, nConstraint(&ast.Constraint{ + Contype: ast.ConstrType_CONSTR_ATTR_DEFERRED, + Location: tok.Start, + })) + case p.have(ast.Token_IMMEDIATE): + constraints = append(constraints, nConstraint(&ast.Constraint{ + Contype: ast.ConstrType_CONSTR_ATTR_IMMEDIATE, + Location: tok.Start, + })) + default: + p.syntaxErrorAt() + } + case ast.Token_NULL_P, ast.Token_UNIQUE, ast.Token_PRIMARY, + ast.Token_CHECK, ast.Token_DEFAULT, ast.Token_GENERATED, + ast.Token_REFERENCES: + c := p.parseColConstraintElem() + constraints = append(constraints, nConstraint(c)) + default: + return constraints, coll + } + } +} + +// parseColConstraintElem is gram.y's ColConstraintElem. The leading +// CONSTRAINT name (if any) is handled by the caller. +func (p *parser) parseColConstraintElem() *ast.Constraint { + tok := p.peek() + n := &ast.Constraint{Location: tok.Start} + switch tok.Kind { + case ast.Token_NOT: + p.next() + p.expect(ast.Token_NULL_P) + n.Contype = ast.ConstrType_CONSTR_NOTNULL + case ast.Token_NULL_P: + p.next() + n.Contype = ast.ConstrType_CONSTR_NULL + case ast.Token_UNIQUE: + p.next() + n.Contype = ast.ConstrType_CONSTR_UNIQUE + n.NullsNotDistinct = !p.parseOptUniqueNullTreatment() + n.Options = p.parseOptDefinition() + n.Indexspace = p.parseOptConsTableSpace() + case ast.Token_PRIMARY: + p.next() + p.expect(ast.Token_KEY) + n.Contype = ast.ConstrType_CONSTR_PRIMARY + n.Options = p.parseOptDefinition() + n.Indexspace = p.parseOptConsTableSpace() + case ast.Token_CHECK: + p.next() + n.Contype = ast.ConstrType_CONSTR_CHECK + n.InitiallyValid = true + p.expect(ast.Token('(')) + n.RawExpr = p.parseAExpr(0) + p.expect(ast.Token(')')) + if p.kind() == ast.Token_NO && p.kindN(1) == ast.Token_INHERIT { + p.next() + p.next() + n.IsNoInherit = true + } + case ast.Token_DEFAULT: + p.next() + n.Contype = ast.ConstrType_CONSTR_DEFAULT + n.RawExpr = p.parseBExpr(0) + case ast.Token_GENERATED: + p.next() + wtok := p.peek() + n.GeneratedWhen = p.parseGeneratedWhen() + p.expect(ast.Token_AS) + if p.have(ast.Token_IDENTITY_P) { + n.Contype = ast.ConstrType_CONSTR_IDENTITY + if p.have(ast.Token('(')) { + n.Options = p.parseSeqOptList() + p.expect(ast.Token(')')) + } + } else { + n.Contype = ast.ConstrType_CONSTR_GENERATED + p.expect(ast.Token('(')) + n.RawExpr = p.parseAExpr(0) + p.expect(ast.Token(')')) + p.expect(ast.Token_STORED) + if n.GeneratedWhen != attributeIdentityAlways { + p.ereport("base_yyparse", "for a generated column, GENERATED ALWAYS must be specified", wtok.Start) + } + } + case ast.Token_REFERENCES: + p.next() + n.Contype = ast.ConstrType_CONSTR_FOREIGN + n.InitiallyValid = true + n.Pktable = p.parseQualifiedName() + if p.have(ast.Token('(')) { + n.PkAttrs = p.columnList() + p.expect(ast.Token(')')) + } + n.FkMatchtype = p.parseKeyMatch() + upd, del, delCols := p.parseKeyActions() + n.FkUpdAction = upd + n.FkDelAction = del + n.FkDelSetCols = delCols + default: + p.syntaxErrorAt() + } + return n +} + +// Identity attribute chars (pg_attribute.h). +const ( + attributeIdentityAlways = "a" + attributeIdentityByDefault = "d" +) + +// parseGeneratedWhen is gram.y's generated_when. +func (p *parser) parseGeneratedWhen() string { + switch { + case p.have(ast.Token_ALWAYS): + return attributeIdentityAlways + case p.have(ast.Token_BY): + p.expect(ast.Token_DEFAULT) + return attributeIdentityByDefault + } + p.syntaxErrorAt() + return "" +} + +// parseOptUniqueNullTreatment is gram.y's opt_unique_null_treatment; +// returns true for NULLS DISTINCT (the default). +func (p *parser) parseOptUniqueNullTreatment() bool { + if p.have(ast.Token_NULLS_P) { + if p.have(ast.Token_NOT) { + p.expect(ast.Token_DISTINCT) + return false + } + p.expect(ast.Token_DISTINCT) + return true + } + return true +} + +// parseOptDefinition is gram.y's opt_definition: WITH definition | empty. +func (p *parser) parseOptDefinition() []*ast.Node { + if p.kind() == ast.Token_WITH && p.kindN(1) == ast.Token('(') { + p.next() + return p.parseDefinition() + } + return nil +} + +// parseDefinition is gram.y's definition: '(' def_list ')'. +func (p *parser) parseDefinition() []*ast.Node { + p.expect(ast.Token('(')) + list := []*ast.Node{p.parseDefElem()} + for p.have(ast.Token(',')) { + list = append(list, p.parseDefElem()) + } + p.expect(ast.Token(')')) + return list +} + +// parseDefElem is gram.y's def_elem: ColLabel ['=' def_arg]. +func (p *parser) parseDefElem() *ast.Node { + tok := p.peek() + name := p.colLabel() + var arg *ast.Node + if p.have(ast.Token('=')) { + arg = p.parseDefArg() + } + return makeDefElem(name, arg, tok.Start) +} + +// parseOptConsTableSpace is gram.y's OptConsTableSpace: +// +// USING INDEX TABLESPACE name | empty +func (p *parser) parseOptConsTableSpace() string { + if p.kind() == ast.Token_USING && p.kindN(1) == ast.Token_INDEX && + p.kindN(2) == ast.Token_TABLESPACE { + p.next() + p.next() + p.next() + return p.name() + } + return "" +} + +// parseKeyMatch is gram.y's key_match. +func (p *parser) parseKeyMatch() string { + if p.kind() == ast.Token_MATCH { + mtok := p.next() + switch { + case p.have(ast.Token_FULL): + return "f" // FKCONSTR_MATCH_FULL + case p.have(ast.Token_PARTIAL): + p.ereport("base_yyparse", "MATCH PARTIAL not yet implemented", mtok.Start) + case p.have(ast.Token_SIMPLE): + return "s" // FKCONSTR_MATCH_SIMPLE + default: + p.syntaxErrorAt() + } + } + return "s" +} + +// parseKeyActions is gram.y's key_actions; returns the update action, the +// delete action, and the delete action's column list. +func (p *parser) parseKeyActions() (string, string, []*ast.Node) { + upd, del := "a", "a" // FKCONSTR_ACTION_NOACTION + var delCols []*ast.Node + haveUpd, haveDel := false, false + for p.kind() == ast.Token_ON && + (p.kindN(1) == ast.Token_UPDATE || p.kindN(1) == ast.Token_DELETE_P) { + ontok := p.next() + isUpd := p.next().Kind == ast.Token_UPDATE + action, cols := p.parseKeyAction() + if isUpd { + if haveUpd { + p.syntaxError(ontok) + } + haveUpd = true + if cols != nil { + // gram.y: key_update's column-list ereport + what := "SET DEFAULT" + if action == "n" { + what = "SET NULL" + } + p.ereport("base_yyparse", fmt.Sprintf("a column list with %s is only supported for ON DELETE actions", what), ontok.Start) + } + upd = action + } else { + if haveDel { + p.syntaxError(ontok) + } + haveDel = true + del = action + delCols = cols + } + } + return upd, del, delCols +} + +// parseKeyAction is gram.y's key_action. +func (p *parser) parseKeyAction() (string, []*ast.Node) { + switch { + case p.have(ast.Token_NO): + p.expect(ast.Token_ACTION) + return "a", nil + case p.have(ast.Token_RESTRICT): + return "r", nil + case p.have(ast.Token_CASCADE): + return "c", nil + case p.have(ast.Token_SET): + var action string + switch { + case p.have(ast.Token_NULL_P): + action = "n" + case p.have(ast.Token_DEFAULT): + action = "d" + default: + p.syntaxErrorAt() + } + var cols []*ast.Node + if p.have(ast.Token('(')) { + cols = p.columnList() + p.expect(ast.Token(')')) + } + return action, cols + } + p.syntaxErrorAt() + return "", nil +} + +// parseTableLikeClause is gram.y's TableLikeClause. +func (p *parser) parseTableLikeClause() *ast.Node { + p.expect(ast.Token_LIKE) + n := &ast.TableLikeClause{Relation: p.parseQualifiedName()} + // gram.y: TableLikeOptionList + for { + switch { + case p.have(ast.Token_INCLUDING): + n.Options |= p.parseTableLikeOption() + case p.have(ast.Token_EXCLUDING): + n.Options &^= p.parseTableLikeOption() + default: + return &ast.Node{Node: &ast.Node_TableLikeClause{TableLikeClause: n}} + } + } +} + +// CREATE_TABLE_LIKE_* bits (parsenodes.h). +const ( + createTableLikeComments = 1 << 0 + createTableLikeCompression = 1 << 1 + createTableLikeConstraints = 1 << 2 + createTableLikeDefaults = 1 << 3 + createTableLikeGenerated = 1 << 4 + createTableLikeIdentity = 1 << 5 + createTableLikeIndexes = 1 << 6 + createTableLikeStatistics = 1 << 7 + createTableLikeStorage = 1 << 8 + createTableLikeAll = 0x7FFFFFFF +) + +// parseTableLikeOption is gram.y's TableLikeOption. +func (p *parser) parseTableLikeOption() uint32 { + switch { + case p.have(ast.Token_COMMENTS): + return createTableLikeComments + case p.have(ast.Token_COMPRESSION): + return createTableLikeCompression + case p.have(ast.Token_CONSTRAINTS): + return createTableLikeConstraints + case p.have(ast.Token_DEFAULTS): + return createTableLikeDefaults + case p.have(ast.Token_IDENTITY_P): + return createTableLikeIdentity + case p.have(ast.Token_GENERATED): + return createTableLikeGenerated + case p.have(ast.Token_INDEXES): + return createTableLikeIndexes + case p.have(ast.Token_STATISTICS): + return createTableLikeStatistics + case p.have(ast.Token_STORAGE): + return createTableLikeStorage + case p.have(ast.Token_ALL): + return createTableLikeAll + } + p.syntaxErrorAt() + return 0 +} + +// parseTableConstraint is gram.y's TableConstraint. +func (p *parser) parseTableConstraint() *ast.Node { + tok := p.peek() + if tok.Kind == ast.Token_CONSTRAINT { + p.next() + name := p.name() + c := p.parseConstraintElem() + c.Conname = name + c.Location = tok.Start + return nConstraint(c) + } + return nConstraint(p.parseConstraintElem()) +} + +// Constraint attribute bits (gram.y CAS_*). +const ( + casNotDeferrable = 1 << 0 + casDeferrable = 1 << 1 + casInitiallyImmediate = 1 << 2 + casInitiallyDeferred = 1 << 3 + casNotValid = 1 << 4 + casNoInherit = 1 << 5 +) + +// parseConstraintAttributeSpec is gram.y's ConstraintAttributeSpec; returns +// the accumulated CAS bits and the location of the spec (its first token, +// or -1 when empty). +func (p *parser) parseConstraintAttributeSpec() (int, int32) { + // The spec nonterminal's own location is always -1: PG's YYLLOC_DEFAULT + // assigns empty productions -1 and the left recursion propagates it, so + // processCASbits never reports a cursor position. + spec := 0 + loc := int32(-1) + for { + tok := p.peek() + var bit int + switch tok.Kind { + case ast.Token_NOT: + switch p.kindN(1) { + case ast.Token_DEFERRABLE: + p.next() + p.next() + bit = casNotDeferrable + case ast.Token_VALID: + p.next() + p.next() + bit = casNotValid + default: + return spec, loc + } + case ast.Token_DEFERRABLE: + p.next() + bit = casDeferrable + case ast.Token_INITIALLY: + switch p.kindN(1) { + case ast.Token_IMMEDIATE: + p.next() + p.next() + bit = casInitiallyImmediate + case ast.Token_DEFERRED: + p.next() + p.next() + bit = casInitiallyDeferred + default: + return spec, loc + } + case ast.Token_NO: + if p.kindN(1) == ast.Token_INHERIT { + p.next() + p.next() + bit = casNoInherit + } else { + return spec, loc + } + default: + return spec, loc + } + newspec := spec | bit + // gram.y: ConstraintAttributeSpec conflict checks, reported at @2. + if newspec&(casNotDeferrable|casInitiallyDeferred) == casNotDeferrable|casInitiallyDeferred { + p.ereport("base_yyparse", "constraint declared INITIALLY DEFERRED must be DEFERRABLE", tok.Start) + } + if newspec&(casNotDeferrable|casDeferrable) == casNotDeferrable|casDeferrable || + newspec&(casInitiallyImmediate|casInitiallyDeferred) == casInitiallyImmediate|casInitiallyDeferred { + p.ereport("base_yyparse", "conflicting constraint properties", tok.Start) + } + spec = newspec + } +} + +// processCASbits is gram.y's processCASbits: apply the attribute bits to +// the flags the constraint type supports, erroring on the rest. +func (p *parser) processCASbits(casBits int, loc int32, constrType string, + deferrable, initdeferred, notValid, noInherit *bool) { + if casBits&(casDeferrable|casInitiallyDeferred) != 0 { + if deferrable != nil { + *deferrable = true + } else { + p.ereport("processCASbits", + fmt.Sprintf("%s constraints cannot be marked DEFERRABLE", constrType), loc) + } + } + if casBits&casInitiallyDeferred != 0 { + if initdeferred != nil { + *initdeferred = true + } else { + p.ereport("processCASbits", + fmt.Sprintf("%s constraints cannot be marked DEFERRABLE", constrType), loc) + } + } + if casBits&casNotValid != 0 { + if notValid != nil { + *notValid = true + } else { + p.ereport("processCASbits", + fmt.Sprintf("%s constraints cannot be marked NOT VALID", constrType), loc) + } + } + if casBits&casNoInherit != 0 { + if noInherit != nil { + *noInherit = true + } else { + p.ereport("processCASbits", + fmt.Sprintf("%s constraints cannot be marked NO INHERIT", constrType), loc) + } + } +} + +// parseConstraintElem is gram.y's ConstraintElem. The leading CONSTRAINT +// name (if any) is handled by the caller. +func (p *parser) parseConstraintElem() *ast.Constraint { + tok := p.peek() + n := &ast.Constraint{Location: tok.Start} + switch tok.Kind { + case ast.Token_CHECK: + p.next() + n.Contype = ast.ConstrType_CONSTR_CHECK + p.expect(ast.Token('(')) + n.RawExpr = p.parseAExpr(0) + p.expect(ast.Token(')')) + cas, casLoc := p.parseConstraintAttributeSpec() + p.processCASbits(cas, casLoc, "CHECK", nil, nil, &n.SkipValidation, &n.IsNoInherit) + n.InitiallyValid = !n.SkipValidation + case ast.Token_UNIQUE: + p.next() + n.Contype = ast.ConstrType_CONSTR_UNIQUE + if p.kind() == ast.Token_USING && p.kindN(1) == ast.Token_INDEX && + p.kindN(2) != ast.Token_TABLESPACE { + // gram.y: UNIQUE ExistingIndex + p.next() + p.next() + n.Indexname = p.name() + cas, casLoc := p.parseConstraintAttributeSpec() + p.processCASbits(cas, casLoc, "UNIQUE", &n.Deferrable, &n.Initdeferred, nil, nil) + break + } + n.NullsNotDistinct = !p.parseOptUniqueNullTreatment() + p.expect(ast.Token('(')) + n.Keys = p.columnList() + p.expect(ast.Token(')')) + n.Including = p.parseOptCInclude() + n.Options = p.parseOptDefinition() + n.Indexspace = p.parseOptConsTableSpace() + cas, casLoc := p.parseConstraintAttributeSpec() + p.processCASbits(cas, casLoc, "UNIQUE", &n.Deferrable, &n.Initdeferred, nil, nil) + case ast.Token_PRIMARY: + p.next() + p.expect(ast.Token_KEY) + n.Contype = ast.ConstrType_CONSTR_PRIMARY + if p.kind() == ast.Token_USING && p.kindN(1) == ast.Token_INDEX && + p.kindN(2) != ast.Token_TABLESPACE { + p.next() + p.next() + n.Indexname = p.name() + cas, casLoc := p.parseConstraintAttributeSpec() + p.processCASbits(cas, casLoc, "PRIMARY KEY", &n.Deferrable, &n.Initdeferred, nil, nil) + break + } + p.expect(ast.Token('(')) + n.Keys = p.columnList() + p.expect(ast.Token(')')) + n.Including = p.parseOptCInclude() + n.Options = p.parseOptDefinition() + n.Indexspace = p.parseOptConsTableSpace() + cas, casLoc := p.parseConstraintAttributeSpec() + p.processCASbits(cas, casLoc, "PRIMARY KEY", &n.Deferrable, &n.Initdeferred, nil, nil) + case ast.Token_EXCLUDE: + p.next() + n.Contype = ast.ConstrType_CONSTR_EXCLUSION + // access_method_clause + if p.have(ast.Token_USING) { + n.AccessMethod = p.name() + } else { + n.AccessMethod = "btree" // DEFAULT_INDEX_TYPE + } + p.expect(ast.Token('(')) + n.Exclusions = p.parseExclusionConstraintList() + p.expect(ast.Token(')')) + n.Including = p.parseOptCInclude() + n.Options = p.parseOptDefinition() + n.Indexspace = p.parseOptConsTableSpace() + if p.have(ast.Token_WHERE) { + p.expect(ast.Token('(')) + n.WhereClause = p.parseAExpr(0) + p.expect(ast.Token(')')) + } + cas, casLoc := p.parseConstraintAttributeSpec() + p.processCASbits(cas, casLoc, "EXCLUDE", &n.Deferrable, &n.Initdeferred, nil, nil) + case ast.Token_FOREIGN: + p.next() + p.expect(ast.Token_KEY) + n.Contype = ast.ConstrType_CONSTR_FOREIGN + p.expect(ast.Token('(')) + n.FkAttrs = p.columnList() + p.expect(ast.Token(')')) + p.expect(ast.Token_REFERENCES) + n.Pktable = p.parseQualifiedName() + if p.have(ast.Token('(')) { + n.PkAttrs = p.columnList() + p.expect(ast.Token(')')) + } + n.FkMatchtype = p.parseKeyMatch() + upd, del, delCols := p.parseKeyActions() + n.FkUpdAction = upd + n.FkDelAction = del + n.FkDelSetCols = delCols + cas, casLoc := p.parseConstraintAttributeSpec() + p.processCASbits(cas, casLoc, "FOREIGN KEY", &n.Deferrable, &n.Initdeferred, &n.SkipValidation, nil) + n.InitiallyValid = !n.SkipValidation + default: + p.syntaxErrorAt() + } + return n +} + +// parseOptCInclude is gram.y's opt_c_include. +func (p *parser) parseOptCInclude() []*ast.Node { + if p.have(ast.Token_INCLUDE) { + p.expect(ast.Token('(')) + cols := p.columnList() + p.expect(ast.Token(')')) + return cols + } + return nil +} + +// parseExclusionConstraintList is gram.y's ExclusionConstraintList. +func (p *parser) parseExclusionConstraintList() []*ast.Node { + list := []*ast.Node{p.parseExclusionConstraintElem()} + for p.have(ast.Token(',')) { + list = append(list, p.parseExclusionConstraintElem()) + } + return list +} + +// parseExclusionConstraintElem is gram.y's ExclusionConstraintElem: +// +// index_elem WITH any_operator | index_elem WITH OPERATOR '(' any_operator ')' +func (p *parser) parseExclusionConstraintElem() *ast.Node { + el := p.parseIndexElem() + p.expect(ast.Token_WITH) + var op []*ast.Node + if p.have(ast.Token_OPERATOR) { + p.expect(ast.Token('(')) + op = p.parseAnyOperator() + p.expect(ast.Token(')')) + } else { + op = p.parseAnyOperator() + } + return nList([]*ast.Node{el, nList(op)}) +} + +// parseOptPartitionSpec is gram.y's OptPartitionSpec. +func (p *parser) parseOptPartitionSpec() *ast.PartitionSpec { + if p.kind() != ast.Token_PARTITION { + return nil + } + tok := p.next() + p.expect(ast.Token_BY) + stok := p.peek() + strategy := p.colId() + n := &ast.PartitionSpec{Location: tok.Start} + // gram.y: parsePartitionStrategy + switch { + case strEqualsFold(strategy, "list"): + n.Strategy = ast.PartitionStrategy_PARTITION_STRATEGY_LIST + case strEqualsFold(strategy, "range"): + n.Strategy = ast.PartitionStrategy_PARTITION_STRATEGY_RANGE + case strEqualsFold(strategy, "hash"): + n.Strategy = ast.PartitionStrategy_PARTITION_STRATEGY_HASH + default: + p.fail(p.filter.ParserError("parsePartitionStrategy", + fmt.Sprintf("unrecognized partitioning strategy %q", strategy), -1)) + _ = stok + } + p.expect(ast.Token('(')) + n.PartParams = []*ast.Node{p.parsePartElem()} + for p.have(ast.Token(',')) { + n.PartParams = append(n.PartParams, p.parsePartElem()) + } + p.expect(ast.Token(')')) + return n +} + +// parsePartElem is gram.y's part_elem. +func (p *parser) parsePartElem() *ast.Node { + tok := p.peek() + n := &ast.PartitionElem{Location: tok.Start} + switch { + case tok.Kind == ast.Token('('): + p.next() + n.Expr = p.parseAExpr(0) + p.expect(ast.Token(')')) + case p.startsFunctionCallAhead(): + n.Expr = p.parseFuncExprWindowless() + default: + n.Name = p.colId() + } + if p.have(ast.Token_COLLATE) { + n.Collation = p.anyName() + } + if isColIdToken(p.peek()) { + n.Opclass = p.anyName() + } + return &ast.Node{Node: &ast.Node_PartitionElem{PartitionElem: n}} +} + +// parsePartitionBoundSpec is gram.y's PartitionBoundSpec. +func (p *parser) parsePartitionBoundSpec() *ast.PartitionBoundSpec { + if p.have(ast.Token_DEFAULT) { + return &ast.PartitionBoundSpec{IsDefault: true, Location: p.toks[p.pos-1].Start} + } + p.expect(ast.Token_FOR) + p.expect(ast.Token_VALUES) + tok := p.peek() + switch tok.Kind { + case ast.Token_WITH: + // hash partition + p.next() + p.expect(ast.Token('(')) + n := &ast.PartitionBoundSpec{ + Strategy: "h", // PARTITION_STRATEGY_HASH + Modulus: -1, Remainder: -1, + Location: tok.Start, + } + for { + etok := p.peek() + name := p.nonReservedWord() + itok := p.peek() + val := p.iconst() + _ = itok + switch name { + case "modulus": + if n.Modulus != -1 { + p.ereport("base_yyparse", "modulus for hash partition provided more than once", etok.Start) + } + n.Modulus = val + case "remainder": + if n.Remainder != -1 { + p.ereport("base_yyparse", "remainder for hash partition provided more than once", etok.Start) + } + n.Remainder = val + default: + p.ereport("base_yyparse", + fmt.Sprintf("unrecognized hash partition bound specification %q", name), etok.Start) + } + if !p.have(ast.Token(',')) { + break + } + } + p.expect(ast.Token(')')) + if n.Modulus == -1 { + p.ereport("base_yyparse", "modulus for hash partition must be specified", -1) + } + if n.Remainder == -1 { + p.ereport("base_yyparse", "remainder for hash partition must be specified", -1) + } + return n + case ast.Token_IN_P: + p.next() + p.expect(ast.Token('(')) + n := &ast.PartitionBoundSpec{ + Strategy: "l", // PARTITION_STRATEGY_LIST + Listdatums: p.parseExprList(), + Location: tok.Start, + } + p.expect(ast.Token(')')) + return n + case ast.Token_FROM: + p.next() + p.expect(ast.Token('(')) + n := &ast.PartitionBoundSpec{ + Strategy: "r", // PARTITION_STRATEGY_RANGE + Lowerdatums: p.parseExprList(), + Location: tok.Start, + } + p.expect(ast.Token(')')) + p.expect(ast.Token_TO) + p.expect(ast.Token('(')) + n.Upperdatums = p.parseExprList() + p.expect(ast.Token(')')) + return n + } + p.syntaxErrorAt() + return nil +} + +// strEqualsFold is pg_strcasecmp(a, b) == 0 for ASCII. +func strEqualsFold(a, b string) bool { + if len(a) != len(b) { + return false + } + for i := 0; i < len(a); i++ { + ca, cb := a[i], b[i] + if 'A' <= ca && ca <= 'Z' { + ca += 'a' - 'A' + } + if 'A' <= cb && cb <= 'Z' { + cb += 'a' - 'A' + } + if ca != cb { + return false + } + } + return true +} + +// parseCreateGenericOptions is gram.y's create_generic_options: +// +// OPTIONS '(' generic_option_list ')' | empty +func (p *parser) parseCreateGenericOptions() []*ast.Node { + if p.kind() != ast.Token_OPTIONS || p.kindN(1) != ast.Token('(') { + return nil + } + p.next() + p.next() + list := []*ast.Node{p.parseGenericOptionElem()} + for p.have(ast.Token(',')) { + list = append(list, p.parseGenericOptionElem()) + } + p.expect(ast.Token(')')) + return list +} + +// parseGenericOptionElem is gram.y's generic_option_elem: +// +// generic_option_name generic_option_arg +func (p *parser) parseGenericOptionElem() *ast.Node { + tok := p.peek() + name := p.colLabel() + return makeDefElem(name, nStr(p.sconst()), tok.Start) +} + +// parseCreateSeqStmt is gram.y's CreateSeqStmt; CREATE OptTemp consumed, +// SEQUENCE not. +func (p *parser) parseCreateSeqStmt(persistence string) *ast.Node { + p.expect(ast.Token_SEQUENCE) + n := &ast.CreateSeqStmt{} + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + n.IfNotExists = true + } + n.Sequence = p.parseQualifiedName() + n.Sequence.Relpersistence = persistence + if p.seqOptElemStarts() { + n.Options = p.parseSeqOptList() + } + return &ast.Node{Node: &ast.Node_CreateSeqStmt{CreateSeqStmt: n}} +} + +// seqOptElemStarts reports whether the lookahead begins a SeqOptElem. +func (p *parser) seqOptElemStarts() bool { + switch p.kind() { + case ast.Token_AS, ast.Token_CACHE, ast.Token_CYCLE, ast.Token_INCREMENT, + ast.Token_LOGGED, ast.Token_MAXVALUE, ast.Token_MINVALUE, + ast.Token_OWNED, ast.Token_SEQUENCE, ast.Token_START, + ast.Token_RESTART, ast.Token_UNLOGGED: + return true + case ast.Token_NO: + switch p.kindN(1) { + case ast.Token_CYCLE, ast.Token_MAXVALUE, ast.Token_MINVALUE: + return true + } + } + return false +} + +// parseSeqOptList is gram.y's SeqOptList: one or more SeqOptElem. +func (p *parser) parseSeqOptList() []*ast.Node { + list := []*ast.Node{p.parseSeqOptElem()} + for p.seqOptElemStarts() { + list = append(list, p.parseSeqOptElem()) + } + return list +} + +// parseSeqOptElem is gram.y's SeqOptElem. +func (p *parser) parseSeqOptElem() *ast.Node { + tok := p.peek() + switch tok.Kind { + case ast.Token_AS: + p.next() + return makeDefElem("as", nTypeName(p.parseSimpleTypename()), tok.Start) + case ast.Token_CACHE: + p.next() + return makeDefElem("cache", p.parseNumericOnly(), tok.Start) + case ast.Token_CYCLE: + p.next() + return makeDefElem("cycle", nBoolean(true), tok.Start) + case ast.Token_NO: + p.next() + switch { + case p.have(ast.Token_CYCLE): + return makeDefElem("cycle", nBoolean(false), tok.Start) + case p.have(ast.Token_MAXVALUE): + return makeDefElem("maxvalue", nil, tok.Start) + case p.have(ast.Token_MINVALUE): + return makeDefElem("minvalue", nil, tok.Start) + } + p.syntaxErrorAt() + case ast.Token_INCREMENT: + p.next() + p.have(ast.Token_BY) + return makeDefElem("increment", p.parseNumericOnly(), tok.Start) + case ast.Token_LOGGED: + p.next() + return makeDefElem("logged", nil, tok.Start) + case ast.Token_MAXVALUE: + p.next() + return makeDefElem("maxvalue", p.parseNumericOnly(), tok.Start) + case ast.Token_MINVALUE: + p.next() + return makeDefElem("minvalue", p.parseNumericOnly(), tok.Start) + case ast.Token_OWNED: + p.next() + p.expect(ast.Token_BY) + return makeDefElem("owned_by", nList(p.anyName()), tok.Start) + case ast.Token_SEQUENCE: + p.next() + p.expect(ast.Token_NAME_P) + return makeDefElem("sequence_name", nList(p.anyName()), tok.Start) + case ast.Token_START: + p.next() + p.parseOptWith() + return makeDefElem("start", p.parseNumericOnly(), tok.Start) + case ast.Token_RESTART: + p.next() + switch p.kind() { + case ast.Token_WITH, ast.Token_WITH_LA, ast.Token_ICONST, + ast.Token_FCONST, ast.Token('+'), ast.Token('-'): + p.parseOptWith() + return makeDefElem("restart", p.parseNumericOnly(), tok.Start) + } + return makeDefElem("restart", nil, tok.Start) + case ast.Token_UNLOGGED: + p.next() + return makeDefElem("unlogged", nil, tok.Start) + } + p.syntaxErrorAt() + return nil +} + +// parseViewStmt is gram.y's ViewStmt. CREATE [OR REPLACE] [OptTemp] is +// consumed; [RECURSIVE] VIEW is not. +func (p *parser) parseViewStmt(replace bool, persistence string) *ast.Node { + n := &ast.ViewStmt{Replace: replace} + recursive := p.have(ast.Token_RECURSIVE) + p.expect(ast.Token_VIEW) + n.View = p.parseQualifiedName() + n.View.Relpersistence = persistence + if recursive { + p.expect(ast.Token('(')) + n.Aliases = p.columnList() + p.expect(ast.Token(')')) + } else if p.have(ast.Token('(')) { + n.Aliases = p.columnList() + p.expect(ast.Token(')')) + } + if p.kind() == ast.Token_WITH && p.kindN(1) == ast.Token('(') { + p.next() + n.Options = p.parseReloptions() + } + p.expect(ast.Token_AS) + query := p.parseSelectStmt() + // opt_check_option + n.WithCheckOption = ast.ViewCheckOption_NO_CHECK_OPTION + if p.kind() == ast.Token_WITH || p.kind() == ast.Token_WITH_LA { + ctok := p.peekN(1) + switch ctok.Kind { + case ast.Token_CHECK: + p.next() + p.next() + p.expect(ast.Token_OPTION) + n.WithCheckOption = ast.ViewCheckOption_CASCADED_CHECK_OPTION + case ast.Token_CASCADED: + p.next() + p.next() + p.expect(ast.Token_CHECK) + p.expect(ast.Token_OPTION) + n.WithCheckOption = ast.ViewCheckOption_CASCADED_CHECK_OPTION + case ast.Token_LOCAL: + p.next() + p.next() + p.expect(ast.Token_CHECK) + p.expect(ast.Token_OPTION) + n.WithCheckOption = ast.ViewCheckOption_LOCAL_CHECK_OPTION + } + } + if recursive { + if n.WithCheckOption != ast.ViewCheckOption_NO_CHECK_OPTION { + p.ereport("base_yyparse", "WITH CHECK OPTION not supported on recursive views", -1) + } + n.Query = makeRecursiveViewSelect(n.View.Relname, n.Aliases, query) + } else { + n.Query = query + } + return &ast.Node{Node: &ast.Node_ViewStmt{ViewStmt: n}} +} + +// makeRecursiveViewSelect wraps a recursive view's query in +// WITH RECURSIVE name (aliases) AS (query) SELECT aliases FROM name, +// mirroring gram.y's support function of the same name. +func makeRecursiveViewSelect(relname string, aliases []*ast.Node, query *ast.Node) *ast.Node { + cte := &ast.CommonTableExpr{ + Ctename: relname, + Aliascolnames: aliases, + Ctematerialized: ast.CTEMaterialize_CTEMaterializeDefault, + Ctequery: query, + Location: -1, + } + w := &ast.WithClause{ + Recursive: true, + Ctes: []*ast.Node{nCommonTableExpr(cte)}, + Location: -1, + } + var tl []*ast.Node + for _, a := range aliases { + tl = append(tl, nResTarget(&ast.ResTarget{ + Val: nColumnRef(&ast.ColumnRef{ + Fields: []*ast.Node{nStr(asString(a).Sval)}, + Location: -1, + }), + Location: -1, + })) + } + s := &ast.SelectStmt{ + WithClause: w, + TargetList: tl, + FromClause: []*ast.Node{nRangeVar(makeRangeVar("", relname, -1))}, + LimitOption: ast.LimitOption_LIMIT_OPTION_DEFAULT, + Op: ast.SetOperation_SETOP_NONE, + } + return nSelectStmt(s) +} + +// parseIndexStmt is gram.y's IndexStmt. CREATE is consumed; [UNIQUE] INDEX +// is not. +func (p *parser) parseIndexStmt() *ast.Node { + n := &ast.IndexStmt{} + n.Unique = p.have(ast.Token_UNIQUE) + p.expect(ast.Token_INDEX) + n.Concurrent = p.have(ast.Token_CONCURRENTLY) + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + n.IfNotExists = true + n.Idxname = p.name() + } else if p.kind() != ast.Token_ON { + n.Idxname = p.name() + } + p.expect(ast.Token_ON) + rel := p.parseRelationExpr() + n.Relation = rel.GetRangeVar() + if p.have(ast.Token_USING) { + n.AccessMethod = p.name() + } else { + n.AccessMethod = "btree" // DEFAULT_INDEX_TYPE + } + p.expect(ast.Token('(')) + n.IndexParams = p.parseIndexParams() + p.expect(ast.Token(')')) + if p.have(ast.Token_INCLUDE) { + p.expect(ast.Token('(')) + n.IndexIncludingParams = p.parseIndexParams() + p.expect(ast.Token(')')) + } + n.NullsNotDistinct = !p.parseOptUniqueNullTreatment() + if p.kind() == ast.Token_WITH && p.kindN(1) == ast.Token('(') { + p.next() + n.Options = p.parseReloptions() + } + if p.have(ast.Token_TABLESPACE) { + n.TableSpace = p.name() + } + if p.have(ast.Token_WHERE) { + n.WhereClause = p.parseAExpr(0) + } + return &ast.Node{Node: &ast.Node_IndexStmt{IndexStmt: n}} +} + +// parseCreateMatViewStmt is gram.y's CreateMatViewStmt. CREATE [UNLOGGED] +// is consumed; MATERIALIZED VIEW is not. +func (p *parser) parseCreateMatViewStmt(persistence string) *ast.Node { + p.expect(ast.Token_MATERIALIZED) + p.expect(ast.Token_VIEW) + ctas := &ast.CreateTableAsStmt{ + Objtype: ast.ObjectType_OBJECT_MATVIEW, + } + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + ctas.IfNotExists = true + } + // create_mv_target: qualified_name opt_column_list + // table_access_method_clause opt_reloptions OptTableSpace + rel := p.parseQualifiedName() + rel.Relpersistence = persistence + into := &ast.IntoClause{Rel: rel, OnCommit: ast.OnCommitAction_ONCOMMIT_NOOP} + if p.have(ast.Token('(')) { + into.ColNames = p.columnList() + p.expect(ast.Token(')')) + } + if p.have(ast.Token_USING) { + into.AccessMethod = p.name() + } + if p.kind() == ast.Token_WITH && p.kindN(1) == ast.Token('(') { + p.next() + into.Options = p.parseReloptions() + } + if p.have(ast.Token_TABLESPACE) { + into.TableSpaceName = p.name() + } + ctas.Into = into + p.expect(ast.Token_AS) + ctas.Query = p.parseSelectStmt() + into.SkipData = !p.parseOptWithData() + return &ast.Node{Node: &ast.Node_CreateTableAsStmt{CreateTableAsStmt: ctas}} +} + +// parseRefreshMatViewStmt is gram.y's RefreshMatViewStmt. +func (p *parser) parseRefreshMatViewStmt() *ast.Node { + p.expect(ast.Token_REFRESH) + p.expect(ast.Token_MATERIALIZED) + p.expect(ast.Token_VIEW) + n := &ast.RefreshMatViewStmt{} + n.Concurrent = p.have(ast.Token_CONCURRENTLY) + n.Relation = p.parseQualifiedName() + n.SkipData = !p.parseOptWithData() + return &ast.Node{Node: &ast.Node_RefreshMatViewStmt{RefreshMatViewStmt: n}} +} diff --git a/internal/parse/ddl_define.go b/internal/parse/ddl_define.go new file mode 100644 index 0000000..47560e5 --- /dev/null +++ b/internal/parse/ddl_define.go @@ -0,0 +1,285 @@ +package parse + +// DefineStmt (CREATE AGGREGATE/OPERATOR/TYPE/TEXT SEARCH .../COLLATION), +// CompositeTypeStmt, CreateEnumStmt, CreateRangeStmt, CreateStatsStmt, +// and the operator class family. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +func nDefineStmt(n *ast.DefineStmt) *ast.Node { + return &ast.Node{Node: &ast.Node_DefineStmt{DefineStmt: n}} +} + +// parseCreateAggregateStmt is gram.y's DefineStmt AGGREGATE arms; CREATE +// [OR REPLACE] AGGREGATE consumed. +func (p *parser) parseCreateAggregateStmt(replace bool) *ast.Node { + n := &ast.DefineStmt{ + Kind: ast.ObjectType_OBJECT_AGGREGATE, + Replace: replace, + Defnames: p.parseFuncName(p.peek()), + } + // New style has aggr_args then definition; old style has '(' IDENT '=' + // ... ')' directly. Disambiguate on the token after '(': old_aggr_elem + // requires IDENT '='. + if p.kindN(1) == ast.Token_IDENT && p.kindN(2) == ast.Token('=') { + n.Oldstyle = true + p.expect(ast.Token('(')) + for { + etok := p.peek() + name := p.expect(ast.Token_IDENT).Str + p.expect(ast.Token('=')) + n.Definition = append(n.Definition, makeDefElem(name, p.parseDefArg(), etok.Start)) + if !p.have(ast.Token(',')) { + break + } + } + p.expect(ast.Token(')')) + return nDefineStmt(n) + } + params, ndirect := p.parseAggrArgs() + // The zero-argument '(*)' form stores NIL — a null list element — not + // an empty List node. + argsNode := &ast.Node{} + if params != nil { + argsNode = nList(params) + } + n.Args = []*ast.Node{argsNode, nInteger(ndirect)} + n.Definition = p.parseDefinition() + return nDefineStmt(n) +} + +// parseCreateOperatorStmt handles CREATE OPERATOR: the DefineStmt arm plus +// the CLASS/FAMILY statements; CREATE OPERATOR consumed. +func (p *parser) parseCreateOperatorStmt() *ast.Node { + switch p.kind() { + case ast.Token_CLASS: + // gram.y: CreateOpClassStmt + p.next() + n := &ast.CreateOpClassStmt{Opclassname: p.anyName()} + n.IsDefault = p.have(ast.Token_DEFAULT) + p.expect(ast.Token_FOR) + p.expect(ast.Token_TYPE_P) + n.Datatype = p.parseTypename() + p.expect(ast.Token_USING) + n.Amname = p.name() + if p.have(ast.Token_FAMILY) { + n.Opfamilyname = p.anyName() + } + p.expect(ast.Token_AS) + n.Items = p.parseOpclassItemList() + return &ast.Node{Node: &ast.Node_CreateOpClassStmt{CreateOpClassStmt: n}} + case ast.Token_FAMILY: + // gram.y: CreateOpFamilyStmt + p.next() + n := &ast.CreateOpFamilyStmt{Opfamilyname: p.anyName()} + p.expect(ast.Token_USING) + n.Amname = p.name() + return &ast.Node{Node: &ast.Node_CreateOpFamilyStmt{CreateOpFamilyStmt: n}} + } + // gram.y: DefineStmt: CREATE OPERATOR any_operator definition + n := &ast.DefineStmt{ + Kind: ast.ObjectType_OBJECT_OPERATOR, + Defnames: p.parseAnyOperator(), + Definition: p.parseDefinition(), + } + return nDefineStmt(n) +} + +// parseCreateTypeStmt is gram.y's DefineStmt TYPE_P arms; CREATE TYPE_P +// consumed. +func (p *parser) parseCreateTypeStmt() *ast.Node { + ntok := p.peek() + names := p.anyName() + switch p.kind() { + case ast.Token('('): + n := &ast.DefineStmt{ + Kind: ast.ObjectType_OBJECT_TYPE, + Defnames: names, + Definition: p.parseDefinition(), + } + return nDefineStmt(n) + case ast.Token_AS: + p.next() + switch p.kind() { + case ast.Token_ENUM_P: + p.next() + n := &ast.CreateEnumStmt{TypeName: names} + p.expect(ast.Token('(')) + if p.kind() != ast.Token(')') { + n.Vals = append(n.Vals, nStr(p.sconst())) + for p.have(ast.Token(',')) { + n.Vals = append(n.Vals, nStr(p.sconst())) + } + } + p.expect(ast.Token(')')) + return &ast.Node{Node: &ast.Node_CreateEnumStmt{CreateEnumStmt: n}} + case ast.Token_RANGE: + p.next() + n := &ast.CreateRangeStmt{TypeName: names, Params: p.parseDefinition()} + return &ast.Node{Node: &ast.Node_CreateRangeStmt{CreateRangeStmt: n}} + } + // gram.y: CompositeTypeStmt + return p.parseCompositeTypeStmt(names, ntok.Start) + } + // Shell type. + return nDefineStmt(&ast.DefineStmt{ + Kind: ast.ObjectType_OBJECT_TYPE, + Defnames: names, + }) +} + +// parseCompositeTypeStmt finishes CREATE TYPE any_name AS '(' ... ')'; the +// caller consumed AS and passes the any_name with its start location (@3). +func (p *parser) parseCompositeTypeStmt(names []*ast.Node, nameLoc int32) *ast.Node { + n := &ast.CompositeTypeStmt{} + n.Typevar = p.makeRangeVarFromAnyName(names, nameLoc) + p.expect(ast.Token('(')) + if p.kind() != ast.Token(')') { + n.Coldeflist = p.parseTableFuncElementList() + } + p.expect(ast.Token(')')) + return &ast.Node{Node: &ast.Node_CompositeTypeStmt{CompositeTypeStmt: n}} +} + +// parseOpclassItemList is gram.y's opclass_item_list. +func (p *parser) parseOpclassItemList() []*ast.Node { + list := []*ast.Node{p.parseOpclassItem()} + for p.have(ast.Token(',')) { + list = append(list, p.parseOpclassItem()) + } + return list +} + +// OPCLASS_ITEM_* constants (parsenodes.h). +const ( + opclassItemOperator = 1 + opclassItemFunction = 2 + opclassItemStorageType = 3 +) + +// parseOpclassItem is gram.y's opclass_item. +func (p *parser) parseOpclassItem() *ast.Node { + n := &ast.CreateOpClassItem{} + switch { + case p.have(ast.Token_OPERATOR): + n.Itemtype = opclassItemOperator + n.Number = p.iconst() + op := p.parseAnyOperator() + if p.kind() == ast.Token('(') { + n.Name = &ast.ObjectWithArgs{Objname: op, Objargs: p.parseOperArgtypes()} + } else { + n.Name = &ast.ObjectWithArgs{Objname: op} + } + // opclass_purpose + if p.kind() == ast.Token_FOR { + p.next() + switch { + case p.have(ast.Token_SEARCH): + case p.have(ast.Token_ORDER): + p.expect(ast.Token_BY) + n.OrderFamily = p.anyName() + default: + p.syntaxErrorAt() + } + } + p.have(ast.Token_RECHECK) + case p.have(ast.Token_FUNCTION): + n.Itemtype = opclassItemFunction + n.Number = p.iconst() + if p.kind() == ast.Token('(') { + // function_with_argtypes starts with a func_name, never '(', + // so this must be the '(' type_list ')' prefix. + p.next() + n.ClassArgs = p.parseTypeList() + p.expect(ast.Token(')')) + } + n.Name = p.parseFunctionWithArgtypes().GetObjectWithArgs() + case p.have(ast.Token_STORAGE): + n.Itemtype = opclassItemStorageType + n.Storedtype = p.parseTypename() + default: + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_CreateOpClassItem{CreateOpClassItem: n}} +} + +// parseAlterOpFamilyStmt is gram.y's AlterOpFamilyStmt; ALTER OPERATOR +// FAMILY any_name USING name consumed and passed as obj (family name last +// as in the object list convention). +func (p *parser) parseAlterOpFamilyStmtImpl(opfamilyname []*ast.Node, amname string) *ast.Node { + n := &ast.AlterOpFamilyStmt{Opfamilyname: opfamilyname, Amname: amname} + switch { + case p.have(ast.Token_ADD_P): + n.Items = p.parseOpclassItemList() + case p.have(ast.Token_DROP): + n.IsDrop = true + // opclass_drop_list + for { + d := &ast.CreateOpClassItem{} + switch { + case p.have(ast.Token_OPERATOR): + d.Itemtype = opclassItemOperator + case p.have(ast.Token_FUNCTION): + d.Itemtype = opclassItemFunction + default: + p.syntaxErrorAt() + } + d.Number = p.iconst() + p.expect(ast.Token('(')) + d.ClassArgs = p.parseTypeList() + p.expect(ast.Token(')')) + n.Items = append(n.Items, + &ast.Node{Node: &ast.Node_CreateOpClassItem{CreateOpClassItem: d}}) + if !p.have(ast.Token(',')) { + break + } + } + default: + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_AlterOpFamilyStmt{AlterOpFamilyStmt: n}} +} + +// parseCreateStatsStmt is gram.y's CreateStatsStmt; CREATE STATISTICS +// consumed. +func (p *parser) parseCreateStatsStmt() *ast.Node { + n := &ast.CreateStatsStmt{} + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + n.IfNotExists = true + n.Defnames = p.anyName() + } else if p.kind() != ast.Token_ON && p.kind() != ast.Token('(') { + n.Defnames = p.anyName() + } + if p.have(ast.Token('(')) { + n.StatTypes = p.nameList() + p.expect(ast.Token(')')) + } + p.expect(ast.Token_ON) + n.Exprs = []*ast.Node{p.parseStatsParam()} + for p.have(ast.Token(',')) { + n.Exprs = append(n.Exprs, p.parseStatsParam()) + } + p.expect(ast.Token_FROM) + n.Relations = p.parseFromList() + return &ast.Node{Node: &ast.Node_CreateStatsStmt{CreateStatsStmt: n}} +} + +// parseStatsParam is gram.y's stats_param. +func (p *parser) parseStatsParam() *ast.Node { + n := &ast.StatsElem{} + switch { + case p.kind() == ast.Token('('): + p.next() + n.Expr = p.parseAExpr(0) + p.expect(ast.Token(')')) + case p.startsFunctionCallAhead(): + n.Expr = p.parseFuncExprWindowless() + default: + n.Name = p.colId() + } + return &ast.Node{Node: &ast.Node_StatsElem{StatsElem: n}} +} diff --git a/internal/parse/ddl_dispatch.go b/internal/parse/ddl_dispatch.go new file mode 100644 index 0000000..a6c904d --- /dev/null +++ b/internal/parse/ddl_dispatch.go @@ -0,0 +1,535 @@ +package parse + +// Statement dispatch for the CREATE/ALTER/DROP families. gram.y keeps every +// alternative alive in the LALR tables; the recursive-descent port picks the +// production from one or two tokens of lookahead past the head keyword. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +// parseCreateDispatch routes a statement beginning with CREATE. The CREATE +// token is not yet consumed. +func (p *parser) parseCreateDispatch() *ast.Node { + p.expect(ast.Token_CREATE) + switch p.kind() { + case ast.Token_ROLE: + return p.parseCreateRoleStmt(ast.RoleStmtType_ROLESTMT_ROLE) + case ast.Token_USER: + if p.kindN(1) == ast.Token_MAPPING { + p.next() + p.next() + return p.parseCreateUserMappingStmt() + } + return p.parseCreateRoleStmt(ast.RoleStmtType_ROLESTMT_USER) + case ast.Token_GROUP_P: + return p.parseCreateRoleStmt(ast.RoleStmtType_ROLESTMT_GROUP) + case ast.Token_SCHEMA: + p.next() + return p.parseCreateSchemaStmt() + case ast.Token_CAST: + p.next() + return p.parseCreateCastStmt() + case ast.Token_FUNCTION, ast.Token_PROCEDURE: + return p.parseCreateFunctionStmt(false) + case ast.Token_DOMAIN_P: + p.next() + return p.parseCreateDomainStmt() + case ast.Token_DATABASE: + p.next() + return p.parseCreatedbStmt() + case ast.Token_EXTENSION: + p.next() + return p.parseCreateExtensionStmt() + case ast.Token_EVENT: + if p.kindN(1) == ast.Token_TRIGGER { + p.next() + p.next() + return p.parseCreateEventTrigStmt() + } + case ast.Token_POLICY: + p.next() + return p.parseCreatePolicyStmt() + case ast.Token_PUBLICATION: + p.next() + return p.parseCreatePublicationStmt() + case ast.Token_FOREIGN: + switch p.kindN(1) { + case ast.Token_DATA_P: + p.next() + p.next() + p.expect(ast.Token_WRAPPER) + return p.parseCreateFdwStmt() + case ast.Token_TABLE: + p.next() + p.next() + return p.parseCreateForeignTableStmt() + } + case ast.Token_SERVER: + p.next() + return p.parseCreateForeignServerStmt() + case ast.Token_SUBSCRIPTION: + p.next() + return p.parseCreateSubscriptionStmt() + case ast.Token_AGGREGATE: + p.next() + return p.parseCreateAggregateStmt(false) + case ast.Token_OPERATOR: + p.next() + return p.parseCreateOperatorStmt() + case ast.Token_TYPE_P: + p.next() + return p.parseCreateTypeStmt() + case ast.Token_STATISTICS: + p.next() + return p.parseCreateStatsStmt() + case ast.Token_COLLATION: + // gram.y: DefineStmt COLLATION arms + p.next() + n := &ast.DefineStmt{Kind: ast.ObjectType_OBJECT_COLLATION} + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + n.IfNotExists = true + } + n.Defnames = p.anyName() + if ftok := p.peek(); ftok.Kind == ast.Token_FROM { + p.next() + ntok := p.peek() + n.Definition = []*ast.Node{makeDefElem("from", nList(p.anyName()), ntok.Start)} + } else { + n.Definition = p.parseDefinition() + } + return nDefineStmt(n) + case ast.Token_TEXT_P: + if p.kindN(1) == ast.Token_SEARCH { + p.next() + p.next() + var kind ast.ObjectType + switch p.kind() { + case ast.Token_PARSER: + kind = ast.ObjectType_OBJECT_TSPARSER + case ast.Token_DICTIONARY: + kind = ast.ObjectType_OBJECT_TSDICTIONARY + case ast.Token_TEMPLATE: + kind = ast.ObjectType_OBJECT_TSTEMPLATE + case ast.Token_CONFIGURATION: + kind = ast.ObjectType_OBJECT_TSCONFIGURATION + default: + p.syntaxErrorAt() + } + p.next() + return nDefineStmt(&ast.DefineStmt{ + Kind: kind, + Defnames: p.anyName(), + Definition: p.parseDefinition(), + }) + } + case ast.Token_ACCESS: + if p.kindN(1) == ast.Token_METHOD { + p.next() + p.next() + return p.parseCreateAmStmt() + } + case ast.Token_RULE: + p.next() + return p.parseRuleStmt(false) + case ast.Token_TRUSTED, ast.Token_PROCEDURAL, ast.Token_LANGUAGE: + return p.parseCreatePLangStmt(false) + case ast.Token_TABLESPACE: + p.next() + return p.parseCreateTableSpaceStmt() + case ast.Token_CONVERSION_P: + p.next() + return p.parseCreateConversionStmt(false) + case ast.Token_DEFAULT: + if p.kindN(1) == ast.Token_CONVERSION_P { + p.next() + p.next() + return p.parseCreateConversionStmt(true) + } + case ast.Token_TRANSFORM: + p.next() + return p.parseCreateTransformStmt(false) + case ast.Token_ASSERTION: + // gram.y: CreateAssertionStmt always errors (no position). + p.next() + p.anyName() + p.expect(ast.Token_CHECK) + p.expect(ast.Token('(')) + p.parseAExpr(0) + p.expect(ast.Token(')')) + p.parseConstraintAttributeSpec() + p.ereport("base_yyparse", "CREATE ASSERTION is not yet implemented", -1) + } + if stmt := p.parseCreateStmtFamily(false); stmt != nil { + return stmt + } + p.syntaxErrorAt() + return nil +} + +// parseCreateStmtFamily handles the CREATE statements that can also appear +// as CREATE SCHEMA elements (CreateStmt, IndexStmt, CreateSeqStmt, +// CreateTrigStmt, ViewStmt) plus, when schemaElt is false, the rest of the +// CREATE family. The CREATE token has been consumed. Returns nil when the +// lookahead matches nothing implemented. +func (p *parser) parseCreateStmtFamily(schemaElt bool) *ast.Node { + switch p.kind() { + case ast.Token_TEMPORARY, ast.Token_TEMP, ast.Token_LOCAL, + ast.Token_GLOBAL, ast.Token_UNLOGGED: + // OptTemp: heads CreateStmt, CreateAsStmt, ViewStmt, CreateSeqStmt. + return p.parseOptTempHeadedCreate(schemaElt) + case ast.Token_TABLE: + return p.parseCreateTableOrAs(p.parseOptTempAfterCreate()) + case ast.Token_UNIQUE: + if p.kindN(1) == ast.Token_INDEX { + return p.parseIndexStmt() + } + case ast.Token_INDEX: + return p.parseIndexStmt() + case ast.Token_SEQUENCE: + return p.parseCreateSeqStmt(relPersistPermanent) + case ast.Token_VIEW: + return p.parseViewStmt(false, relPersistPermanent) + case ast.Token_RECURSIVE: + if p.kindN(1) == ast.Token_VIEW { + return p.parseViewStmt(false, relPersistPermanent) + } + case ast.Token_OR: + if p.kindN(1) == ast.Token_REPLACE { + return p.parseCreateOrReplace(schemaElt) + } + case ast.Token_TRIGGER: + return p.parseCreateTrigStmt(false, false) + case ast.Token_CONSTRAINT: + if p.kindN(1) == ast.Token_TRIGGER { + p.next() + return p.parseCreateTrigStmt(false, true) + } + case ast.Token_MATERIALIZED: + if !schemaElt { + return p.parseCreateMatViewStmt(relPersistPermanent) + } + } + return nil +} + +// parseCreateOrReplace handles CREATE OR REPLACE ...; CREATE is consumed, +// OR REPLACE not yet. +func (p *parser) parseCreateOrReplace(schemaElt bool) *ast.Node { + p.next() // OR + p.next() // REPLACE + switch p.kind() { + case ast.Token_TEMPORARY, ast.Token_TEMP, ast.Token_LOCAL, + ast.Token_GLOBAL, ast.Token_UNLOGGED: + persistence := p.parseOptTempAfterCreate() + if p.kind() == ast.Token_VIEW || (p.kind() == ast.Token_RECURSIVE && p.kindN(1) == ast.Token_VIEW) { + return p.parseViewStmt(true, persistence) + } + case ast.Token_VIEW, ast.Token_RECURSIVE: + if p.kind() == ast.Token_VIEW || p.kindN(1) == ast.Token_VIEW { + return p.parseViewStmt(true, relPersistPermanent) + } + case ast.Token_TRIGGER: + return p.parseCreateTrigStmt(true, false) + case ast.Token_CONSTRAINT: + if p.kindN(1) == ast.Token_TRIGGER { + p.next() + return p.parseCreateTrigStmt(true, true) + } + case ast.Token_FUNCTION, ast.Token_PROCEDURE: + return p.parseCreateFunctionStmt(true) + case ast.Token_AGGREGATE: + p.next() + return p.parseCreateAggregateStmt(true) + case ast.Token_RULE: + p.next() + return p.parseRuleStmt(true) + case ast.Token_TRUSTED, ast.Token_PROCEDURAL, ast.Token_LANGUAGE: + return p.parseCreatePLangStmt(true) + case ast.Token_TRANSFORM: + p.next() + return p.parseCreateTransformStmt(true) + } + p.syntaxErrorAt() + return nil +} + +// parseOptTempHeadedCreate parses a CREATE statement whose next token is an +// OptTemp keyword: CREATE [OptTemp] TABLE/SEQUENCE/VIEW. +func (p *parser) parseOptTempHeadedCreate(schemaElt bool) *ast.Node { + persistence := p.parseOptTempAfterCreate() + switch p.kind() { + case ast.Token_TABLE: + return p.parseCreateTableOrAs(persistence) + case ast.Token_SEQUENCE: + return p.parseCreateSeqStmt(persistence) + case ast.Token_VIEW: + return p.parseViewStmt(false, persistence) + case ast.Token_RECURSIVE: + if p.kindN(1) == ast.Token_VIEW { + return p.parseViewStmt(false, persistence) + } + case ast.Token_MATERIALIZED: + // CREATE UNLOGGED MATERIALIZED VIEW (OptNoLog) + if persistence == relPersistUnlogged { + return p.parseCreateMatViewStmt(persistence) + } + } + p.syntaxErrorAt() + return nil +} + +// parseOptTempAfterCreate is gram.y's OptTemp, with TABLE (or SEQUENCE or +// VIEW) still ahead. +func (p *parser) parseOptTempAfterCreate() string { + switch p.kind() { + case ast.Token_TEMPORARY, ast.Token_TEMP: + p.next() + return relPersistTemp + case ast.Token_LOCAL: + p.next() + switch p.kind() { + case ast.Token_TEMPORARY, ast.Token_TEMP: + p.next() + return relPersistTemp + } + p.syntaxErrorAt() + case ast.Token_GLOBAL: + // GLOBAL TEMPORARY/TEMP: deprecated but accepted; gram.y warns and + // treats it as TEMP (a warning is not part of the parse result). + p.next() + switch p.kind() { + case ast.Token_TEMPORARY, ast.Token_TEMP: + p.next() + return relPersistTemp + } + p.syntaxErrorAt() + case ast.Token_UNLOGGED: + p.next() + return relPersistUnlogged + } + return relPersistPermanent +} + +// parseDropDispatch routes a statement beginning with DROP: DropStmt and +// the specialized Drop*/Remove* productions. The DROP token is not yet +// consumed. +func (p *parser) parseDropDispatch() *ast.Node { + p.expect(ast.Token_DROP) + switch p.kind() { + case ast.Token_ROLE, ast.Token_GROUP_P: + p.next() + return p.parseDropRoleStmt() + case ast.Token_USER: + if p.kindN(1) == ast.Token_MAPPING { + // gram.y: DropUserMappingStmt + p.next() + p.next() + n := &ast.DropUserMappingStmt{MissingOk: p.parseDropIfExists()} + p.expect(ast.Token_FOR) + n.User = p.parseAuthIdent() + p.expect(ast.Token_SERVER) + n.Servername = p.name() + return &ast.Node{Node: &ast.Node_DropUserMappingStmt{DropUserMappingStmt: n}} + } + p.next() + return p.parseDropRoleStmt() + + case ast.Token_TYPE_P: + // gram.y: DropStmt: DROP TYPE_P type_name_list + p.next() + n := newDropStmt(ast.ObjectType_OBJECT_TYPE) + n.MissingOk = p.parseDropIfExists() + n.Objects = p.parseTypeNameList() + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + case ast.Token_DOMAIN_P: + p.next() + n := newDropStmt(ast.ObjectType_OBJECT_DOMAIN) + n.MissingOk = p.parseDropIfExists() + n.Objects = p.parseTypeNameList() + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + + case ast.Token_INDEX: + if p.kindN(1) == ast.Token_CONCURRENTLY { + p.next() + p.next() + n := newDropStmt(ast.ObjectType_OBJECT_INDEX) + n.Concurrent = true + n.MissingOk = p.parseDropIfExists() + n.Objects = p.parseAnyNameList() + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + } + + case ast.Token_FUNCTION, ast.Token_PROCEDURE, ast.Token_ROUTINE: + // gram.y: RemoveFuncStmt + var objtype ast.ObjectType + switch p.next().Kind { + case ast.Token_FUNCTION: + objtype = ast.ObjectType_OBJECT_FUNCTION + case ast.Token_PROCEDURE: + objtype = ast.ObjectType_OBJECT_PROCEDURE + default: + objtype = ast.ObjectType_OBJECT_ROUTINE + } + n := newDropStmt(objtype) + n.MissingOk = p.parseDropIfExists() + n.Objects = p.parseFunctionWithArgtypesList() + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + + case ast.Token_AGGREGATE: + // gram.y: RemoveAggrStmt + p.next() + n := newDropStmt(ast.ObjectType_OBJECT_AGGREGATE) + n.MissingOk = p.parseDropIfExists() + n.Objects = p.parseAggregateWithArgtypesList() + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + + case ast.Token_OPERATOR: + p.next() + switch p.kind() { + case ast.Token_CLASS, ast.Token_FAMILY: + // gram.y: DropOpClassStmt / DropOpFamilyStmt + objtype := ast.ObjectType_OBJECT_OPCLASS + if p.next().Kind == ast.Token_FAMILY { + objtype = ast.ObjectType_OBJECT_OPFAMILY + } + n := newDropStmt(objtype) + n.MissingOk = p.parseDropIfExists() + names := p.anyName() + p.expect(ast.Token_USING) + n.Objects = []*ast.Node{nList(append([]*ast.Node{nStr(p.name())}, names...))} + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + } + // gram.y: RemoveOperStmt + n := newDropStmt(ast.ObjectType_OBJECT_OPERATOR) + n.MissingOk = p.parseDropIfExists() + n.Objects = p.parseOperatorWithArgtypesList() + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + + case ast.Token_CAST: + // gram.y: DropCastStmt + p.next() + n := newDropStmt(ast.ObjectType_OBJECT_CAST) + n.MissingOk = p.parseDropIfExists() + p.expect(ast.Token('(')) + from := p.parseTypename() + p.expect(ast.Token_AS) + to := p.parseTypename() + p.expect(ast.Token(')')) + n.Objects = []*ast.Node{nList([]*ast.Node{nTypeName(from), nTypeName(to)})} + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + + case ast.Token_TRANSFORM: + // gram.y: DropTransformStmt + p.next() + n := newDropStmt(ast.ObjectType_OBJECT_TRANSFORM) + n.MissingOk = p.parseDropIfExists() + p.expect(ast.Token_FOR) + t := p.parseTypename() + p.expect(ast.Token_LANGUAGE) + n.Objects = []*ast.Node{nList([]*ast.Node{nTypeName(t), nStr(p.name())})} + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + + case ast.Token_OWNED: + // gram.y: DropOwnedStmt + p.next() + p.expect(ast.Token_BY) + n := &ast.DropOwnedStmt{Roles: p.parseRoleList()} + n.Behavior = p.parseOptDropBehavior() + return &ast.Node{Node: &ast.Node_DropOwnedStmt{DropOwnedStmt: n}} + + case ast.Token_TABLESPACE: + // gram.y: DropTableSpaceStmt + p.next() + n := &ast.DropTableSpaceStmt{MissingOk: p.parseDropIfExists()} + n.Tablespacename = p.name() + return &ast.Node{Node: &ast.Node_DropTableSpaceStmt{DropTableSpaceStmt: n}} + + case ast.Token_SUBSCRIPTION: + // gram.y: DropSubscriptionStmt + p.next() + n := &ast.DropSubscriptionStmt{MissingOk: p.parseDropIfExists()} + n.Subname = p.name() + n.Behavior = p.parseOptDropBehavior() + return &ast.Node{Node: &ast.Node_DropSubscriptionStmt{DropSubscriptionStmt: n}} + + case ast.Token_DATABASE: + // gram.y: DropdbStmt + p.next() + n := &ast.DropdbStmt{MissingOk: p.parseDropIfExists()} + n.Dbname = p.name() + if p.kind() == ast.Token_WITH || p.kind() == ast.Token_WITH_LA || p.kind() == ast.Token('(') { + p.parseOptWith() + p.expect(ast.Token('(')) + for { + ftok := p.expect(ast.Token_FORCE) + n.Options = append(n.Options, makeDefElem("force", nil, ftok.Start)) + if !p.have(ast.Token(',')) { + break + } + } + p.expect(ast.Token(')')) + } + return &ast.Node{Node: &ast.Node_DropdbStmt{DropdbStmt: n}} + } + + // gram.y: DropStmt: DROP object_type_name_on_any_name name ON any_name + if t, ok := p.tryObjectTypeNameOnAnyName(); ok { + n := newDropStmt(t) + n.MissingOk = p.parseDropIfExists() + name := p.name() + p.expect(ast.Token_ON) + names := p.anyName() + n.Objects = []*ast.Node{nList(append(names, nStr(name)))} + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + } + // gram.y: DropStmt: DROP object_type_any_name any_name_list + if t, ok := p.tryObjectTypeAnyName(); ok { + n := newDropStmt(t) + n.MissingOk = p.parseDropIfExists() + n.Objects = p.parseAnyNameList() + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + } + // gram.y: DropStmt: DROP drop_type_name name_list + if t, ok := p.tryDropTypeName(); ok { + n := newDropStmt(t) + n.MissingOk = p.parseDropIfExists() + n.Objects = p.nameList() + n.Behavior = p.parseOptDropBehavior() + return nDropStmt(n) + } + p.syntaxErrorAt() + return nil +} + +// parseAuthIdent is gram.y's auth_ident: RoleSpec | USER. +func (p *parser) parseAuthIdent() *ast.RoleSpec { + if p.kind() == ast.Token_USER { + tok := p.next() + return &ast.RoleSpec{ + Roletype: ast.RoleSpecType_ROLESPEC_CURRENT_USER, + Location: tok.Start, + } + } + return p.parseRoleSpec() +} + +// RangeVar.relpersistence values (pg_class.h: RELPERSISTENCE_*). +const ( + relPersistPermanent = "p" + relPersistTemp = "t" + relPersistUnlogged = "u" +) diff --git a/internal/parse/ddl_extension.go b/internal/parse/ddl_extension.go new file mode 100644 index 0000000..f6a2105 --- /dev/null +++ b/internal/parse/ddl_extension.go @@ -0,0 +1,152 @@ +package parse + +// CreateDomainStmt, CreatedbStmt, and the extension DDL: +// CreateExtensionStmt, AlterExtensionStmt, AlterExtensionContentsStmt. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +// parseCreateDomainStmt is gram.y's CreateDomainStmt; CREATE DOMAIN_P +// consumed. +func (p *parser) parseCreateDomainStmt() *ast.Node { + n := &ast.CreateDomainStmt{Domainname: p.anyName()} + p.have(ast.Token_AS) + n.TypeName = p.parseTypename() + n.Constraints, n.CollClause = p.parseColQualList() + return &ast.Node{Node: &ast.Node_CreateDomainStmt{CreateDomainStmt: n}} +} + +// parseCreatedbStmt is gram.y's CreatedbStmt; CREATE DATABASE consumed. +func (p *parser) parseCreatedbStmt() *ast.Node { + n := &ast.CreatedbStmt{Dbname: p.name()} + p.parseOptWith() + n.Options = p.parseCreatedbOptItems() + return &ast.Node{Node: &ast.Node_CreatedbStmt{CreatedbStmt: n}} +} + +// parseCreateExtensionStmt is gram.y's CreateExtensionStmt; CREATE +// EXTENSION consumed. +func (p *parser) parseCreateExtensionStmt() *ast.Node { + n := &ast.CreateExtensionStmt{} + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + n.IfNotExists = true + } + n.Extname = p.name() + p.parseOptWith() + // create_extension_opt_list + for { + tok := p.peek() + switch tok.Kind { + case ast.Token_SCHEMA: + p.next() + n.Options = append(n.Options, makeDefElem("schema", nStr(p.name()), tok.Start)) + case ast.Token_VERSION_P: + p.next() + n.Options = append(n.Options, makeDefElem("new_version", nStr(p.nonReservedWordOrSconst()), tok.Start)) + case ast.Token_FROM: + p.next() + p.nonReservedWordOrSconst() + p.ereport("base_yyparse", "CREATE EXTENSION ... FROM is no longer supported", tok.Start) + case ast.Token_CASCADE: + p.next() + n.Options = append(n.Options, makeDefElem("cascade", nBoolean(true), tok.Start)) + default: + return &ast.Node{Node: &ast.Node_CreateExtensionStmt{CreateExtensionStmt: n}} + } + } +} + +// parseAlterExtensionStmt handles ALTER EXTENSION name ... : the UPDATE +// form (AlterExtensionStmt), ADD/DROP members (AlterExtensionContentsStmt), +// and SET SCHEMA (generic). ALTER EXTENSION is consumed. +func (p *parser) parseAlterExtensionStmt() *ast.Node { + name := p.name() + switch p.kind() { + case ast.Token_UPDATE: + p.next() + n := &ast.AlterExtensionStmt{Extname: name} + for p.kind() == ast.Token_TO { + ttok := p.next() + n.Options = append(n.Options, makeDefElem("new_version", nStr(p.nonReservedWordOrSconst()), ttok.Start)) + } + return &ast.Node{Node: &ast.Node_AlterExtensionStmt{AlterExtensionStmt: n}} + case ast.Token_ADD_P, ast.Token_DROP: + n := &ast.AlterExtensionContentsStmt{Extname: name, Action: 1} + if p.next().Kind == ast.Token_DROP { + n.Action = -1 + } + n.Objtype, n.Object = p.parseExtensionMemberObject() + return &ast.Node{Node: &ast.Node_AlterExtensionContentsStmt{AlterExtensionContentsStmt: n}} + } + if n := p.parseAlterGenericTail(ast.ObjectType_OBJECT_EXTENSION, nStr(name), nil, false, + tailSchema); n != nil { + return n + } + p.syntaxErrorAt() + return nil +} + +// parseExtensionMemberObject parses the object reference of +// AlterExtensionContentsStmt. +func (p *parser) parseExtensionMemberObject() (ast.ObjectType, *ast.Node) { + switch p.kind() { + case ast.Token_AGGREGATE: + p.next() + return ast.ObjectType_OBJECT_AGGREGATE, p.parseAggregateWithArgtypes() + case ast.Token_CAST: + p.next() + p.expect(ast.Token('(')) + from := p.parseTypename() + p.expect(ast.Token_AS) + to := p.parseTypename() + p.expect(ast.Token(')')) + return ast.ObjectType_OBJECT_CAST, + nList([]*ast.Node{nTypeName(from), nTypeName(to)}) + case ast.Token_DOMAIN_P: + p.next() + return ast.ObjectType_OBJECT_DOMAIN, nTypeName(p.parseTypename()) + case ast.Token_FUNCTION: + p.next() + return ast.ObjectType_OBJECT_FUNCTION, p.parseFunctionWithArgtypes() + case ast.Token_PROCEDURE: + p.next() + return ast.ObjectType_OBJECT_PROCEDURE, p.parseFunctionWithArgtypes() + case ast.Token_ROUTINE: + p.next() + return ast.ObjectType_OBJECT_ROUTINE, p.parseFunctionWithArgtypes() + case ast.Token_OPERATOR: + p.next() + switch p.kind() { + case ast.Token_CLASS, ast.Token_FAMILY: + objtype := ast.ObjectType_OBJECT_OPCLASS + if p.next().Kind == ast.Token_FAMILY { + objtype = ast.ObjectType_OBJECT_OPFAMILY + } + names := p.anyName() + p.expect(ast.Token_USING) + return objtype, nList(append([]*ast.Node{nStr(p.name())}, names...)) + } + return ast.ObjectType_OBJECT_OPERATOR, p.parseOperatorWithArgtypes() + case ast.Token_TRANSFORM: + p.next() + p.expect(ast.Token_FOR) + t := p.parseTypename() + p.expect(ast.Token_LANGUAGE) + return ast.ObjectType_OBJECT_TRANSFORM, + nList([]*ast.Node{nTypeName(t), nStr(p.name())}) + case ast.Token_TYPE_P: + p.next() + return ast.ObjectType_OBJECT_TYPE, nTypeName(p.parseTypename()) + } + if t, ok := p.tryObjectTypeAnyName(); ok { + return t, nList(p.anyName()) + } + if t, ok := p.tryObjectTypeName(); ok { + return t, nStr(p.name()) + } + p.syntaxErrorAt() + return 0, nil +} diff --git a/internal/parse/ddl_foreign.go b/internal/parse/ddl_foreign.go new file mode 100644 index 0000000..7edbcef --- /dev/null +++ b/internal/parse/ddl_foreign.go @@ -0,0 +1,204 @@ +package parse + +// Foreign-data DDL: CreateFdwStmt, AlterFdwStmt, CreateForeignServerStmt, +// AlterForeignServerStmt, CreateForeignTableStmt, ImportForeignSchemaStmt, +// CreateUserMappingStmt, AlterUserMappingStmt. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +// parseOptFdwOptions is gram.y's opt_fdw_options. +func (p *parser) parseOptFdwOptions() []*ast.Node { + var list []*ast.Node + for { + tok := p.peek() + switch tok.Kind { + case ast.Token_HANDLER: + p.next() + list = append(list, makeDefElem("handler", nList(p.parseHandlerName()), tok.Start)) + case ast.Token_VALIDATOR: + p.next() + list = append(list, makeDefElem("validator", nList(p.parseHandlerName()), tok.Start)) + case ast.Token_NO: + switch p.kindN(1) { + case ast.Token_HANDLER: + p.next() + p.next() + list = append(list, makeDefElem("handler", nil, tok.Start)) + case ast.Token_VALIDATOR: + p.next() + p.next() + list = append(list, makeDefElem("validator", nil, tok.Start)) + default: + return list + } + default: + return list + } + } +} + +// parseCreateFdwStmt is gram.y's CreateFdwStmt; CREATE FOREIGN DATA +// WRAPPER consumed. +func (p *parser) parseCreateFdwStmt() *ast.Node { + n := &ast.CreateFdwStmt{Fdwname: p.name()} + n.FuncOptions = p.parseOptFdwOptions() + n.Options = p.parseCreateGenericOptions() + return &ast.Node{Node: &ast.Node_CreateFdwStmt{CreateFdwStmt: n}} +} + +// parseAlterFdwStmt is gram.y's AlterFdwStmt; ALTER FOREIGN DATA WRAPPER +// consumed. RENAME TO/OWNER TO are resolved by the caller. +func (p *parser) parseAlterFdwStmt(name string) *ast.Node { + n := &ast.AlterFdwStmt{Fdwname: name} + n.FuncOptions = p.parseOptFdwOptions() + if p.kind() == ast.Token_OPTIONS { + n.Options = p.parseAlterGenericOptions() + } else if n.FuncOptions == nil { + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_AlterFdwStmt{AlterFdwStmt: n}} +} + +// parseCreateForeignServerStmt is gram.y's CreateForeignServerStmt; CREATE +// SERVER consumed. +func (p *parser) parseCreateForeignServerStmt() *ast.Node { + n := &ast.CreateForeignServerStmt{} + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + n.IfNotExists = true + } + n.Servername = p.name() + if p.have(ast.Token_TYPE_P) { + n.Servertype = p.sconst() + } + if p.have(ast.Token_VERSION_P) { + if !p.have(ast.Token_NULL_P) { + n.Version = p.sconst() + } + } + p.expect(ast.Token_FOREIGN) + p.expect(ast.Token_DATA_P) + p.expect(ast.Token_WRAPPER) + n.Fdwname = p.name() + n.Options = p.parseCreateGenericOptions() + return &ast.Node{Node: &ast.Node_CreateForeignServerStmt{CreateForeignServerStmt: n}} +} + +// parseAlterForeignServerStmt is gram.y's AlterForeignServerStmt; ALTER +// SERVER name consumed. +func (p *parser) parseAlterForeignServerStmt(name string) *ast.Node { + n := &ast.AlterForeignServerStmt{Servername: name} + if p.have(ast.Token_VERSION_P) { + n.HasVersion = true + if !p.have(ast.Token_NULL_P) { + n.Version = p.sconst() + } + if p.kind() == ast.Token_OPTIONS { + n.Options = p.parseAlterGenericOptions() + } + } else { + n.Options = p.parseAlterGenericOptions() + } + return &ast.Node{Node: &ast.Node_AlterForeignServerStmt{AlterForeignServerStmt: n}} +} + +// parseCreateForeignTableStmt is gram.y's CreateForeignTableStmt; CREATE +// FOREIGN TABLE consumed. +func (p *parser) parseCreateForeignTableStmt() *ast.Node { + n := &ast.CreateForeignTableStmt{} + base := &ast.CreateStmt{Oncommit: ast.OnCommitAction_ONCOMMIT_NOOP} + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + base.IfNotExists = true + } + base.Relation = p.parseQualifiedName() + base.Relation.Relpersistence = relPersistPermanent + if p.have(ast.Token_PARTITION) { + p.expect(ast.Token_OF) + base.InhRelations = []*ast.Node{nRangeVar(p.parseQualifiedName())} + if p.have(ast.Token('(')) { + base.TableElts = p.parseTypedTableElementList() + p.expect(ast.Token(')')) + } + base.Partbound = p.parsePartitionBoundSpec() + } else { + p.expect(ast.Token('(')) + if p.kind() != ast.Token(')') { + base.TableElts = p.parseTableElementList() + } + p.expect(ast.Token(')')) + if p.have(ast.Token_INHERITS) { + p.expect(ast.Token('(')) + base.InhRelations = p.parseQualifiedNameList() + p.expect(ast.Token(')')) + } + } + p.expect(ast.Token_SERVER) + n.Servername = p.name() + n.Options = p.parseCreateGenericOptions() + n.BaseStmt = base + return &ast.Node{Node: &ast.Node_CreateForeignTableStmt{CreateForeignTableStmt: n}} +} + +// parseImportForeignSchemaStmt is gram.y's ImportForeignSchemaStmt. +func (p *parser) parseImportForeignSchemaStmt() *ast.Node { + p.expect(ast.Token_IMPORT_P) + p.expect(ast.Token_FOREIGN) + p.expect(ast.Token_SCHEMA) + n := &ast.ImportForeignSchemaStmt{RemoteSchema: p.name()} + // import_qualification + switch { + case p.have(ast.Token_LIMIT): + p.expect(ast.Token_TO) + n.ListType = ast.ImportForeignSchemaType_FDW_IMPORT_SCHEMA_LIMIT_TO + p.expect(ast.Token('(')) + n.TableList = p.parseRelationExprList() + p.expect(ast.Token(')')) + case p.have(ast.Token_EXCEPT): + n.ListType = ast.ImportForeignSchemaType_FDW_IMPORT_SCHEMA_EXCEPT + p.expect(ast.Token('(')) + n.TableList = p.parseRelationExprList() + p.expect(ast.Token(')')) + default: + n.ListType = ast.ImportForeignSchemaType_FDW_IMPORT_SCHEMA_ALL + } + p.expect(ast.Token_FROM) + p.expect(ast.Token_SERVER) + n.ServerName = p.name() + p.expect(ast.Token_INTO) + n.LocalSchema = p.name() + n.Options = p.parseCreateGenericOptions() + return &ast.Node{Node: &ast.Node_ImportForeignSchemaStmt{ImportForeignSchemaStmt: n}} +} + +// parseCreateUserMappingStmt is gram.y's CreateUserMappingStmt; CREATE +// USER MAPPING consumed. +func (p *parser) parseCreateUserMappingStmt() *ast.Node { + n := &ast.CreateUserMappingStmt{} + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + n.IfNotExists = true + } + p.expect(ast.Token_FOR) + n.User = p.parseAuthIdent() + p.expect(ast.Token_SERVER) + n.Servername = p.name() + n.Options = p.parseCreateGenericOptions() + return &ast.Node{Node: &ast.Node_CreateUserMappingStmt{CreateUserMappingStmt: n}} +} + +// parseAlterUserMappingStmt is gram.y's AlterUserMappingStmt; ALTER USER +// MAPPING consumed. +func (p *parser) parseAlterUserMappingStmt() *ast.Node { + p.expect(ast.Token_FOR) + n := &ast.AlterUserMappingStmt{User: p.parseAuthIdent()} + p.expect(ast.Token_SERVER) + n.Servername = p.name() + n.Options = p.parseAlterGenericOptions() + return &ast.Node{Node: &ast.Node_AlterUserMappingStmt{AlterUserMappingStmt: n}} +} diff --git a/internal/parse/ddl_function.go b/internal/parse/ddl_function.go new file mode 100644 index 0000000..9c40364 --- /dev/null +++ b/internal/parse/ddl_function.go @@ -0,0 +1,281 @@ +package parse + +// CreateFunctionStmt (CREATE FUNCTION/PROCEDURE), AlterFunctionStmt, and +// the routine-body machinery. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +// parseFuncArgsWithDefaults is gram.y's func_args_with_defaults. +func (p *parser) parseFuncArgsWithDefaults() []*ast.Node { + p.expect(ast.Token('(')) + var params []*ast.Node + if p.kind() != ast.Token(')') { + params = append(params, p.parseFuncArgWithDefault()) + for p.have(ast.Token(',')) { + params = append(params, p.parseFuncArgWithDefault()) + } + } + p.expect(ast.Token(')')) + return params +} + +// parseFuncArgWithDefault is gram.y's func_arg_with_default. +func (p *parser) parseFuncArgWithDefault() *ast.Node { + fp := p.parseFuncArg() + if p.have(ast.Token_DEFAULT) || p.have(ast.Token('=')) { + fp.Defexpr = p.parseAExpr(0) + } + return nFunctionParameter(fp) +} + +// parseCreateFunctionStmt is gram.y's CreateFunctionStmt. CREATE +// [OR REPLACE] is consumed; FUNCTION or PROCEDURE is the lookahead. +func (p *parser) parseCreateFunctionStmt(replace bool) *ast.Node { + n := &ast.CreateFunctionStmt{Replace: replace} + n.IsProcedure = p.next().Kind == ast.Token_PROCEDURE + n.Funcname = p.parseFuncName(p.peek()) + n.Parameters = p.parseFuncArgsWithDefaults() + if !n.IsProcedure && p.kind() == ast.Token_RETURNS && p.kindN(1) != ast.Token_NULL_P { + p.next() + if p.kind() == ast.Token_TABLE && p.kindN(1) == ast.Token('(') { + ttok := p.next() + p.next() + // table_func_column_list + var cols []*ast.Node + cols = append(cols, p.parseTableFuncColumn()) + for p.have(ast.Token(',')) { + cols = append(cols, p.parseTableFuncColumn()) + } + p.expect(ast.Token(')')) + // gram.y: mergeTableFuncParameters + for _, arg := range n.Parameters { + switch arg.GetFunctionParameter().GetMode() { + case ast.FunctionParameterMode_FUNC_PARAM_DEFAULT, + ast.FunctionParameterMode_FUNC_PARAM_IN, + ast.FunctionParameterMode_FUNC_PARAM_VARIADIC: + default: + p.ereport("mergeTableFuncParameters", "OUT and INOUT arguments aren't allowed in TABLE functions", -1) + } + } + n.Parameters = append(n.Parameters, cols...) + // gram.y: TableFuncTypeName + if len(cols) == 1 { + src := cols[0].GetFunctionParameter().GetArgType() + n.ReturnType = &ast.TypeName{ + Names: src.Names, + TypeOid: src.TypeOid, + Setof: true, + PctType: src.PctType, + Typmods: src.Typmods, + Typemod: src.Typemod, + ArrayBounds: src.ArrayBounds, + } + } else { + n.ReturnType = SystemTypeName("record") + n.ReturnType.Setof = true + } + n.ReturnType.Location = ttok.Start + } else { + n.ReturnType = p.parseFuncType() + } + } + n.Options = p.parseCreateFuncOptList() + n.SqlBody = p.parseOptRoutineBody() + return &ast.Node{Node: &ast.Node_CreateFunctionStmt{CreateFunctionStmt: n}} +} + +// parseTableFuncColumn is gram.y's table_func_column. +func (p *parser) parseTableFuncColumn() *ast.Node { + return nFunctionParameter(&ast.FunctionParameter{ + Name: p.paramName(), + ArgType: p.parseFuncType(), + Mode: ast.FunctionParameterMode_FUNC_PARAM_TABLE, + }) +} + +// parseCommonFuncOptItem is gram.y's common_func_opt_item; returns nil when +// the lookahead is not one. +func (p *parser) parseCommonFuncOptItem() *ast.Node { + tok := p.peek() + switch tok.Kind { + case ast.Token_CALLED: + p.next() + p.expect(ast.Token_ON) + p.expect(ast.Token_NULL_P) + p.expect(ast.Token_INPUT_P) + return makeDefElem("strict", nBoolean(false), tok.Start) + case ast.Token_RETURNS: + if p.kindN(1) != ast.Token_NULL_P { + return nil + } + p.next() + p.next() + p.expect(ast.Token_ON) + p.expect(ast.Token_NULL_P) + p.expect(ast.Token_INPUT_P) + return makeDefElem("strict", nBoolean(true), tok.Start) + case ast.Token_STRICT_P: + p.next() + return makeDefElem("strict", nBoolean(true), tok.Start) + case ast.Token_IMMUTABLE: + p.next() + return makeDefElem("volatility", nStr("immutable"), tok.Start) + case ast.Token_STABLE: + p.next() + return makeDefElem("volatility", nStr("stable"), tok.Start) + case ast.Token_VOLATILE: + p.next() + return makeDefElem("volatility", nStr("volatile"), tok.Start) + case ast.Token_EXTERNAL: + p.next() + p.expect(ast.Token_SECURITY) + switch { + case p.have(ast.Token_DEFINER): + return makeDefElem("security", nBoolean(true), tok.Start) + case p.have(ast.Token_INVOKER): + return makeDefElem("security", nBoolean(false), tok.Start) + } + p.syntaxErrorAt() + case ast.Token_SECURITY: + p.next() + switch { + case p.have(ast.Token_DEFINER): + return makeDefElem("security", nBoolean(true), tok.Start) + case p.have(ast.Token_INVOKER): + return makeDefElem("security", nBoolean(false), tok.Start) + } + p.syntaxErrorAt() + case ast.Token_LEAKPROOF: + p.next() + return makeDefElem("leakproof", nBoolean(true), tok.Start) + case ast.Token_NOT: + if p.kindN(1) != ast.Token_LEAKPROOF { + return nil + } + p.next() + p.next() + return makeDefElem("leakproof", nBoolean(false), tok.Start) + case ast.Token_COST: + p.next() + return makeDefElem("cost", p.parseNumericOnly(), tok.Start) + case ast.Token_ROWS: + p.next() + return makeDefElem("rows", p.parseNumericOnly(), tok.Start) + case ast.Token_SUPPORT: + p.next() + return makeDefElem("support", nList(p.anyName()), tok.Start) + case ast.Token_SET, ast.Token_RESET: + set := p.parseFunctionSetResetClause() + return makeDefElem("set", &ast.Node{Node: &ast.Node_VariableSetStmt{VariableSetStmt: set}}, tok.Start) + case ast.Token_PARALLEL: + p.next() + return makeDefElem("parallel", nStr(p.colId()), tok.Start) + } + return nil +} + +// parseCreateFuncOptList is gram.y's opt_createfunc_opt_list. +func (p *parser) parseCreateFuncOptList() []*ast.Node { + var list []*ast.Node + for { + tok := p.peek() + switch tok.Kind { + case ast.Token_AS: + p.next() + args := []*ast.Node{nStr(p.sconst())} + if p.have(ast.Token(',')) { + args = append(args, nStr(p.sconst())) + } + list = append(list, makeDefElem("as", nList(args), tok.Start)) + continue + case ast.Token_LANGUAGE: + p.next() + list = append(list, makeDefElem("language", nStr(p.nonReservedWordOrSconst()), tok.Start)) + continue + case ast.Token_TRANSFORM: + p.next() + var types []*ast.Node + p.expect(ast.Token_FOR) + p.expect(ast.Token_TYPE_P) + types = append(types, nTypeName(p.parseTypename())) + for p.have(ast.Token(',')) { + p.expect(ast.Token_FOR) + p.expect(ast.Token_TYPE_P) + types = append(types, nTypeName(p.parseTypename())) + } + list = append(list, makeDefElem("transform", nList(types), tok.Start)) + continue + case ast.Token_WINDOW: + p.next() + list = append(list, makeDefElem("window", nBoolean(true), tok.Start)) + continue + } + if item := p.parseCommonFuncOptItem(); item != nil { + list = append(list, item) + continue + } + return list + } +} + +// parseOptRoutineBody is gram.y's opt_routine_body. +func (p *parser) parseOptRoutineBody() *ast.Node { + switch p.kind() { + case ast.Token_RETURN: + p.next() + return &ast.Node{Node: &ast.Node_ReturnStmt{ReturnStmt: &ast.ReturnStmt{ + Returnval: p.parseAExpr(0), + }}} + case ast.Token_BEGIN_P: + if p.kindN(1) != ast.Token_ATOMIC { + return nil + } + p.next() + p.next() + var stmts []*ast.Node + for p.kind() != ast.Token_END_P { + var stmt *ast.Node + if p.kind() == ast.Token_RETURN { + p.next() + stmt = &ast.Node{Node: &ast.Node_ReturnStmt{ReturnStmt: &ast.ReturnStmt{ + Returnval: p.parseAExpr(0), + }}} + } else { + stmt = p.parseToplevelStmt() + } + // Every routine_body_stmt carries a trailing semicolon; empty + // statements are discarded as in stmtmulti. + p.expect(ast.Token(';')) + if stmt != nil { + stmts = append(stmts, stmt) + } + } + p.next() + // An empty body stores NIL (a null list element), not an empty List. + inner := &ast.Node{} + if stmts != nil { + inner = nList(stmts) + } + return nList([]*ast.Node{inner}) + } + return nil +} + +// parseAlterFunctionStmt is gram.y's AlterFunctionStmt; ALTER FUNCTION/ +// PROCEDURE/ROUTINE and the function_with_argtypes have been consumed by +// the dispatcher. +func (p *parser) parseAlterFunctionStmt(objtype ast.ObjectType, fn *ast.ObjectWithArgs) *ast.Node { + n := &ast.AlterFunctionStmt{Objtype: objtype, Func: fn} + item := p.parseCommonFuncOptItem() + if item == nil { + p.syntaxErrorAt() + } + for item != nil { + n.Actions = append(n.Actions, item) + item = p.parseCommonFuncOptItem() + } + p.have(ast.Token_RESTRICT) + return &ast.Node{Node: &ast.Node_AlterFunctionStmt{AlterFunctionStmt: n}} +} diff --git a/internal/parse/ddl_grant.go b/internal/parse/ddl_grant.go new file mode 100644 index 0000000..767a24d --- /dev/null +++ b/internal/parse/ddl_grant.go @@ -0,0 +1,490 @@ +package parse + +// GRANT/REVOKE (GrantStmt, GrantRoleStmt), ALTER DEFAULT PRIVILEGES, +// CREATE/ALTER POLICY, and CREATE ACCESS METHOD. + +import ( + "fmt" + + "github.com/sqlc-dev/oliphant/ast" +) + +func nAccessPriv(n *ast.AccessPriv) *ast.Node { + return &ast.Node{Node: &ast.Node_AccessPriv{AccessPriv: n}} +} + +func nGrantStmt(n *ast.GrantStmt) *ast.Node { + return &ast.Node{Node: &ast.Node_GrantStmt{GrantStmt: n}} +} + +// parsePrivilege is gram.y's privilege. +func (p *parser) parsePrivilege() *ast.Node { + n := &ast.AccessPriv{} + switch p.kind() { + case ast.Token_SELECT: + p.next() + n.PrivName = "select" + case ast.Token_REFERENCES: + p.next() + n.PrivName = "references" + case ast.Token_CREATE: + p.next() + n.PrivName = "create" + case ast.Token_ALTER: + p.next() + p.expect(ast.Token_SYSTEM_P) + n.PrivName = "alter system" + return nAccessPriv(n) + default: + n.PrivName = p.colId() + } + if p.have(ast.Token('(')) { + n.Cols = p.columnList() + p.expect(ast.Token(')')) + } + return nAccessPriv(n) +} + +// parsePrivilegeList is gram.y's privilege_list. +func (p *parser) parsePrivilegeList() []*ast.Node { + list := []*ast.Node{p.parsePrivilege()} + for p.have(ast.Token(',')) { + list = append(list, p.parsePrivilege()) + } + return list +} + +// parsePrivileges is gram.y's privileges: ALL [PRIVILEGES] [(cols)] or a +// privilege_list. +func (p *parser) parsePrivileges() []*ast.Node { + if p.have(ast.Token_ALL) { + p.have(ast.Token_PRIVILEGES) + if p.have(ast.Token('(')) { + n := &ast.AccessPriv{Cols: p.columnList()} + p.expect(ast.Token(')')) + return []*ast.Node{nAccessPriv(n)} + } + return nil + } + return p.parsePrivilegeList() +} + +// parsePrivilegeTarget is gram.y's privilege_target. +func (p *parser) parsePrivilegeTarget() (ast.GrantTargetType, ast.ObjectType, []*ast.Node) { + obj := ast.GrantTargetType_ACL_TARGET_OBJECT + switch p.kind() { + case ast.Token_TABLE: + p.next() + return obj, ast.ObjectType_OBJECT_TABLE, p.parseQualifiedNameList() + case ast.Token_SEQUENCE: + p.next() + return obj, ast.ObjectType_OBJECT_SEQUENCE, p.parseQualifiedNameList() + case ast.Token_FOREIGN: + p.next() + switch { + case p.have(ast.Token_DATA_P): + p.expect(ast.Token_WRAPPER) + return obj, ast.ObjectType_OBJECT_FDW, p.nameList() + case p.have(ast.Token_SERVER): + return obj, ast.ObjectType_OBJECT_FOREIGN_SERVER, p.nameList() + } + p.syntaxErrorAt() + case ast.Token_FUNCTION: + p.next() + return obj, ast.ObjectType_OBJECT_FUNCTION, p.parseFunctionWithArgtypesList() + case ast.Token_PROCEDURE: + p.next() + return obj, ast.ObjectType_OBJECT_PROCEDURE, p.parseFunctionWithArgtypesList() + case ast.Token_ROUTINE: + p.next() + return obj, ast.ObjectType_OBJECT_ROUTINE, p.parseFunctionWithArgtypesList() + case ast.Token_DATABASE: + p.next() + return obj, ast.ObjectType_OBJECT_DATABASE, p.nameList() + case ast.Token_DOMAIN_P: + p.next() + return obj, ast.ObjectType_OBJECT_DOMAIN, p.parseAnyNameList() + case ast.Token_LANGUAGE: + p.next() + return obj, ast.ObjectType_OBJECT_LANGUAGE, p.nameList() + case ast.Token_LARGE_P: + p.next() + p.expect(ast.Token_OBJECT_P) + list := []*ast.Node{p.parseNumericOnly()} + for p.have(ast.Token(',')) { + list = append(list, p.parseNumericOnly()) + } + return obj, ast.ObjectType_OBJECT_LARGEOBJECT, list + case ast.Token_PARAMETER: + p.next() + list := []*ast.Node{nStr(p.parseVarName())} + for p.have(ast.Token(',')) { + list = append(list, nStr(p.parseVarName())) + } + return obj, ast.ObjectType_OBJECT_PARAMETER_ACL, list + case ast.Token_SCHEMA: + p.next() + return obj, ast.ObjectType_OBJECT_SCHEMA, p.nameList() + case ast.Token_TABLESPACE: + p.next() + return obj, ast.ObjectType_OBJECT_TABLESPACE, p.nameList() + case ast.Token_TYPE_P: + p.next() + return obj, ast.ObjectType_OBJECT_TYPE, p.parseAnyNameList() + case ast.Token_ALL: + p.next() + all := ast.GrantTargetType_ACL_TARGET_ALL_IN_SCHEMA + var t ast.ObjectType + switch p.kind() { + case ast.Token_TABLES: + t = ast.ObjectType_OBJECT_TABLE + case ast.Token_SEQUENCES: + t = ast.ObjectType_OBJECT_SEQUENCE + case ast.Token_FUNCTIONS: + t = ast.ObjectType_OBJECT_FUNCTION + case ast.Token_PROCEDURES: + t = ast.ObjectType_OBJECT_PROCEDURE + case ast.Token_ROUTINES: + t = ast.ObjectType_OBJECT_ROUTINE + default: + p.syntaxErrorAt() + } + p.next() + p.expect(ast.Token_IN_P) + p.expect(ast.Token_SCHEMA) + return all, t, p.nameList() + } + return obj, ast.ObjectType_OBJECT_TABLE, p.parseQualifiedNameList() +} + +// parseGranteeList is gram.y's grantee_list. +func (p *parser) parseGranteeList() []*ast.Node { + parseGrantee := func() *ast.Node { + p.have(ast.Token_GROUP_P) + return nRoleSpec(p.parseRoleSpec()) + } + list := []*ast.Node{parseGrantee()} + for p.have(ast.Token(',')) { + list = append(list, parseGrantee()) + } + return list +} + +// parseOptGrantedBy is gram.y's opt_granted_by. +func (p *parser) parseOptGrantedBy() *ast.RoleSpec { + if p.kind() == ast.Token_GRANTED { + p.next() + p.expect(ast.Token_BY) + return p.parseRoleSpec() + } + return nil +} + +// parseGrantStmt is gram.y's GrantStmt / GrantRoleStmt: the privilege list +// is parsed first and ON/TO picks the statement. +func (p *parser) parseGrantStmt() *ast.Node { + p.expect(ast.Token_GRANT) + privs := p.parsePrivileges() + if p.have(ast.Token_ON) { + n := &ast.GrantStmt{ + IsGrant: true, + Privileges: privs, + Behavior: ast.DropBehavior_DROP_RESTRICT, + } + n.Targtype, n.Objtype, n.Objects = p.parsePrivilegeTarget() + p.expect(ast.Token_TO) + n.Grantees = p.parseGranteeList() + if p.kind() == ast.Token_WITH && p.kindN(1) == ast.Token_GRANT { + p.next() + p.next() + p.expect(ast.Token_OPTION) + n.GrantOption = true + } + n.Grantor = p.parseOptGrantedBy() + return nGrantStmt(n) + } + // gram.y: GrantRoleStmt + p.expect(ast.Token_TO) + n := &ast.GrantRoleStmt{ + IsGrant: true, + GrantedRoles: privs, + GranteeRoles: p.parseRoleList(), + Behavior: ast.DropBehavior_DROP_RESTRICT, + } + if p.kind() == ast.Token_WITH || p.kind() == ast.Token_WITH_LA { + p.next() + // grant_role_opt_list + for { + otok := p.peek() + name := p.colLabel() + var val *ast.Node + switch { + case p.have(ast.Token_OPTION): + val = nBoolean(true) + case p.have(ast.Token_TRUE_P): + val = nBoolean(true) + case p.have(ast.Token_FALSE_P): + val = nBoolean(false) + default: + p.syntaxErrorAt() + } + n.Opt = append(n.Opt, makeDefElem(name, val, otok.Start)) + if !p.have(ast.Token(',')) { + break + } + } + } + n.Grantor = p.parseOptGrantedBy() + return &ast.Node{Node: &ast.Node_GrantRoleStmt{GrantRoleStmt: n}} +} + +// parseRevokeStmt is gram.y's RevokeStmt / RevokeRoleStmt. +func (p *parser) parseRevokeStmt() *ast.Node { + p.expect(ast.Token_REVOKE) + + // REVOKE GRANT OPTION FOR ... is always the GrantStmt form; REVOKE + // ColId OPTION FOR ... is the role form with an option DefElem. + if p.kind() == ast.Token_GRANT && p.kindN(1) == ast.Token_OPTION { + p.next() + p.next() + p.expect(ast.Token_FOR) + n := &ast.GrantStmt{GrantOption: true, Privileges: p.parsePrivileges()} + p.expect(ast.Token_ON) + n.Targtype, n.Objtype, n.Objects = p.parsePrivilegeTarget() + p.expect(ast.Token_FROM) + n.Grantees = p.parseGranteeList() + n.Grantor = p.parseOptGrantedBy() + n.Behavior = p.parseOptDropBehavior() + return nGrantStmt(n) + } + if isColIdToken(p.peek()) && p.kindN(1) == ast.Token_OPTION && p.kindN(2) == ast.Token_FOR { + otok := p.peek() + optName := p.colId() + p.next() + p.next() + n := &ast.GrantRoleStmt{ + Opt: []*ast.Node{makeDefElem(optName, nBoolean(false), otok.Start)}, + GrantedRoles: p.parsePrivilegeList(), + } + p.expect(ast.Token_FROM) + n.GranteeRoles = p.parseRoleList() + n.Grantor = p.parseOptGrantedBy() + n.Behavior = p.parseOptDropBehavior() + return &ast.Node{Node: &ast.Node_GrantRoleStmt{GrantRoleStmt: n}} + } + + privs := p.parsePrivileges() + if p.have(ast.Token_ON) { + n := &ast.GrantStmt{Privileges: privs} + n.Targtype, n.Objtype, n.Objects = p.parsePrivilegeTarget() + p.expect(ast.Token_FROM) + n.Grantees = p.parseGranteeList() + n.Grantor = p.parseOptGrantedBy() + n.Behavior = p.parseOptDropBehavior() + return nGrantStmt(n) + } + p.expect(ast.Token_FROM) + n := &ast.GrantRoleStmt{ + GrantedRoles: privs, + GranteeRoles: p.parseRoleList(), + } + n.Grantor = p.parseOptGrantedBy() + n.Behavior = p.parseOptDropBehavior() + return &ast.Node{Node: &ast.Node_GrantRoleStmt{GrantRoleStmt: n}} +} + +// parseAlterDefaultPrivilegesStmt is gram.y's AlterDefaultPrivilegesStmt; +// ALTER DEFAULT PRIVILEGES consumed. +func (p *parser) parseAlterDefaultPrivilegesStmt() *ast.Node { + n := &ast.AlterDefaultPrivilegesStmt{} + // DefACLOptionList + for { + tok := p.peek() + switch tok.Kind { + case ast.Token_IN_P: + p.next() + p.expect(ast.Token_SCHEMA) + n.Options = append(n.Options, makeDefElem("schemas", nList(p.nameList()), tok.Start)) + continue + case ast.Token_FOR: + p.next() + if !p.have(ast.Token_ROLE) && !p.have(ast.Token_USER) { + p.syntaxErrorAt() + } + n.Options = append(n.Options, makeDefElem("roles", nList(p.parseRoleList()), tok.Start)) + continue + } + break + } + // DefACLAction + action := &ast.GrantStmt{ + Targtype: ast.GrantTargetType_ACL_TARGET_DEFAULTS, + Behavior: ast.DropBehavior_DROP_RESTRICT, + } + switch { + case p.have(ast.Token_GRANT): + action.IsGrant = true + action.Privileges = p.parsePrivileges() + p.expect(ast.Token_ON) + action.Objtype = p.parseDefACLPrivilegeTarget() + p.expect(ast.Token_TO) + action.Grantees = p.parseGranteeList() + if p.kind() == ast.Token_WITH && p.kindN(1) == ast.Token_GRANT { + p.next() + p.next() + p.expect(ast.Token_OPTION) + action.GrantOption = true + } + case p.have(ast.Token_REVOKE): + if p.kind() == ast.Token_GRANT && p.kindN(1) == ast.Token_OPTION { + p.next() + p.next() + p.expect(ast.Token_FOR) + action.GrantOption = true + } + action.Privileges = p.parsePrivileges() + p.expect(ast.Token_ON) + action.Objtype = p.parseDefACLPrivilegeTarget() + p.expect(ast.Token_FROM) + action.Grantees = p.parseGranteeList() + action.Behavior = p.parseOptDropBehavior() + default: + p.syntaxErrorAt() + } + n.Action = action + return &ast.Node{Node: &ast.Node_AlterDefaultPrivilegesStmt{AlterDefaultPrivilegesStmt: n}} +} + +// parseDefACLPrivilegeTarget is gram.y's defacl_privilege_target. +func (p *parser) parseDefACLPrivilegeTarget() ast.ObjectType { + switch p.kind() { + case ast.Token_TABLES: + p.next() + return ast.ObjectType_OBJECT_TABLE + case ast.Token_FUNCTIONS, ast.Token_ROUTINES: + p.next() + return ast.ObjectType_OBJECT_FUNCTION + case ast.Token_SEQUENCES: + p.next() + return ast.ObjectType_OBJECT_SEQUENCE + case ast.Token_TYPES_P: + p.next() + return ast.ObjectType_OBJECT_TYPE + case ast.Token_SCHEMAS: + p.next() + return ast.ObjectType_OBJECT_SCHEMA + } + p.syntaxErrorAt() + return 0 +} + +// parseCreatePolicyStmt is gram.y's CreatePolicyStmt; CREATE POLICY +// consumed. +func (p *parser) parseCreatePolicyStmt() *ast.Node { + n := &ast.CreatePolicyStmt{PolicyName: p.name(), Permissive: true, CmdName: "all"} + p.expect(ast.Token_ON) + n.Table = p.parseQualifiedName() + if p.have(ast.Token_AS) { + itok := p.peek() + ident := p.expect(ast.Token_IDENT) + switch ident.Str { + case "permissive": + case "restrictive": + n.Permissive = false + default: + p.ereport("base_yyparse", + fmt.Sprintf("unrecognized row security option %q", ident.Str), itok.Start) + } + } + if p.have(ast.Token_FOR) { + n.CmdName = p.parseRowSecurityCmd() + } + if p.have(ast.Token_TO) { + n.Roles = p.parseRoleList() + } else { + n.Roles = []*ast.Node{nRoleSpec(&ast.RoleSpec{ + Roletype: ast.RoleSpecType_ROLESPEC_PUBLIC, + Location: -1, + })} + } + if p.have(ast.Token_USING) { + p.expect(ast.Token('(')) + n.Qual = p.parseAExpr(0) + p.expect(ast.Token(')')) + } + if p.kind() == ast.Token_WITH && p.kindN(1) == ast.Token_CHECK { + p.next() + p.next() + p.expect(ast.Token('(')) + n.WithCheck = p.parseAExpr(0) + p.expect(ast.Token(')')) + } + return &ast.Node{Node: &ast.Node_CreatePolicyStmt{CreatePolicyStmt: n}} +} + +// parseAlterPolicyStmt is gram.y's AlterPolicyStmt; ALTER POLICY name ON +// qualified_name consumed. +func (p *parser) parseAlterPolicyStmt(name string, table *ast.RangeVar) *ast.Node { + n := &ast.AlterPolicyStmt{PolicyName: name, Table: table} + if p.have(ast.Token_TO) { + n.Roles = p.parseRoleList() + } + if p.have(ast.Token_USING) { + p.expect(ast.Token('(')) + n.Qual = p.parseAExpr(0) + p.expect(ast.Token(')')) + } + if p.kind() == ast.Token_WITH && p.kindN(1) == ast.Token_CHECK { + p.next() + p.next() + p.expect(ast.Token('(')) + n.WithCheck = p.parseAExpr(0) + p.expect(ast.Token(')')) + } + return &ast.Node{Node: &ast.Node_AlterPolicyStmt{AlterPolicyStmt: n}} +} + +// parseRowSecurityCmd is gram.y's row_security_cmd. +func (p *parser) parseRowSecurityCmd() string { + switch { + case p.have(ast.Token_ALL): + return "all" + case p.have(ast.Token_SELECT): + return "select" + case p.have(ast.Token_INSERT): + return "insert" + case p.have(ast.Token_UPDATE): + return "update" + case p.have(ast.Token_DELETE_P): + return "delete" + } + p.syntaxErrorAt() + return "" +} + +// parseCreateAmStmt is gram.y's CreateAmStmt; CREATE ACCESS METHOD +// consumed. +func (p *parser) parseCreateAmStmt() *ast.Node { + n := &ast.CreateAmStmt{Amname: p.name()} + p.expect(ast.Token_TYPE_P) + switch { + case p.have(ast.Token_INDEX): + n.Amtype = "i" + case p.have(ast.Token_TABLE): + n.Amtype = "t" + default: + p.syntaxErrorAt() + } + p.expect(ast.Token_HANDLER) + n.HandlerName = p.parseHandlerName() + return &ast.Node{Node: &ast.Node_CreateAmStmt{CreateAmStmt: n}} +} + +// parseHandlerName is gram.y's handler_name: name | name attrs. +func (p *parser) parseHandlerName() []*ast.Node { + names := []*ast.Node{nStr(p.name())} + for p.have(ast.Token('.')) { + names = append(names, nStr(p.attrName())) + } + return names +} diff --git a/internal/parse/ddl_object.go b/internal/parse/ddl_object.go new file mode 100644 index 0000000..15d7386 --- /dev/null +++ b/internal/parse/ddl_object.go @@ -0,0 +1,621 @@ +package parse + +// Object-address machinery shared by DROP/COMMENT/SECURITY LABEL and the +// function DDL: function_with_argtypes, aggregate_with_argtypes, +// operator_with_argtypes, func_arg, plus DropStmt and friends, CommentStmt, +// and SecLabelStmt. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +func nObjectWithArgs(n *ast.ObjectWithArgs) *ast.Node { + return &ast.Node{Node: &ast.Node_ObjectWithArgs{ObjectWithArgs: n}} +} + +func nFunctionParameter(n *ast.FunctionParameter) *ast.Node { + return &ast.Node{Node: &ast.Node_FunctionParameter{FunctionParameter: n}} +} + +// parseAnyNameList is gram.y's any_name_list. +func (p *parser) parseAnyNameList() []*ast.Node { + list := []*ast.Node{nList(p.anyName())} + for p.have(ast.Token(',')) { + list = append(list, nList(p.anyName())) + } + return list +} + +// parseTypeNameList is gram.y's type_name_list. +func (p *parser) parseTypeNameList() []*ast.Node { + list := []*ast.Node{nTypeName(p.parseTypename())} + for p.have(ast.Token(',')) { + list = append(list, nTypeName(p.parseTypename())) + } + return list +} + +// parseFuncType is gram.y's func_type: +// +// Typename | type_function_name attrs '%' TYPE_P +// | SETOF type_function_name attrs '%' TYPE_P +func (p *parser) parseFuncType() *ast.TypeName { + // Look for the %TYPE form: [SETOF] name ('.' name)+ '%' TYPE_P. + i := 0 + setof := false + if p.kind() == ast.Token_SETOF { + i = 1 + setof = true + } + if isTypeFunctionNameToken(p.peekN(i)) { + j := i + for p.kindN(j+1) == ast.Token('.') && isColLabelToken(p.peekN(j+2)) { + j += 2 + } + if j > i && p.kindN(j+1) == ast.Token('%') && p.kindN(j+2) == ast.Token_TYPE_P { + if setof { + p.next() + } + tok := p.peek() + names := []*ast.Node{nStr(p.next().Str)} + for p.have(ast.Token('.')) { + names = append(names, nStr(p.colLabel())) + } + p.expect(ast.Token('%')) + p.expect(ast.Token_TYPE_P) + t := makeTypeNameFromNameList(names) + t.PctType = true + t.Setof = setof + t.Location = tok.Start + return t + } + } + return p.parseTypename() +} + +// parseFuncArg is gram.y's func_arg. +func (p *parser) parseFuncArg() *ast.FunctionParameter { + n := &ast.FunctionParameter{Mode: ast.FunctionParameterMode_FUNC_PARAM_DEFAULT} + mode, haveMode := p.parseArgClass() + if haveMode { + n.Mode = mode + } + // A type_function_name token here is a param_name unless the tokens + // that follow close the argument (making it the type itself). + if isTypeFunctionNameToken(p.peek()) && p.argNameFollowedByType() { + n.Name = p.paramName() + if !haveMode { + if mode, haveMode = p.parseArgClass(); haveMode { + n.Mode = mode + } + } + } + n.ArgType = p.parseFuncType() + return n +} + +// parseArgClass is gram.y's arg_class; reports whether one was present. +func (p *parser) parseArgClass() (ast.FunctionParameterMode, bool) { + switch p.kind() { + case ast.Token_IN_P: + p.next() + if p.have(ast.Token_OUT_P) { + return ast.FunctionParameterMode_FUNC_PARAM_INOUT, true + } + return ast.FunctionParameterMode_FUNC_PARAM_IN, true + case ast.Token_OUT_P: + p.next() + return ast.FunctionParameterMode_FUNC_PARAM_OUT, true + case ast.Token_INOUT: + p.next() + return ast.FunctionParameterMode_FUNC_PARAM_INOUT, true + case ast.Token_VARIADIC: + p.next() + return ast.FunctionParameterMode_FUNC_PARAM_VARIADIC, true + } + return 0, false +} + +// argNameFollowedByType reports whether the token after the current one +// continues a func_arg (so the current token is a param_name rather than +// the argument's type). +func (p *parser) argNameFollowedByType() bool { + switch p.kindN(1) { + case ast.Token(','), ast.Token(')'), ast.Token('.'), ast.Token('%'), + ast.Token('('), ast.Token('['), ast.Token_DEFAULT, ast.Token('='), + ast.Token_ORDER, 0: + return false + } + return true +} + +// extractArgTypes is gram.y's extractArgTypes. +func extractArgTypes(params []*ast.Node) []*ast.Node { + var result []*ast.Node + for _, pn := range params { + fp := pn.GetFunctionParameter() + if fp.Mode != ast.FunctionParameterMode_FUNC_PARAM_OUT && + fp.Mode != ast.FunctionParameterMode_FUNC_PARAM_TABLE { + result = append(result, nTypeName(fp.ArgType)) + } + } + return result +} + +// parseFunctionWithArgtypes is gram.y's function_with_argtypes. +func (p *parser) parseFunctionWithArgtypes() *ast.Node { + n := &ast.ObjectWithArgs{} + // func_name func_args, or a bare name/type_func_name_keyword/ColId + // indirection (args_unspecified). + n.Objname = p.parseFuncName(p.peek()) + if p.kind() == ast.Token('(') { + params := p.parseFuncArgsParens() + n.Objargs = extractArgTypes(params) + n.Objfuncargs = params + } else { + n.ArgsUnspecified = true + } + return nObjectWithArgs(n) +} + +// parseFuncArgsParens is gram.y's func_args: '(' [func_args_list] ')'. +func (p *parser) parseFuncArgsParens() []*ast.Node { + p.expect(ast.Token('(')) + var params []*ast.Node + if p.kind() != ast.Token(')') { + params = append(params, nFunctionParameter(p.parseFuncArg())) + for p.have(ast.Token(',')) { + params = append(params, nFunctionParameter(p.parseFuncArg())) + } + } + p.expect(ast.Token(')')) + return params +} + +// parseFunctionWithArgtypesList is gram.y's function_with_argtypes_list. +func (p *parser) parseFunctionWithArgtypesList() []*ast.Node { + list := []*ast.Node{p.parseFunctionWithArgtypes()} + for p.have(ast.Token(',')) { + list = append(list, p.parseFunctionWithArgtypes()) + } + return list +} + +// parseAggrArgs is gram.y's aggr_args; returns the FunctionParameter list +// and the ORDER BY split marker. +func (p *parser) parseAggrArgs() ([]*ast.Node, int32) { + p.expect(ast.Token('(')) + if p.have(ast.Token('*')) { + p.expect(ast.Token(')')) + return nil, -1 + } + if p.have(ast.Token_ORDER) { + p.expect(ast.Token_BY) + args := p.parseAggrArgsList() + p.expect(ast.Token(')')) + return args, 0 + } + direct := p.parseAggrArgsList() + if p.have(ast.Token_ORDER) { + p.expect(ast.Token_BY) + otok := p.peek() + ordered := p.parseAggrArgsList() + p.expect(ast.Token(')')) + return p.makeOrderedSetArgs(direct, ordered, otok.Start) + } + p.expect(ast.Token(')')) + return direct, -1 +} + +// parseAggrArgsList is gram.y's aggr_args_list. +func (p *parser) parseAggrArgsList() []*ast.Node { + list := []*ast.Node{p.parseAggrArg()} + for p.have(ast.Token(',')) { + list = append(list, p.parseAggrArg()) + } + return list +} + +// parseAggrArg is gram.y's aggr_arg. +func (p *parser) parseAggrArg() *ast.Node { + tok := p.peek() + fp := p.parseFuncArg() + switch fp.Mode { + case ast.FunctionParameterMode_FUNC_PARAM_DEFAULT, + ast.FunctionParameterMode_FUNC_PARAM_IN, + ast.FunctionParameterMode_FUNC_PARAM_VARIADIC: + default: + p.ereport("base_yyparse", "aggregates cannot have output arguments", tok.Start) + } + return nFunctionParameter(fp) +} + +// makeOrderedSetArgs is gram.y's makeOrderedSetArgs. +func (p *parser) makeOrderedSetArgs(direct, ordered []*ast.Node, orderedLoc int32) ([]*ast.Node, int32) { + lastd := direct[len(direct)-1].GetFunctionParameter() + if lastd.Mode == ast.FunctionParameterMode_FUNC_PARAM_VARIADIC { + firsto := ordered[0].GetFunctionParameter() + if len(ordered) != 1 || + firsto.Mode != ast.FunctionParameterMode_FUNC_PARAM_VARIADIC || + !typeNamesEqual(lastd.ArgType, firsto.ArgType) { + p.ereport("makeOrderedSetArgs", + "an ordered-set aggregate with a VARIADIC direct argument must have one VARIADIC aggregated argument of the same data type", + firsto.ArgType.GetLocation()) + } + ordered = nil + } + ndirect := int32(len(direct)) + return append(direct, ordered...), ndirect +} + +// typeNamesEqual is equal() on two TypeNames ignoring locations, as PG's +// equalfuncs do. +func typeNamesEqual(a, b *ast.TypeName) bool { + if len(a.GetNames()) != len(b.GetNames()) { + return false + } + for i := range a.GetNames() { + if asString(a.Names[i]).GetSval() != asString(b.Names[i]).GetSval() { + return false + } + } + return a.GetSetof() == b.GetSetof() && a.GetPctType() == b.GetPctType() && + len(a.GetArrayBounds()) == len(b.GetArrayBounds()) && + a.GetTypemod() == b.GetTypemod() && + len(a.GetTypmods()) == len(b.GetTypmods()) +} + +// parseAggregateWithArgtypes is gram.y's aggregate_with_argtypes. +func (p *parser) parseAggregateWithArgtypes() *ast.Node { + n := &ast.ObjectWithArgs{} + n.Objname = p.parseFuncName(p.peek()) + params, _ := p.parseAggrArgs() + n.Objargs = extractArgTypes(params) + n.Objfuncargs = params + return nObjectWithArgs(n) +} + +// parseAggregateWithArgtypesList is gram.y's aggregate_with_argtypes_list. +func (p *parser) parseAggregateWithArgtypesList() []*ast.Node { + list := []*ast.Node{p.parseAggregateWithArgtypes()} + for p.have(ast.Token(',')) { + list = append(list, p.parseAggregateWithArgtypes()) + } + return list +} + +// parseOperArgtypes is gram.y's oper_argtypes. +func (p *parser) parseOperArgtypes() []*ast.Node { + p.expect(ast.Token('(')) + var left, right *ast.Node + if p.have(ast.Token_NONE) { + left = nil + } else { + left = nTypeName(p.parseTypename()) + } + if p.kind() == ast.Token(')') { + ctok := p.peek() + p.ereport("base_yyparse", "missing argument", ctok.Start) + } + p.expect(ast.Token(',')) + if p.have(ast.Token_NONE) { + right = nil + } else { + right = nTypeName(p.parseTypename()) + } + p.expect(ast.Token(')')) + return []*ast.Node{left, right} +} + +// parseOperatorWithArgtypes is gram.y's operator_with_argtypes. +func (p *parser) parseOperatorWithArgtypes() *ast.Node { + n := &ast.ObjectWithArgs{ + Objname: p.parseAnyOperator(), + Objargs: p.parseOperArgtypes(), + } + return nObjectWithArgs(n) +} + +// parseOperatorWithArgtypesList is gram.y's operator_with_argtypes_list. +func (p *parser) parseOperatorWithArgtypesList() []*ast.Node { + list := []*ast.Node{p.parseOperatorWithArgtypes()} + for p.have(ast.Token(',')) { + list = append(list, p.parseOperatorWithArgtypes()) + } + return list +} + +// tryObjectTypeAnyName consumes gram.y's object_type_any_name when the +// lookahead matches it. +func (p *parser) tryObjectTypeAnyName() (ast.ObjectType, bool) { + switch p.kind() { + case ast.Token_TABLE: + p.next() + return ast.ObjectType_OBJECT_TABLE, true + case ast.Token_SEQUENCE: + p.next() + return ast.ObjectType_OBJECT_SEQUENCE, true + case ast.Token_VIEW: + p.next() + return ast.ObjectType_OBJECT_VIEW, true + case ast.Token_MATERIALIZED: + if p.kindN(1) == ast.Token_VIEW { + p.next() + p.next() + return ast.ObjectType_OBJECT_MATVIEW, true + } + case ast.Token_INDEX: + p.next() + return ast.ObjectType_OBJECT_INDEX, true + case ast.Token_FOREIGN: + if p.kindN(1) == ast.Token_TABLE { + p.next() + p.next() + return ast.ObjectType_OBJECT_FOREIGN_TABLE, true + } + case ast.Token_COLLATION: + p.next() + return ast.ObjectType_OBJECT_COLLATION, true + case ast.Token_CONVERSION_P: + p.next() + return ast.ObjectType_OBJECT_CONVERSION, true + case ast.Token_STATISTICS: + p.next() + return ast.ObjectType_OBJECT_STATISTIC_EXT, true + case ast.Token_TEXT_P: + if p.kindN(1) == ast.Token_SEARCH { + switch p.kindN(2) { + case ast.Token_PARSER: + p.next() + p.next() + p.next() + return ast.ObjectType_OBJECT_TSPARSER, true + case ast.Token_DICTIONARY: + p.next() + p.next() + p.next() + return ast.ObjectType_OBJECT_TSDICTIONARY, true + case ast.Token_TEMPLATE: + p.next() + p.next() + p.next() + return ast.ObjectType_OBJECT_TSTEMPLATE, true + case ast.Token_CONFIGURATION: + p.next() + p.next() + p.next() + return ast.ObjectType_OBJECT_TSCONFIGURATION, true + } + } + } + return 0, false +} + +// tryDropTypeName consumes gram.y's drop_type_name when the lookahead +// matches it. +func (p *parser) tryDropTypeName() (ast.ObjectType, bool) { + switch p.kind() { + case ast.Token_ACCESS: + if p.kindN(1) == ast.Token_METHOD { + p.next() + p.next() + return ast.ObjectType_OBJECT_ACCESS_METHOD, true + } + case ast.Token_EVENT: + if p.kindN(1) == ast.Token_TRIGGER { + p.next() + p.next() + return ast.ObjectType_OBJECT_EVENT_TRIGGER, true + } + case ast.Token_EXTENSION: + p.next() + return ast.ObjectType_OBJECT_EXTENSION, true + case ast.Token_FOREIGN: + if p.kindN(1) == ast.Token_DATA_P && p.kindN(2) == ast.Token_WRAPPER { + p.next() + p.next() + p.next() + return ast.ObjectType_OBJECT_FDW, true + } + case ast.Token_PROCEDURAL: + if p.kindN(1) == ast.Token_LANGUAGE { + p.next() + p.next() + return ast.ObjectType_OBJECT_LANGUAGE, true + } + case ast.Token_LANGUAGE: + p.next() + return ast.ObjectType_OBJECT_LANGUAGE, true + case ast.Token_PUBLICATION: + p.next() + return ast.ObjectType_OBJECT_PUBLICATION, true + case ast.Token_SCHEMA: + p.next() + return ast.ObjectType_OBJECT_SCHEMA, true + case ast.Token_SERVER: + p.next() + return ast.ObjectType_OBJECT_FOREIGN_SERVER, true + } + return 0, false +} + +// tryObjectTypeName consumes gram.y's object_type_name when the lookahead +// matches it. +func (p *parser) tryObjectTypeName() (ast.ObjectType, bool) { + if t, ok := p.tryDropTypeName(); ok { + return t, ok + } + switch p.kind() { + case ast.Token_DATABASE: + p.next() + return ast.ObjectType_OBJECT_DATABASE, true + case ast.Token_ROLE: + p.next() + return ast.ObjectType_OBJECT_ROLE, true + case ast.Token_SUBSCRIPTION: + p.next() + return ast.ObjectType_OBJECT_SUBSCRIPTION, true + case ast.Token_TABLESPACE: + p.next() + return ast.ObjectType_OBJECT_TABLESPACE, true + } + return 0, false +} + +// tryObjectTypeNameOnAnyName consumes gram.y's +// object_type_name_on_any_name when the lookahead matches it. +func (p *parser) tryObjectTypeNameOnAnyName() (ast.ObjectType, bool) { + switch p.kind() { + case ast.Token_POLICY: + p.next() + return ast.ObjectType_OBJECT_POLICY, true + case ast.Token_RULE: + p.next() + return ast.ObjectType_OBJECT_RULE, true + case ast.Token_TRIGGER: + p.next() + return ast.ObjectType_OBJECT_TRIGGER, true + } + return 0, false +} + +// newDropStmt builds the common DropStmt shell. +func newDropStmt(removeType ast.ObjectType) *ast.DropStmt { + return &ast.DropStmt{RemoveType: removeType} +} + +func nDropStmt(n *ast.DropStmt) *ast.Node { + return &ast.Node{Node: &ast.Node_DropStmt{DropStmt: n}} +} + +// parseDropIfExists consumes IF_P EXISTS if present. +func (p *parser) parseDropIfExists() bool { + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + return true + } + return false +} + +// parseCommentStmt is gram.y's CommentStmt. +func (p *parser) parseCommentStmt() *ast.Node { + p.expect(ast.Token_COMMENT) + p.expect(ast.Token_ON) + n := &ast.CommentStmt{} + n.Objtype, n.Object = p.parseCommentOrLabelObject() + p.expect(ast.Token_IS) + // comment_text: Sconst | NULL_P + if !p.have(ast.Token_NULL_P) { + n.Comment = p.sconst() + } + return &ast.Node{Node: &ast.Node_CommentStmt{CommentStmt: n}} +} + +// parseSecLabelStmt is gram.y's SecLabelStmt; SECURITY LABEL consumed by +// the caller. +func (p *parser) parseSecLabelStmt() *ast.Node { + n := &ast.SecLabelStmt{} + if p.have(ast.Token_FOR) { + n.Provider = p.nonReservedWordOrSconst() + } + p.expect(ast.Token_ON) + n.Objtype, n.Object = p.parseCommentOrLabelObject() + p.expect(ast.Token_IS) + if !p.have(ast.Token_NULL_P) { + n.Label = p.sconst() + } + return &ast.Node{Node: &ast.Node_SecLabelStmt{SecLabelStmt: n}} +} + +// parseCommentOrLabelObject parses the shared object reference of +// CommentStmt and SecLabelStmt (SecLabelStmt accepts a subset; the +// difference only shows as which error a bad object type raises, and both +// report at the same token). +func (p *parser) parseCommentOrLabelObject() (ast.ObjectType, *ast.Node) { + switch p.kind() { + case ast.Token_COLUMN: + p.next() + return ast.ObjectType_OBJECT_COLUMN, nList(p.anyName()) + case ast.Token_TYPE_P: + p.next() + return ast.ObjectType_OBJECT_TYPE, nTypeName(p.parseTypename()) + case ast.Token_DOMAIN_P: + p.next() + return ast.ObjectType_OBJECT_DOMAIN, nTypeName(p.parseTypename()) + case ast.Token_AGGREGATE: + p.next() + return ast.ObjectType_OBJECT_AGGREGATE, p.parseAggregateWithArgtypes() + case ast.Token_FUNCTION: + p.next() + return ast.ObjectType_OBJECT_FUNCTION, p.parseFunctionWithArgtypes() + case ast.Token_PROCEDURE: + p.next() + return ast.ObjectType_OBJECT_PROCEDURE, p.parseFunctionWithArgtypes() + case ast.Token_ROUTINE: + p.next() + return ast.ObjectType_OBJECT_ROUTINE, p.parseFunctionWithArgtypes() + case ast.Token_OPERATOR: + p.next() + switch p.kind() { + case ast.Token_CLASS: + p.next() + names := p.anyName() + p.expect(ast.Token_USING) + return ast.ObjectType_OBJECT_OPCLASS, + nList(append([]*ast.Node{nStr(p.name())}, names...)) + case ast.Token_FAMILY: + p.next() + names := p.anyName() + p.expect(ast.Token_USING) + return ast.ObjectType_OBJECT_OPFAMILY, + nList(append([]*ast.Node{nStr(p.name())}, names...)) + } + return ast.ObjectType_OBJECT_OPERATOR, p.parseOperatorWithArgtypes() + case ast.Token_CONSTRAINT: + p.next() + name := p.name() + p.expect(ast.Token_ON) + if p.have(ast.Token_DOMAIN_P) { + t := makeTypeNameFromNameList(p.anyName()) + return ast.ObjectType_OBJECT_DOMCONSTRAINT, + nList([]*ast.Node{nTypeName(t), nStr(name)}) + } + names := p.anyName() + return ast.ObjectType_OBJECT_TABCONSTRAINT, + nList(append(names, nStr(name))) + case ast.Token_TRANSFORM: + p.next() + p.expect(ast.Token_FOR) + t := p.parseTypename() + p.expect(ast.Token_LANGUAGE) + return ast.ObjectType_OBJECT_TRANSFORM, + nList([]*ast.Node{nTypeName(t), nStr(p.name())}) + case ast.Token_LARGE_P: + p.next() + p.expect(ast.Token_OBJECT_P) + return ast.ObjectType_OBJECT_LARGEOBJECT, p.parseNumericOnly() + case ast.Token_CAST: + p.next() + p.expect(ast.Token('(')) + from := p.parseTypename() + p.expect(ast.Token_AS) + to := p.parseTypename() + p.expect(ast.Token(')')) + return ast.ObjectType_OBJECT_CAST, + nList([]*ast.Node{nTypeName(from), nTypeName(to)}) + } + if t, ok := p.tryObjectTypeNameOnAnyName(); ok { + name := p.name() + p.expect(ast.Token_ON) + names := p.anyName() + return t, nList(append(names, nStr(name))) + } + if t, ok := p.tryObjectTypeAnyName(); ok { + return t, nList(p.anyName()) + } + if t, ok := p.tryObjectTypeName(); ok { + return t, nStr(p.name()) + } + p.syntaxErrorAt() + return 0, nil +} diff --git a/internal/parse/ddl_publication.go b/internal/parse/ddl_publication.go new file mode 100644 index 0000000..7f88de0 --- /dev/null +++ b/internal/parse/ddl_publication.go @@ -0,0 +1,288 @@ +package parse + +// Logical replication DDL: CreatePublicationStmt, AlterPublicationStmt, +// CreateSubscriptionStmt, AlterSubscriptionStmt. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +// parseCreatePublicationStmt is gram.y's CreatePublicationStmt; CREATE +// PUBLICATION consumed. +func (p *parser) parseCreatePublicationStmt() *ast.Node { + n := &ast.CreatePublicationStmt{Pubname: p.name()} + if p.have(ast.Token_FOR) { + if p.kind() == ast.Token_ALL && p.kindN(1) == ast.Token_TABLES { + p.next() + p.next() + n.ForAllTables = true + } else { + n.Pubobjects = p.parsePubObjList() + } + } + n.Options = p.parseOptDefinition() + return &ast.Node{Node: &ast.Node_CreatePublicationStmt{CreatePublicationStmt: n}} +} + +// parseAlterPublicationStmt handles ALTER PUBLICATION name ...; the name's +// tail (RENAME/OWNER) is resolved by the caller. +func (p *parser) parseAlterPublicationStmt(name string) *ast.Node { + // C's zero-valued action is AP_AddObjects. + n := &ast.AlterPublicationStmt{ + Pubname: name, + Action: ast.AlterPublicationAction_AP_AddObjects, + } + switch { + case p.have(ast.Token_SET): + if p.kind() == ast.Token('(') { + n.Options = p.parseDefinition() + return &ast.Node{Node: &ast.Node_AlterPublicationStmt{AlterPublicationStmt: n}} + } + n.Action = ast.AlterPublicationAction_AP_SetObjects + n.Pubobjects = p.parsePubObjList() + case p.have(ast.Token_ADD_P): + n.Action = ast.AlterPublicationAction_AP_AddObjects + n.Pubobjects = p.parsePubObjList() + case p.have(ast.Token_DROP): + n.Action = ast.AlterPublicationAction_AP_DropObjects + n.Pubobjects = p.parsePubObjList() + default: + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_AlterPublicationStmt{AlterPublicationStmt: n}} +} + +// parsePubObjList is gram.y's pub_obj_list plus preprocess_pubobj_list. +func (p *parser) parsePubObjList() []*ast.Node { + list := []*ast.Node{p.parsePublicationObjSpec()} + for p.have(ast.Token(',')) { + list = append(list, p.parsePublicationObjSpec()) + } + p.preprocessPubobjList(list) + return list +} + +func nPublicationObjSpec(n *ast.PublicationObjSpec) *ast.Node { + return &ast.Node{Node: &ast.Node_PublicationObjSpec{PublicationObjSpec: n}} +} + +// parsePublicationObjSpec is gram.y's PublicationObjSpec. +func (p *parser) parsePublicationObjSpec() *ast.Node { + tok := p.peek() + switch tok.Kind { + case ast.Token_TABLE: + p.next() + n := &ast.PublicationObjSpec{ + Pubobjtype: ast.PublicationObjSpecType_PUBLICATIONOBJ_TABLE, + Pubtable: &ast.PublicationTable{Relation: p.parseRelationExprVar()}, + } + p.finishPublicationTable(n.Pubtable) + return nPublicationObjSpec(n) + case ast.Token_TABLES: + p.next() + p.expect(ast.Token_IN_P) + p.expect(ast.Token_SCHEMA) + stok := p.peek() + if p.have(ast.Token_CURRENT_SCHEMA) { + return nPublicationObjSpec(&ast.PublicationObjSpec{ + Pubobjtype: ast.PublicationObjSpecType_PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA, + Location: stok.Start, + }) + } + return nPublicationObjSpec(&ast.PublicationObjSpec{ + Pubobjtype: ast.PublicationObjSpecType_PUBLICATIONOBJ_TABLES_IN_SCHEMA, + Name: p.colId(), + Location: stok.Start, + }) + case ast.Token_CURRENT_SCHEMA: + p.next() + return nPublicationObjSpec(&ast.PublicationObjSpec{ + Pubobjtype: ast.PublicationObjSpecType_PUBLICATIONOBJ_CONTINUATION, + Location: tok.Start, + }) + case ast.Token_ONLY: + // extended_relation_expr + p.next() + n := &ast.PublicationObjSpec{ + Pubobjtype: ast.PublicationObjSpecType_PUBLICATIONOBJ_CONTINUATION, + Pubtable: &ast.PublicationTable{}, + } + var rel *ast.RangeVar + if p.have(ast.Token('(')) { + rel = p.parseQualifiedName() + p.expect(ast.Token(')')) + } else { + rel = p.parseQualifiedName() + } + rel.Inh = false + n.Pubtable.Relation = rel + p.finishPublicationTable(n.Pubtable) + return nPublicationObjSpec(n) + } + + // ColId [indirection] forms and qualified_name '*'. + name := p.colId() + n := &ast.PublicationObjSpec{ + Pubobjtype: ast.PublicationObjSpecType_PUBLICATIONOBJ_CONTINUATION, + Location: tok.Start, + } + if p.kind() == ast.Token('.') { + ind := p.parseOptIndirection() + rel := p.makeRangeVarFromQualifiedName(name, ind, tok.Start) + if p.have(ast.Token('*')) { + rel.Inh = true + } + n.Pubtable = &ast.PublicationTable{Relation: rel} + p.finishPublicationTable(n.Pubtable) + return nPublicationObjSpec(n) + } + if p.have(ast.Token('*')) { + // extended_relation_expr: qualified_name '*' + rel := makeRangeVar("", name, tok.Start) + rel.Inh = true + n.Pubtable = &ast.PublicationTable{Relation: rel} + n.Location = 0 + p.finishPublicationTable(n.Pubtable) + return nPublicationObjSpec(n) + } + var cols []*ast.Node + if p.have(ast.Token('(')) { + cols = p.columnList() + p.expect(ast.Token(')')) + } + var where *ast.Node + if p.have(ast.Token_WHERE) { + p.expect(ast.Token('(')) + where = p.parseAExpr(0) + p.expect(ast.Token(')')) + } + if cols != nil || where != nil { + n.Pubtable = &ast.PublicationTable{ + Relation: makeRangeVar("", name, tok.Start), + Columns: cols, + WhereClause: where, + } + } else { + n.Name = name + } + return nPublicationObjSpec(n) +} + +// finishPublicationTable parses opt_column_list OptWhereClause into a +// PublicationTable. +func (p *parser) finishPublicationTable(t *ast.PublicationTable) { + if p.have(ast.Token('(')) { + t.Columns = p.columnList() + p.expect(ast.Token(')')) + } + if p.have(ast.Token_WHERE) { + p.expect(ast.Token('(')) + t.WhereClause = p.parseAExpr(0) + p.expect(ast.Token(')')) + } +} + +// preprocessPubobjList is gram.y's preprocess_pubobj_list. +func (p *parser) preprocessPubobjList(list []*ast.Node) { + if len(list) == 0 { + return + } + first := list[0].GetPublicationObjSpec() + if first.Pubobjtype == ast.PublicationObjSpecType_PUBLICATIONOBJ_CONTINUATION { + p.ereport("preprocess_pubobj_list", "invalid publication object list", first.Location) + } + prev := ast.PublicationObjSpecType_PUBLICATIONOBJ_CONTINUATION + for _, item := range list { + obj := item.GetPublicationObjSpec() + if obj.Pubobjtype == ast.PublicationObjSpecType_PUBLICATIONOBJ_CONTINUATION { + obj.Pubobjtype = prev + } + switch obj.Pubobjtype { + case ast.PublicationObjSpecType_PUBLICATIONOBJ_TABLE: + if obj.Name == "" && obj.Pubtable == nil { + p.ereport("preprocess_pubobj_list", "invalid table name", obj.Location) + } + if obj.Name != "" { + obj.Pubtable = &ast.PublicationTable{ + Relation: makeRangeVar("", obj.Name, obj.Location), + } + obj.Name = "" + } + case ast.PublicationObjSpecType_PUBLICATIONOBJ_TABLES_IN_SCHEMA, + ast.PublicationObjSpecType_PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA: + if obj.Pubtable != nil && obj.Pubtable.WhereClause != nil { + p.ereport("preprocess_pubobj_list", "WHERE clause not allowed for schema", obj.Location) + } + if obj.Pubtable != nil && obj.Pubtable.Columns != nil { + p.ereport("preprocess_pubobj_list", "column specification not allowed for schema", obj.Location) + } + switch { + case obj.Name != "": + obj.Pubobjtype = ast.PublicationObjSpecType_PUBLICATIONOBJ_TABLES_IN_SCHEMA + case obj.Pubtable == nil: + obj.Pubobjtype = ast.PublicationObjSpecType_PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA + default: + p.ereport("preprocess_pubobj_list", "invalid schema name", obj.Location) + } + } + prev = obj.Pubobjtype + } +} + +// parseCreateSubscriptionStmt is gram.y's CreateSubscriptionStmt; CREATE +// SUBSCRIPTION consumed. +func (p *parser) parseCreateSubscriptionStmt() *ast.Node { + n := &ast.CreateSubscriptionStmt{Subname: p.name()} + p.expect(ast.Token_CONNECTION) + n.Conninfo = p.sconst() + p.expect(ast.Token_PUBLICATION) + n.Publication = p.nameList() + n.Options = p.parseOptDefinition() + return &ast.Node{Node: &ast.Node_CreateSubscriptionStmt{CreateSubscriptionStmt: n}} +} + +// parseAlterSubscriptionStmt handles ALTER SUBSCRIPTION name ...; alterLoc +// is the ALTER token's location (used by the ENABLE/DISABLE DefElem). +func (p *parser) parseAlterSubscriptionStmt(name string, alterLoc int32) *ast.Node { + n := &ast.AlterSubscriptionStmt{Subname: name} + switch { + case p.have(ast.Token_SET): + if p.have(ast.Token_PUBLICATION) { + n.Kind = ast.AlterSubscriptionType_ALTER_SUBSCRIPTION_SET_PUBLICATION + n.Publication = p.nameList() + n.Options = p.parseOptDefinition() + } else { + n.Kind = ast.AlterSubscriptionType_ALTER_SUBSCRIPTION_OPTIONS + n.Options = p.parseDefinition() + } + case p.have(ast.Token_CONNECTION): + n.Kind = ast.AlterSubscriptionType_ALTER_SUBSCRIPTION_CONNECTION + n.Conninfo = p.sconst() + case p.have(ast.Token_REFRESH): + p.expect(ast.Token_PUBLICATION) + n.Kind = ast.AlterSubscriptionType_ALTER_SUBSCRIPTION_REFRESH + n.Options = p.parseOptDefinition() + case p.have(ast.Token_ADD_P): + p.expect(ast.Token_PUBLICATION) + n.Kind = ast.AlterSubscriptionType_ALTER_SUBSCRIPTION_ADD_PUBLICATION + n.Publication = p.nameList() + n.Options = p.parseOptDefinition() + case p.have(ast.Token_DROP): + p.expect(ast.Token_PUBLICATION) + n.Kind = ast.AlterSubscriptionType_ALTER_SUBSCRIPTION_DROP_PUBLICATION + n.Publication = p.nameList() + n.Options = p.parseOptDefinition() + case p.have(ast.Token_ENABLE_P): + n.Kind = ast.AlterSubscriptionType_ALTER_SUBSCRIPTION_ENABLED + n.Options = []*ast.Node{makeDefElem("enabled", nBoolean(true), alterLoc)} + case p.have(ast.Token_DISABLE_P): + n.Kind = ast.AlterSubscriptionType_ALTER_SUBSCRIPTION_ENABLED + n.Options = []*ast.Node{makeDefElem("enabled", nBoolean(false), alterLoc)} + case p.have(ast.Token_SKIP): + n.Kind = ast.AlterSubscriptionType_ALTER_SUBSCRIPTION_SKIP + n.Options = p.parseDefinition() + default: + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_AlterSubscriptionStmt{AlterSubscriptionStmt: n}} +} diff --git a/internal/parse/ddl_role.go b/internal/parse/ddl_role.go new file mode 100644 index 0000000..f59841e --- /dev/null +++ b/internal/parse/ddl_role.go @@ -0,0 +1,346 @@ +package parse + +// Role and schema DDL: CreateRoleStmt/CreateUserStmt/CreateGroupStmt, +// AlterRoleStmt, AlterRoleSetStmt, AlterGroupStmt, DropRoleStmt, +// CreateSchemaStmt, plus RoleSpec/RoleId/role_list and CallStmt. + +import ( + "fmt" + + "github.com/sqlc-dev/oliphant/ast" +) + +// parseCallStmt is gram.y's CallStmt: CALL func_application. +func (p *parser) parseCallStmt() *ast.Node { + p.expect(ast.Token_CALL) + tok := p.peek() + name := p.parseFuncName(tok) + fn := p.parseFuncApplicationNoDecoration(name, tok) + return &ast.Node{Node: &ast.Node_CallStmt{CallStmt: &ast.CallStmt{ + Funccall: asFuncCall(fn), + }}} +} + +// parseRoleSpec is gram.y's RoleSpec. +func (p *parser) parseRoleSpec() *ast.RoleSpec { + tok := p.peek() + switch tok.Kind { + case ast.Token_CURRENT_ROLE: + p.next() + return &ast.RoleSpec{Roletype: ast.RoleSpecType_ROLESPEC_CURRENT_ROLE, Location: tok.Start} + case ast.Token_CURRENT_USER: + p.next() + return &ast.RoleSpec{Roletype: ast.RoleSpecType_ROLESPEC_CURRENT_USER, Location: tok.Start} + case ast.Token_SESSION_USER: + p.next() + return &ast.RoleSpec{Roletype: ast.RoleSpecType_ROLESPEC_SESSION_USER, Location: tok.Start} + } + name := p.nonReservedWord() + // gram.y: "public" and "none" are not keywords, but are special here. + switch name { + case "public": + return &ast.RoleSpec{Roletype: ast.RoleSpecType_ROLESPEC_PUBLIC, Location: tok.Start} + case "none": + p.ereport("base_yyparse", `role name "none" is reserved`, tok.Start) + } + return &ast.RoleSpec{ + Roletype: ast.RoleSpecType_ROLESPEC_CSTRING, + Rolename: name, + Location: tok.Start, + } +} + +// parseRoleId is gram.y's RoleId: a RoleSpec restricted to plain names. +func (p *parser) parseRoleId() string { + tok := p.peek() + spec := p.parseRoleSpec() + switch spec.Roletype { + case ast.RoleSpecType_ROLESPEC_CSTRING: + return spec.Rolename + case ast.RoleSpecType_ROLESPEC_PUBLIC: + p.ereport("base_yyparse", `role name "public" is reserved`, tok.Start) + case ast.RoleSpecType_ROLESPEC_SESSION_USER: + p.ereport("base_yyparse", "SESSION_USER cannot be used as a role name here", tok.Start) + case ast.RoleSpecType_ROLESPEC_CURRENT_USER: + p.ereport("base_yyparse", "CURRENT_USER cannot be used as a role name here", tok.Start) + case ast.RoleSpecType_ROLESPEC_CURRENT_ROLE: + p.ereport("base_yyparse", "CURRENT_ROLE cannot be used as a role name here", tok.Start) + } + return "" +} + +func nRoleSpec(r *ast.RoleSpec) *ast.Node { + return &ast.Node{Node: &ast.Node_RoleSpec{RoleSpec: r}} +} + +// parseRoleList is gram.y's role_list. +func (p *parser) parseRoleList() []*ast.Node { + list := []*ast.Node{nRoleSpec(p.parseRoleSpec())} + for p.have(ast.Token(',')) { + list = append(list, nRoleSpec(p.parseRoleSpec())) + } + return list +} + +// parseOptWith is gram.y's opt_with: WITH | WITH_LA | empty. +func (p *parser) parseOptWith() { + if p.kind() == ast.Token_WITH || p.kind() == ast.Token_WITH_LA { + p.next() + } +} + +// parseCreateRoleStmt is gram.y's CreateRoleStmt/CreateUserStmt/ +// CreateGroupStmt; CREATE has been consumed and the ROLE/USER/GROUP_P +// keyword selects the stmt_type. +func (p *parser) parseCreateRoleStmt(stmtType ast.RoleStmtType) *ast.Node { + p.next() // ROLE, USER, or GROUP_P + n := &ast.CreateRoleStmt{StmtType: stmtType} + n.Role = p.parseRoleId() + p.parseOptWith() + n.Options = p.parseOptRoleList(true) + return &ast.Node{Node: &ast.Node_CreateRoleStmt{CreateRoleStmt: n}} +} + +// parseOptRoleList is gram.y's OptRoleList (create=true) or +// AlterOptRoleList (create=false): a juxtaposed list of role options. +func (p *parser) parseOptRoleList(create bool) []*ast.Node { + var list []*ast.Node + for { + el := p.parseRoleElem(create) + if el == nil { + return list + } + list = append(list, el) + } +} + +// parseRoleElem is gram.y's AlterOptRoleElem plus, when create is true, the +// CreateOptRoleElem extras. Returns nil when the lookahead does not start a +// role option. +func (p *parser) parseRoleElem(create bool) *ast.Node { + tok := p.peek() + switch tok.Kind { + case ast.Token_PASSWORD: + p.next() + vtok := p.peek() + switch vtok.Kind { + case ast.Token_SCONST: + return makeDefElem("password", nStr(p.sconst()), tok.Start) + case ast.Token_PARAM: + p.next() + return makeDefElem("password", makeParamRef(vtok.Ival, vtok.Start), tok.Start) + case ast.Token_NULL_P: + p.next() + return makeDefElem("password", nil, tok.Start) + } + p.syntaxErrorAt() + case ast.Token_ENCRYPTED: + p.next() + p.expect(ast.Token_PASSWORD) + vtok := p.peek() + switch vtok.Kind { + case ast.Token_SCONST: + return makeDefElem("password", nStr(p.sconst()), tok.Start) + case ast.Token_PARAM: + p.next() + return makeDefElem("password", makeParamRef(vtok.Ival, vtok.Start), tok.Start) + } + p.syntaxErrorAt() + case ast.Token_UNENCRYPTED: + p.next() + p.expect(ast.Token_PASSWORD) + p.ereport("base_yyparse", "UNENCRYPTED PASSWORD is no longer supported", tok.Start) + case ast.Token_INHERIT: + p.next() + return makeDefElem("inherit", nBoolean(true), tok.Start) + case ast.Token_CONNECTION: + p.next() + p.expect(ast.Token_LIMIT) + return makeDefElem("connectionlimit", nInteger(p.parseSignedIconst()), tok.Start) + case ast.Token_VALID: + p.next() + p.expect(ast.Token_UNTIL) + return makeDefElem("validUntil", nStr(p.sconst()), tok.Start) + case ast.Token_USER: + p.next() + return makeDefElem("rolemembers", nList(p.parseRoleList()), tok.Start) + case ast.Token_IDENT: + p.next() + var name string + var val bool + switch tok.Str { + case "superuser": + name, val = "superuser", true + case "nosuperuser": + name, val = "superuser", false + case "createrole": + name, val = "createrole", true + case "nocreaterole": + name, val = "createrole", false + case "replication": + name, val = "isreplication", true + case "noreplication": + name, val = "isreplication", false + case "createdb": + name, val = "createdb", true + case "nocreatedb": + name, val = "createdb", false + case "login": + name, val = "canlogin", true + case "nologin": + name, val = "canlogin", false + case "bypassrls": + name, val = "bypassrls", true + case "nobypassrls": + name, val = "bypassrls", false + case "noinherit": + name, val = "inherit", false + default: + p.ereport("base_yyparse", fmt.Sprintf("unrecognized role option %q", tok.Str), tok.Start) + } + return makeDefElem(name, nBoolean(val), tok.Start) + } + if create { + switch tok.Kind { + case ast.Token_SYSID: + p.next() + return makeDefElem("sysid", nInteger(p.iconst()), tok.Start) + case ast.Token_ADMIN: + p.next() + return makeDefElem("adminmembers", nList(p.parseRoleList()), tok.Start) + case ast.Token_ROLE: + p.next() + return makeDefElem("rolemembers", nList(p.parseRoleList()), tok.Start) + case ast.Token_IN_P: + p.next() + switch p.kind() { + case ast.Token_ROLE, ast.Token_GROUP_P: + p.next() + return makeDefElem("addroleto", nList(p.parseRoleList()), tok.Start) + } + p.syntaxErrorAt() + } + } + return nil +} + +// parseAlterRoleStmtRest is gram.y's AlterRoleStmt and AlterRoleSetStmt +// with ALTER ROLE/USER RoleSpec already consumed. +func (p *parser) parseAlterRoleStmtRest(role *ast.RoleSpec) *ast.Node { + // IN DATABASE / SET / RESET pick AlterRoleSetStmt. + switch p.kind() { + case ast.Token_IN_P: + n := &ast.AlterRoleSetStmt{Role: role} + p.next() + p.expect(ast.Token_DATABASE) + n.Database = p.name() + n.Setstmt = p.parseSetResetClause() + return &ast.Node{Node: &ast.Node_AlterRoleSetStmt{AlterRoleSetStmt: n}} + case ast.Token_SET, ast.Token_RESET: + n := &ast.AlterRoleSetStmt{Role: role, Setstmt: p.parseSetResetClause()} + return &ast.Node{Node: &ast.Node_AlterRoleSetStmt{AlterRoleSetStmt: n}} + } + + n := &ast.AlterRoleStmt{Role: role, Action: 1} + p.parseOptWith() + n.Options = p.parseOptRoleList(false) + return &ast.Node{Node: &ast.Node_AlterRoleStmt{AlterRoleStmt: n}} +} + +// parseAlterGroupStmtRest is gram.y's AlterGroupStmt with ALTER GROUP_P +// RoleSpec already consumed. +func (p *parser) parseAlterGroupStmtRest(role *ast.RoleSpec) *ast.Node { + var action int32 + switch p.kind() { + case ast.Token_ADD_P: + p.next() + action = 1 + case ast.Token_DROP: + p.next() + action = -1 + default: + p.syntaxErrorAt() + } + p.expect(ast.Token_USER) + // gram.y gives the DefElem @6 — the role_list's location. + ltok := p.peek() + n := &ast.AlterRoleStmt{ + Role: role, + Action: action, + Options: []*ast.Node{ + makeDefElem("rolemembers", nList(p.parseRoleList()), ltok.Start), + }, + } + return &ast.Node{Node: &ast.Node_AlterRoleStmt{AlterRoleStmt: n}} +} + +// parseDropRoleStmt is gram.y's DropRoleStmt; DROP ROLE/USER/GROUP_P +// consumed. +func (p *parser) parseDropRoleStmt() *ast.Node { + n := &ast.DropRoleStmt{} + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_EXISTS) + n.MissingOk = true + } + n.Roles = p.parseRoleList() + return &ast.Node{Node: &ast.Node_DropRoleStmt{DropRoleStmt: n}} +} + +// parseCreateSchemaStmt is gram.y's CreateSchemaStmt; CREATE SCHEMA +// consumed. +func (p *parser) parseCreateSchemaStmt() *ast.Node { + n := &ast.CreateSchemaStmt{} + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + n.IfNotExists = true + } + // opt_single_name AUTHORIZATION RoleSpec | ColId + if p.kind() == ast.Token_AUTHORIZATION { + p.next() + n.Authrole = p.parseRoleSpec() + } else { + n.Schemaname = p.colId() + if p.have(ast.Token_AUTHORIZATION) { + n.Authrole = p.parseRoleSpec() + } + } + // OptSchemaEltList + eltTok := p.peek() + elts := p.parseOptSchemaEltList() + if n.IfNotExists && elts != nil { + p.ereport("base_yyparse", "CREATE SCHEMA IF NOT EXISTS cannot include schema elements", eltTok.Start) + } + n.SchemaElts = elts + return &ast.Node{Node: &ast.Node_CreateSchemaStmt{CreateSchemaStmt: n}} +} + +// parseOptSchemaEltList is gram.y's OptSchemaEltList/schema_stmt: the +// statements that can appear inside CREATE SCHEMA. +func (p *parser) parseOptSchemaEltList() []*ast.Node { + var list []*ast.Node + for { + var stmt *ast.Node + switch p.kind() { + case ast.Token_CREATE: + stmt = p.parseCreateSchemaElt() + case ast.Token_GRANT: + stmt = p.parseGrantStmt() + default: + return list + } + list = append(list, stmt) + } +} + +// parseCreateSchemaElt dispatches the CREATE-headed schema_stmt +// alternatives: CreateStmt, IndexStmt, CreateSeqStmt, CreateTrigStmt, +// ViewStmt. +func (p *parser) parseCreateSchemaElt() *ast.Node { + p.expect(ast.Token_CREATE) + stmt := p.parseCreateStmtFamily(true) + if stmt == nil { + p.syntaxErrorAt() + } + return stmt +} diff --git a/internal/parse/ddl_rule.go b/internal/parse/ddl_rule.go new file mode 100644 index 0000000..a4c682c --- /dev/null +++ b/internal/parse/ddl_rule.go @@ -0,0 +1,201 @@ +package parse + +// RuleStmt, CreatePLangStmt, CreateTableSpaceStmt, CreateConversionStmt, +// CreateTransformStmt, and AlterTSConfigurationStmt. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +// parseRuleStmt is gram.y's RuleStmt; CREATE [OR REPLACE] RULE consumed. +func (p *parser) parseRuleStmt(replace bool) *ast.Node { + n := &ast.RuleStmt{Replace: replace, Rulename: p.name()} + p.expect(ast.Token_AS) + p.expect(ast.Token_ON) + // event + switch { + case p.have(ast.Token_SELECT): + n.Event = ast.CmdType_CMD_SELECT + case p.have(ast.Token_UPDATE): + n.Event = ast.CmdType_CMD_UPDATE + case p.have(ast.Token_DELETE_P): + n.Event = ast.CmdType_CMD_DELETE + case p.have(ast.Token_INSERT): + n.Event = ast.CmdType_CMD_INSERT + default: + p.syntaxErrorAt() + } + p.expect(ast.Token_TO) + n.Relation = p.parseQualifiedName() + if p.have(ast.Token_WHERE) { + n.WhereClause = p.parseAExpr(0) + } + p.expect(ast.Token_DO) + // opt_instead + switch { + case p.have(ast.Token_INSTEAD): + n.Instead = true + case p.have(ast.Token_ALSO): + } + // RuleActionList + switch { + case p.have(ast.Token_NOTHING): + case p.have(ast.Token('(')): + // RuleActionMulti + for { + if stmt := p.parseRuleActionStmtOrEmpty(); stmt != nil { + n.Actions = append(n.Actions, stmt) + } + if !p.have(ast.Token(';')) { + break + } + } + p.expect(ast.Token(')')) + default: + n.Actions = []*ast.Node{p.parseRuleActionStmt()} + } + return &ast.Node{Node: &ast.Node_RuleStmt{RuleStmt: n}} +} + +// parseRuleActionStmt is gram.y's RuleActionStmt. +func (p *parser) parseRuleActionStmt() *ast.Node { + switch p.kind() { + case ast.Token_SELECT, ast.Token_TABLE, ast.Token_VALUES, ast.Token('('): + return p.parseSelectStmt() + case ast.Token_WITH, ast.Token_WITH_LA: + return p.parseWithPrefixedStmt() + case ast.Token_INSERT: + return p.parseInsertStmt(nil) + case ast.Token_UPDATE: + return p.parseUpdateStmt(nil) + case ast.Token_DELETE_P: + return p.parseDeleteStmt(nil) + case ast.Token_NOTIFY: + return p.parseNotifyStmt() + } + p.syntaxErrorAt() + return nil +} + +// parseRuleActionStmtOrEmpty is gram.y's RuleActionStmtOrEmpty. +func (p *parser) parseRuleActionStmtOrEmpty() *ast.Node { + switch p.kind() { + case ast.Token(';'), ast.Token(')'): + return nil + } + return p.parseRuleActionStmt() +} + +// parseCreatePLangStmt is gram.y's CreatePLangStmt; CREATE [OR REPLACE] +// consumed, [TRUSTED] [PROCEDURAL] LANGUAGE ahead. +func (p *parser) parseCreatePLangStmt(replace bool) *ast.Node { + trusted := p.have(ast.Token_TRUSTED) + p.have(ast.Token_PROCEDURAL) + p.expect(ast.Token_LANGUAGE) + name := p.name() + if p.kind() != ast.Token_HANDLER { + // Parameterless CREATE LANGUAGE is interpreted as CREATE EXTENSION, + // with OR REPLACE translated to IF NOT EXISTS. + return &ast.Node{Node: &ast.Node_CreateExtensionStmt{CreateExtensionStmt: &ast.CreateExtensionStmt{ + IfNotExists: replace, + Extname: name, + }}} + } + p.next() + n := &ast.CreatePLangStmt{ + Replace: replace, + Plname: name, + Pltrusted: trusted, + Plhandler: p.parseHandlerName(), + } + if p.have(ast.Token_INLINE_P) { + n.Plinline = p.parseHandlerName() + } + // opt_validator + switch { + case p.have(ast.Token_VALIDATOR): + n.Plvalidator = p.parseHandlerName() + case p.kind() == ast.Token_NO && p.kindN(1) == ast.Token_VALIDATOR: + p.next() + p.next() + } + return &ast.Node{Node: &ast.Node_CreatePlangStmt{CreatePlangStmt: n}} +} + +// parseCreateTableSpaceStmt is gram.y's CreateTableSpaceStmt; CREATE +// TABLESPACE consumed. +func (p *parser) parseCreateTableSpaceStmt() *ast.Node { + n := &ast.CreateTableSpaceStmt{Tablespacename: p.name()} + if p.have(ast.Token_OWNER) { + n.Owner = p.parseRoleSpec() + } + p.expect(ast.Token_LOCATION) + n.Location = p.sconst() + if p.kind() == ast.Token_WITH && p.kindN(1) == ast.Token('(') { + p.next() + n.Options = p.parseReloptions() + } + return &ast.Node{Node: &ast.Node_CreateTableSpaceStmt{CreateTableSpaceStmt: n}} +} + +// parseCreateConversionStmt is gram.y's CreateConversionStmt; CREATE +// [DEFAULT] CONVERSION consumed, def passed by the dispatcher. +func (p *parser) parseCreateConversionStmt(isDefault bool) *ast.Node { + n := &ast.CreateConversionStmt{Def: isDefault, ConversionName: p.anyName()} + p.expect(ast.Token_FOR) + n.ForEncodingName = p.sconst() + p.expect(ast.Token_TO) + n.ToEncodingName = p.sconst() + p.expect(ast.Token_FROM) + n.FuncName = p.anyName() + return &ast.Node{Node: &ast.Node_CreateConversionStmt{CreateConversionStmt: n}} +} + +// parseCreateTransformStmt is gram.y's CreateTransformStmt; CREATE +// [OR REPLACE] TRANSFORM consumed. +func (p *parser) parseCreateTransformStmt(replace bool) *ast.Node { + n := &ast.CreateTransformStmt{Replace: replace} + p.expect(ast.Token_FOR) + n.TypeName = p.parseTypename() + p.expect(ast.Token_LANGUAGE) + n.Lang = p.name() + p.expect(ast.Token('(')) + // transform_element_list + parseElem := func() (bool, *ast.ObjectWithArgs) { + fromSQL := false + switch { + case p.have(ast.Token_FROM): + fromSQL = true + case p.have(ast.Token_TO): + default: + p.syntaxErrorAt() + } + p.expect(ast.Token_SQL_P) + if !p.have(ast.Token_WITH) && !p.have(ast.Token_WITH_LA) { + p.syntaxErrorAt() + } + p.expect(ast.Token_FUNCTION) + return fromSQL, p.parseFunctionWithArgtypes().GetObjectWithArgs() + } + from1, fn1 := parseElem() + if from1 { + n.Fromsql = fn1 + } else { + n.Tosql = fn1 + } + if p.have(ast.Token(',')) { + // The second element must go the other direction. + dtok := p.peek() + from2, fn2 := parseElem() + if from2 == from1 { + p.syntaxError(dtok) + } + if from2 { + n.Fromsql = fn2 + } else { + n.Tosql = fn2 + } + } + p.expect(ast.Token(')')) + return &ast.Node{Node: &ast.Node_CreateTransformStmt{CreateTransformStmt: n}} +} diff --git a/internal/parse/ddl_trigger.go b/internal/parse/ddl_trigger.go new file mode 100644 index 0000000..b4c966c --- /dev/null +++ b/internal/parse/ddl_trigger.go @@ -0,0 +1,214 @@ +package parse + +// CreateTrigStmt (CREATE [CONSTRAINT] TRIGGER) and CreateEventTrigStmt. + +import ( + "strconv" + + "github.com/sqlc-dev/oliphant/ast" +) + +// Trigger type bits from trigger.h. +const ( + triggerTypeRow = 1 << 0 + triggerTypeBefore = 1 << 1 + triggerTypeInsert = 1 << 2 + triggerTypeDelete = 1 << 3 + triggerTypeUpdate = 1 << 4 + triggerTypeTruncate = 1 << 5 + triggerTypeInstead = 1 << 6 + triggerTypeAfter = 0 +) + +// parseCreateTrigStmt is gram.y's CreateTrigStmt. CREATE [OR REPLACE] +// [CONSTRAINT] is consumed; TRIGGER is the lookahead. +func (p *parser) parseCreateTrigStmt(replace, isConstraint bool) *ast.Node { + p.expect(ast.Token_TRIGGER) + n := &ast.CreateTrigStmt{Replace: replace, Isconstraint: isConstraint} + n.Trigname = p.name() + + if isConstraint { + if replace { + // gram.y: not supported, see CreateTrigger (no error position). + p.ereport("base_yyparse", "CREATE OR REPLACE CONSTRAINT TRIGGER is not supported", -1) + } + p.expect(ast.Token_AFTER) + n.Timing = triggerTypeAfter + n.Events, n.Columns = p.parseTriggerEvents() + p.expect(ast.Token_ON) + n.Relation = p.parseQualifiedName() + if p.have(ast.Token_FROM) { + n.Constrrel = p.parseQualifiedName() + } + cas, casLoc := p.parseConstraintAttributeSpec() + p.processCASbits(cas, casLoc, "TRIGGER", &n.Deferrable, &n.Initdeferred, nil, nil) + p.expect(ast.Token_FOR) + p.have(ast.Token_EACH) + p.expect(ast.Token_ROW) + n.Row = true + if p.have(ast.Token_WHEN) { + p.expect(ast.Token('(')) + n.WhenClause = p.parseAExpr(0) + p.expect(ast.Token(')')) + } + } else { + // TriggerActionTime + switch { + case p.have(ast.Token_BEFORE): + n.Timing = triggerTypeBefore + case p.have(ast.Token_AFTER): + n.Timing = triggerTypeAfter + case p.have(ast.Token_INSTEAD): + p.expect(ast.Token_OF) + n.Timing = triggerTypeInstead + default: + p.syntaxErrorAt() + } + n.Events, n.Columns = p.parseTriggerEvents() + p.expect(ast.Token_ON) + n.Relation = p.parseQualifiedName() + // TriggerReferencing + if p.have(ast.Token_REFERENCING) { + for { + t := &ast.TriggerTransition{} + switch { + case p.have(ast.Token_NEW): + t.IsNew = true + case p.have(ast.Token_OLD): + default: + p.syntaxErrorAt() + } + switch { + case p.have(ast.Token_TABLE): + t.IsTable = true + case p.have(ast.Token_ROW): + default: + p.syntaxErrorAt() + } + p.have(ast.Token_AS) + t.Name = p.colId() + n.TransitionRels = append(n.TransitionRels, + &ast.Node{Node: &ast.Node_TriggerTransition{TriggerTransition: t}}) + if p.kind() != ast.Token_NEW && p.kind() != ast.Token_OLD { + break + } + } + } + // TriggerForSpec + if p.have(ast.Token_FOR) { + p.have(ast.Token_EACH) + switch { + case p.have(ast.Token_ROW): + n.Row = true + case p.have(ast.Token_STATEMENT): + default: + p.syntaxErrorAt() + } + } + if p.have(ast.Token_WHEN) { + p.expect(ast.Token('(')) + n.WhenClause = p.parseAExpr(0) + p.expect(ast.Token(')')) + } + } + + p.expect(ast.Token_EXECUTE) + p.parseFunctionOrProcedure() + n.Funcname = p.parseFuncName(p.peek()) + p.expect(ast.Token('(')) + // TriggerFuncArgs + if p.kind() != ast.Token(')') { + n.Args = append(n.Args, p.parseTriggerFuncArg()) + for p.have(ast.Token(',')) { + n.Args = append(n.Args, p.parseTriggerFuncArg()) + } + } + p.expect(ast.Token(')')) + return &ast.Node{Node: &ast.Node_CreateTrigStmt{CreateTrigStmt: n}} +} + +// parseFunctionOrProcedure is gram.y's FUNCTION_or_PROCEDURE. +func (p *parser) parseFunctionOrProcedure() { + if !p.have(ast.Token_FUNCTION) && !p.have(ast.Token_PROCEDURE) { + p.syntaxErrorAt() + } +} + +// parseTriggerEvents is gram.y's TriggerEvents/TriggerOneEvent. +func (p *parser) parseTriggerEvents() (int32, []*ast.Node) { + events, columns := p.parseTriggerOneEvent() + for p.have(ast.Token_OR) { + ev2, cols2 := p.parseTriggerOneEvent() + if events&ev2 != 0 { + p.parserYyerror("duplicate trigger events specified") + } + events |= ev2 + columns = append(columns, cols2...) + } + return events, columns +} + +// parseTriggerOneEvent is gram.y's TriggerOneEvent. +func (p *parser) parseTriggerOneEvent() (int32, []*ast.Node) { + switch { + case p.have(ast.Token_INSERT): + return triggerTypeInsert, nil + case p.have(ast.Token_DELETE_P): + return triggerTypeDelete, nil + case p.have(ast.Token_UPDATE): + if p.have(ast.Token_OF) { + return triggerTypeUpdate, p.columnList() + } + return triggerTypeUpdate, nil + case p.have(ast.Token_TRUNCATE): + return triggerTypeTruncate, nil + } + p.syntaxErrorAt() + return 0, nil +} + +// parseTriggerFuncArg is gram.y's TriggerFuncArg. +func (p *parser) parseTriggerFuncArg() *ast.Node { + tok := p.peek() + switch tok.Kind { + case ast.Token_ICONST: + return nStr(strconv.Itoa(int(p.iconst()))) + case ast.Token_FCONST, ast.Token_SCONST: + p.next() + return nStr(tok.Str) + } + return nStr(p.colLabel()) +} + +// parseCreateEventTrigStmt is gram.y's CreateEventTrigStmt; CREATE EVENT +// TRIGGER consumed. +func (p *parser) parseCreateEventTrigStmt() *ast.Node { + n := &ast.CreateEventTrigStmt{Trigname: p.name()} + p.expect(ast.Token_ON) + n.Eventname = p.colLabel() + if p.have(ast.Token_WHEN) { + // event_trigger_when_list + for { + etok := p.peek() + name := p.colId() + p.expect(ast.Token_IN_P) + p.expect(ast.Token('(')) + var vals []*ast.Node + vals = append(vals, nStr(p.sconst())) + for p.have(ast.Token(',')) { + vals = append(vals, nStr(p.sconst())) + } + p.expect(ast.Token(')')) + n.Whenclause = append(n.Whenclause, makeDefElem(name, nList(vals), etok.Start)) + if !p.have(ast.Token_AND) { + break + } + } + } + p.expect(ast.Token_EXECUTE) + p.parseFunctionOrProcedure() + n.Funcname = p.parseFuncName(p.peek()) + p.expect(ast.Token('(')) + p.expect(ast.Token(')')) + return &ast.Node{Node: &ast.Node_CreateEventTrigStmt{CreateEventTrigStmt: n}} +} diff --git a/internal/parse/func.go b/internal/parse/func.go index c538178..97cfd41 100644 --- a/internal/parse/func.go +++ b/internal/parse/func.go @@ -1025,14 +1025,18 @@ func (p *parser) parseFrameExtent() *ast.WindowDef { func (p *parser) parseFrameBound() *ast.WindowDef { switch p.kind() { case ast.Token_UNBOUNDED: - p.next() - switch { - case p.have(ast.Token_PRECEDING): + // UNBOUNDED commits only when PRECEDING/FOLLOWING follows directly; + // otherwise it's an ordinary identifier in the offset expression. + switch p.kindN(1) { + case ast.Token_PRECEDING: + p.next() + p.next() return &ast.WindowDef{FrameOptions: frameOptionStartUnboundedPreceding} - case p.have(ast.Token_FOLLOWING): + case ast.Token_FOLLOWING: + p.next() + p.next() return &ast.WindowDef{FrameOptions: frameOptionStartUnboundedFollowing} } - p.syntaxErrorAt() case ast.Token_CURRENT_P: if p.kindN(1) == ast.Token_ROW { p.next() diff --git a/internal/parse/gram_support.go b/internal/parse/gram_support.go index 1678a41..a453347 100644 --- a/internal/parse/gram_support.go +++ b/internal/parse/gram_support.go @@ -298,9 +298,13 @@ func makeSetOp(op ast.SetOperation, all bool, larg, rarg *ast.Node) *ast.Node { }) } -// gram.y: makeRangeVarFromAnyName +// gram.y: makeRangeVarFromAnyName — makeNode leaves inh false, unlike +// makeRangeVar. func (p *parser) makeRangeVarFromAnyName(names []*ast.Node, position int32) *ast.RangeVar { - r := makeRangeVar("", "", position) + r := &ast.RangeVar{ + Relpersistence: relPersistPermanent, + Location: position, + } switch len(names) { case 1: r.Relname = asString(names[0]).Sval diff --git a/internal/parse/names.go b/internal/parse/names.go index 2d24de9..83b4a6a 100644 --- a/internal/parse/names.go +++ b/internal/parse/names.go @@ -12,9 +12,25 @@ import ( // its canonical lower-case spelling, an IDENT's Str is the downcased, // truncated identifier — in both cases exactly the C production's $$. +// isLookaheadMergedToken reports whether tok is one of base_yylex's merged +// lookahead terminals. They inherit the keyword classification of their +// first word from the lexer, but the grammar treats them as distinct +// terminals that can never be identifiers. +func isLookaheadMergedToken(tok lexer.Token) bool { + switch tok.Kind { + case ast.Token_NOT_LA, ast.Token_NULLS_LA, ast.Token_WITH_LA, + ast.Token_WITHOUT_LA, ast.Token_FORMAT_LA: + return true + } + return false +} + // isColIdToken reports whether tok can begin ColId: // gram.y: ColId: IDENT | unreserved_keyword | col_name_keyword func isColIdToken(tok lexer.Token) bool { + if isLookaheadMergedToken(tok) { + return false + } switch tok.KeywordKind { case ast.KeywordKind_NO_KEYWORD: return tok.Kind == ast.Token_IDENT @@ -27,6 +43,9 @@ func isColIdToken(tok lexer.Token) bool { // isTypeFunctionNameToken: // gram.y: type_function_name: IDENT | unreserved_keyword | type_func_name_keyword func isTypeFunctionNameToken(tok lexer.Token) bool { + if isLookaheadMergedToken(tok) { + return false + } switch tok.KeywordKind { case ast.KeywordKind_NO_KEYWORD: return tok.Kind == ast.Token_IDENT @@ -40,6 +59,9 @@ func isTypeFunctionNameToken(tok lexer.Token) bool { // gram.y: NonReservedWord: IDENT | unreserved_keyword | col_name_keyword | // type_func_name_keyword func isNonReservedWordToken(tok lexer.Token) bool { + if isLookaheadMergedToken(tok) { + return false + } switch tok.KeywordKind { case ast.KeywordKind_NO_KEYWORD: return tok.Kind == ast.Token_IDENT @@ -54,6 +76,9 @@ func isNonReservedWordToken(tok lexer.Token) bool { // gram.y: ColLabel: IDENT | unreserved_keyword | col_name_keyword | // type_func_name_keyword | reserved_keyword func isColLabelToken(tok lexer.Token) bool { + if isLookaheadMergedToken(tok) { + return false + } if tok.KeywordKind != ast.KeywordKind_NO_KEYWORD { return true } @@ -63,6 +88,9 @@ func isColLabelToken(tok lexer.Token) bool { // isBareColLabelToken: // gram.y: BareColLabel: IDENT | bare_label_keyword func isBareColLabelToken(tok lexer.Token) bool { + if isLookaheadMergedToken(tok) { + return false + } if tok.Kind == ast.Token_IDENT && tok.KeywordKind == ast.KeywordKind_NO_KEYWORD { return true } diff --git a/internal/parse/parser.go b/internal/parse/parser.go index d4f21f3..9b97716 100644 --- a/internal/parse/parser.go +++ b/internal/parse/parser.go @@ -201,7 +201,30 @@ func (p *parser) parseToplevelStmt() *ast.Node { case ast.Token_COPY: return p.parseCopyStmt() case ast.Token_PREPARE: + // PREPARE TRANSACTION Sconst is a TransactionStmt; PREPARE name + // [(types)] AS is a PrepareStmt ("transaction" can also be a plan + // name, so the Sconst decides). + if p.kindN(1) == ast.Token_TRANSACTION && p.kindN(2) == ast.Token_SCONST { + p.next() + return p.parsePrepareTransactionStmt() + } return p.parsePrepareStmt() + case ast.Token_ABORT_P, ast.Token_START, ast.Token_COMMIT, + ast.Token_ROLLBACK, ast.Token_SAVEPOINT, ast.Token_RELEASE, + ast.Token_BEGIN_P, ast.Token_END_P: + return p.parseTransactionStmt() + case ast.Token_NOTIFY: + return p.parseNotifyStmt() + case ast.Token_LISTEN: + return p.parseListenStmt() + case ast.Token_UNLISTEN: + return p.parseUnlistenStmt() + case ast.Token_LOAD: + return p.parseLoadStmt() + case ast.Token_LOCK_P: + return p.parseLockStmt() + case ast.Token_TRUNCATE: + return p.parseTruncateStmt() case ast.Token_EXECUTE: return p.parseExecuteStmt() case ast.Token_DEALLOCATE: @@ -214,6 +237,69 @@ func (p *parser) parseToplevelStmt() *ast.Node { return p.parseFetchStmt(true) case ast.Token_CLOSE: return p.parseClosePortalStmt() + case ast.Token_CALL: + return p.parseCallStmt() + case ast.Token_CREATE: + return p.parseCreateDispatch() + case ast.Token_ALTER: + return p.parseAlterDispatch() + case ast.Token_DROP: + return p.parseDropDispatch() + case ast.Token_SET: + // SET CONSTRAINTS is ConstraintsSetStmt unless "constraints" is + // being used as a variable name (generic_set's var_name). + if p.kindN(1) == ast.Token_CONSTRAINTS && !p.varNameContinues(2) { + p.next() + return p.parseConstraintsSetStmt() + } + return p.parseVariableSetStmt() + case ast.Token_RESET: + return p.parseVariableResetStmt() + case ast.Token_SHOW: + return p.parseVariableShowStmt() + case ast.Token_CHECKPOINT: + return p.parseCheckPointStmt() + case ast.Token_DISCARD: + return p.parseDiscardStmt() + case ast.Token_REFRESH: + return p.parseRefreshMatViewStmt() + case ast.Token_COMMENT: + return p.parseCommentStmt() + case ast.Token_CLUSTER: + return p.parseClusterStmt() + case ast.Token_VACUUM: + return p.parseVacuumStmt() + case ast.Token_ANALYZE, ast.Token_ANALYSE: + return p.parseAnalyzeStmt() + case ast.Token_EXPLAIN: + return p.parseExplainStmt() + case ast.Token_REINDEX: + return p.parseReindexStmt() + case ast.Token_DO: + return p.parseDoStmt() + case ast.Token_GRANT: + return p.parseGrantStmt() + case ast.Token_REVOKE: + return p.parseRevokeStmt() + case ast.Token_IMPORT_P: + return p.parseImportForeignSchemaStmt() + case ast.Token_SECURITY: + if p.kindN(1) == ast.Token_LABEL { + p.next() + p.next() + return p.parseSecLabelStmt() + } + case ast.Token_REASSIGN: + // gram.y: ReassignOwnedStmt + p.next() + p.expect(ast.Token_OWNED) + p.expect(ast.Token_BY) + roles := p.parseRoleList() + p.expect(ast.Token_TO) + return &ast.Node{Node: &ast.Node_ReassignOwnedStmt{ReassignOwnedStmt: &ast.ReassignOwnedStmt{ + Roles: roles, + Newrole: p.parseRoleSpec(), + }}} } p.syntaxError(tok) return nil diff --git a/internal/parse/select.go b/internal/parse/select.go index 3243623..41e5fea 100644 --- a/internal/parse/select.go +++ b/internal/parse/select.go @@ -697,11 +697,9 @@ func (p *parser) parseFuncName(tok lexer.Token) []*ast.Node { // relation) starts here: a name possibly dotted, followed by '('. func (p *parser) startsFunctionCallAhead() bool { tok := p.peek() - if !isColIdToken(tok) && !isTypeFunctionNameToken(tok) { - return false - } // Keywords with special function syntax are func_tables too - // (func_expr_common_subexpr in func_expr_windowless). + // (func_expr_common_subexpr in func_expr_windowless); several are + // reserved, so this check must run before the identifier gate. switch tok.Kind { case ast.Token_CURRENT_DATE, ast.Token_CURRENT_TIME, ast.Token_CURRENT_TIMESTAMP, ast.Token_LOCALTIME, ast.Token_LOCALTIMESTAMP, ast.Token_CURRENT_ROLE, @@ -709,6 +707,12 @@ func (p *parser) startsFunctionCallAhead() bool { ast.Token_CURRENT_CATALOG, ast.Token_CURRENT_SCHEMA, ast.Token_CAST, ast.Token_SYSTEM_USER: return true + case ast.Token_COLLATION: + // COLLATION FOR '(' a_expr ')' + return p.kindN(1) == ast.Token_FOR + } + if !isColIdToken(tok) && !isTypeFunctionNameToken(tok) { + return false } // Scan past the (possibly dotted) name: name ('.' attr)* '('. i := 1 diff --git a/internal/parse/typename.go b/internal/parse/typename.go index be5b4fb..d60a943 100644 --- a/internal/parse/typename.go +++ b/internal/parse/typename.go @@ -120,9 +120,14 @@ func (p *parser) parseKeywordTypename(constForm bool) *ast.TypeName { t.Location = tok.Start return t case ast.Token_DOUBLE_P: - // DOUBLE_P PRECISION + // DOUBLE_P PRECISION; a bare "double" is a GenericType name (the + // keyword is unreserved and PRECISION is what commits the Numeric + // reading). + if p.kindN(1) != ast.Token_PRECISION { + return nil + } + p.next() p.next() - p.expect(ast.Token_PRECISION) t := SystemTypeName("float8") t.Location = tok.Start return t diff --git a/internal/parse/utility_maint.go b/internal/parse/utility_maint.go new file mode 100644 index 0000000..8d13953 --- /dev/null +++ b/internal/parse/utility_maint.go @@ -0,0 +1,322 @@ +package parse + +// Maintenance and inspection utilities: ClusterStmt, VacuumStmt, +// AnalyzeStmt, ExplainStmt, ReindexStmt, DoStmt, CreateCastStmt. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +// parseUtilityOptionList is gram.y's utility_option_list (the caller has +// consumed the opening paren). +func (p *parser) parseUtilityOptionList() []*ast.Node { + list := []*ast.Node{p.parseUtilityOptionElem()} + for p.have(ast.Token(',')) { + list = append(list, p.parseUtilityOptionElem()) + } + p.expect(ast.Token(')')) + return list +} + +// parseUtilityOptionElem is gram.y's utility_option_elem. +func (p *parser) parseUtilityOptionElem() *ast.Node { + tok := p.peek() + var name string + switch tok.Kind { + case ast.Token_ANALYZE, ast.Token_ANALYSE: + p.next() + name = "analyze" + case ast.Token_FORMAT_LA: + p.next() + name = "format" + default: + name = p.nonReservedWord() + } + // utility_option_arg + var arg *ast.Node + vtok := p.peek() + switch vtok.Kind { + case ast.Token(','), ast.Token(')'): + case ast.Token_ICONST, ast.Token_FCONST, ast.Token('+'), ast.Token('-'): + arg = p.parseNumericOnly() + default: + arg = nStr(p.parseOptBooleanOrString()) + } + return makeDefElem(name, arg, tok.Start) +} + +// parseClusterStmt is gram.y's ClusterStmt. +func (p *parser) parseClusterStmt() *ast.Node { + p.expect(ast.Token_CLUSTER) + n := &ast.ClusterStmt{} + if p.have(ast.Token('(')) { + n.Params = p.parseUtilityOptionList() + if isColIdToken(p.peek()) { + n.Relation = p.parseQualifiedName() + if p.have(ast.Token_USING) { + n.Indexname = p.name() + } + } + return &ast.Node{Node: &ast.Node_ClusterStmt{ClusterStmt: n}} + } + if vtok := p.peek(); vtok.Kind == ast.Token_VERBOSE { + p.next() + n.Params = []*ast.Node{makeDefElem("verbose", nil, vtok.Start)} + } + if isColIdToken(p.peek()) { + rel := p.parseQualifiedName() + switch { + case p.have(ast.Token_ON): + // pre-8.3: CLUSTER indexname ON relation + n.Indexname = rel.Relname + n.Relation = p.parseQualifiedName() + case p.have(ast.Token_USING): + n.Relation = rel + n.Indexname = p.name() + default: + n.Relation = rel + } + } + return &ast.Node{Node: &ast.Node_ClusterStmt{ClusterStmt: n}} +} + +// parseVacuumRelationList is gram.y's opt_vacuum_relation_list. +func (p *parser) parseOptVacuumRelationList() []*ast.Node { + if !isColIdToken(p.peek()) { + return nil + } + var list []*ast.Node + for { + v := &ast.VacuumRelation{Relation: p.parseQualifiedName()} + if p.have(ast.Token('(')) { + v.VaCols = p.nameList() + p.expect(ast.Token(')')) + } + list = append(list, &ast.Node{Node: &ast.Node_VacuumRelation{VacuumRelation: v}}) + if !p.have(ast.Token(',')) { + return list + } + } +} + +// parseVacuumStmt is gram.y's VacuumStmt. +func (p *parser) parseVacuumStmt() *ast.Node { + p.expect(ast.Token_VACUUM) + n := &ast.VacuumStmt{IsVacuumcmd: true} + if p.have(ast.Token('(')) { + n.Options = p.parseUtilityOptionList() + } else { + if tok := p.peek(); tok.Kind == ast.Token_FULL { + p.next() + n.Options = append(n.Options, makeDefElem("full", nil, tok.Start)) + } + if tok := p.peek(); tok.Kind == ast.Token_FREEZE { + p.next() + n.Options = append(n.Options, makeDefElem("freeze", nil, tok.Start)) + } + if tok := p.peek(); tok.Kind == ast.Token_VERBOSE { + p.next() + n.Options = append(n.Options, makeDefElem("verbose", nil, tok.Start)) + } + if tok := p.peek(); tok.Kind == ast.Token_ANALYZE || tok.Kind == ast.Token_ANALYSE { + p.next() + n.Options = append(n.Options, makeDefElem("analyze", nil, tok.Start)) + } + } + n.Rels = p.parseOptVacuumRelationList() + return &ast.Node{Node: &ast.Node_VacuumStmt{VacuumStmt: n}} +} + +// parseAnalyzeStmt is gram.y's AnalyzeStmt. +func (p *parser) parseAnalyzeStmt() *ast.Node { + p.next() // ANALYZE or ANALYSE + n := &ast.VacuumStmt{} + if p.have(ast.Token('(')) { + n.Options = p.parseUtilityOptionList() + } else if tok := p.peek(); tok.Kind == ast.Token_VERBOSE { + p.next() + n.Options = []*ast.Node{makeDefElem("verbose", nil, tok.Start)} + } + n.Rels = p.parseOptVacuumRelationList() + return &ast.Node{Node: &ast.Node_VacuumStmt{VacuumStmt: n}} +} + +// parseExplainStmt is gram.y's ExplainStmt. +func (p *parser) parseExplainStmt() *ast.Node { + p.expect(ast.Token_EXPLAIN) + n := &ast.ExplainStmt{} + switch tok := p.peek(); tok.Kind { + case ast.Token_ANALYZE, ast.Token_ANALYSE: + p.next() + n.Options = []*ast.Node{makeDefElem("analyze", nil, tok.Start)} + if vtok := p.peek(); vtok.Kind == ast.Token_VERBOSE { + p.next() + n.Options = append(n.Options, makeDefElem("verbose", nil, vtok.Start)) + } + case ast.Token_VERBOSE: + p.next() + n.Options = []*ast.Node{makeDefElem("verbose", nil, tok.Start)} + case ast.Token('('): + // EXPLAIN '(' could also start a parenthesized SelectStmt. + if !p.looksLikeSelectAhead() { + p.next() + n.Options = p.parseUtilityOptionList() + } + } + n.Query = p.parseExplainableStmt() + return &ast.Node{Node: &ast.Node_ExplainStmt{ExplainStmt: n}} +} + +// parseExplainableStmt is gram.y's ExplainableStmt. +func (p *parser) parseExplainableStmt() *ast.Node { + switch p.kind() { + case ast.Token_SELECT, ast.Token_TABLE, ast.Token_VALUES, ast.Token('('): + return p.parseSelectStmt() + case ast.Token_WITH, ast.Token_WITH_LA: + return p.parseWithPrefixedStmt() + case ast.Token_INSERT: + return p.parseInsertStmt(nil) + case ast.Token_UPDATE: + return p.parseUpdateStmt(nil) + case ast.Token_DELETE_P: + return p.parseDeleteStmt(nil) + case ast.Token_MERGE: + return p.parseMergeStmt(nil) + case ast.Token_DECLARE: + return p.parseDeclareCursorStmt() + case ast.Token_EXECUTE: + return p.parseExecuteStmt() + case ast.Token_REFRESH: + return p.parseRefreshMatViewStmt() + case ast.Token_CREATE: + // Only CreateAsStmt / CreateMatViewStmt (and the AS EXECUTE form) + // are explainable. + p.next() + persistence := p.parseOptTempAfterCreate() + if p.kind() == ast.Token_MATERIALIZED && persistence != relPersistTemp { + return p.parseCreateMatViewStmt(persistence) + } + p.expect(ast.Token_TABLE) + ifNotExists := false + if p.have(ast.Token_IF_P) { + p.expect(ast.Token_NOT) + p.expect(ast.Token_EXISTS) + ifNotExists = true + } + rel := p.parseQualifiedName() + rel.Relpersistence = persistence + into := p.parseCreateAsTarget(rel) + p.expect(ast.Token_AS) + return p.finishCreateTableAs(into, ifNotExists) + } + p.syntaxErrorAt() + return nil +} + +// parseReindexStmt is gram.y's ReindexStmt. +func (p *parser) parseReindexStmt() *ast.Node { + p.expect(ast.Token_REINDEX) + n := &ast.ReindexStmt{} + if p.have(ast.Token('(')) { + n.Params = p.parseUtilityOptionList() + } + switch p.kind() { + case ast.Token_INDEX, ast.Token_TABLE: + if p.next().Kind == ast.Token_INDEX { + n.Kind = ast.ReindexObjectType_REINDEX_OBJECT_INDEX + } else { + n.Kind = ast.ReindexObjectType_REINDEX_OBJECT_TABLE + } + if tok := p.peek(); tok.Kind == ast.Token_CONCURRENTLY { + p.next() + n.Params = append(n.Params, makeDefElem("concurrently", nil, tok.Start)) + } + n.Relation = p.parseQualifiedName() + case ast.Token_SCHEMA: + p.next() + n.Kind = ast.ReindexObjectType_REINDEX_OBJECT_SCHEMA + if tok := p.peek(); tok.Kind == ast.Token_CONCURRENTLY { + p.next() + n.Params = append(n.Params, makeDefElem("concurrently", nil, tok.Start)) + } + n.Name = p.name() + case ast.Token_SYSTEM_P, ast.Token_DATABASE: + if p.next().Kind == ast.Token_SYSTEM_P { + n.Kind = ast.ReindexObjectType_REINDEX_OBJECT_SYSTEM + } else { + n.Kind = ast.ReindexObjectType_REINDEX_OBJECT_DATABASE + } + if tok := p.peek(); tok.Kind == ast.Token_CONCURRENTLY { + p.next() + n.Params = append(n.Params, makeDefElem("concurrently", nil, tok.Start)) + } + if isColIdToken(p.peek()) { + n.Name = p.name() + } + default: + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_ReindexStmt{ReindexStmt: n}} +} + +// parseDoStmt is gram.y's DoStmt: DO dostmt_opt_list. +func (p *parser) parseDoStmt() *ast.Node { + p.expect(ast.Token_DO) + n := &ast.DoStmt{} + for { + tok := p.peek() + switch tok.Kind { + case ast.Token_SCONST: + p.next() + n.Args = append(n.Args, makeDefElem("as", nStr(tok.Str), tok.Start)) + continue + case ast.Token_LANGUAGE: + p.next() + n.Args = append(n.Args, makeDefElem("language", nStr(p.nonReservedWordOrSconst()), tok.Start)) + continue + } + if n.Args == nil { + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_DoStmt{DoStmt: n}} + } +} + +// parseCreateCastStmt is gram.y's CreateCastStmt; CREATE CAST consumed by +// the dispatcher. +func (p *parser) parseCreateCastStmt() *ast.Node { + n := &ast.CreateCastStmt{} + p.expect(ast.Token('(')) + n.Sourcetype = p.parseTypename() + p.expect(ast.Token_AS) + n.Targettype = p.parseTypename() + p.expect(ast.Token(')')) + switch { + case p.have(ast.Token_WITHOUT): + p.expect(ast.Token_FUNCTION) + case p.have(ast.Token_WITH), p.have(ast.Token_WITH_LA): + switch { + case p.have(ast.Token_FUNCTION): + n.Func = p.parseFunctionWithArgtypes().GetObjectWithArgs() + case p.have(ast.Token_INOUT): + n.Inout = true + default: + p.syntaxErrorAt() + } + default: + p.syntaxErrorAt() + } + // cast_context + n.Context = ast.CoercionContext_COERCION_EXPLICIT + if p.have(ast.Token_AS) { + switch { + case p.have(ast.Token_IMPLICIT_P): + n.Context = ast.CoercionContext_COERCION_IMPLICIT + case p.have(ast.Token_ASSIGNMENT): + n.Context = ast.CoercionContext_COERCION_ASSIGNMENT + default: + p.syntaxErrorAt() + } + } + return &ast.Node{Node: &ast.Node_CreateCastStmt{CreateCastStmt: n}} +} diff --git a/internal/parse/utility_set.go b/internal/parse/utility_set.go new file mode 100644 index 0000000..1ecd2b6 --- /dev/null +++ b/internal/parse/utility_set.go @@ -0,0 +1,637 @@ +package parse + +// SET/RESET/SHOW and the small standalone utility statements: +// VariableSetStmt, VariableResetStmt, VariableShowStmt, ConstraintsSetStmt, +// CheckPointStmt, DiscardStmt, plus the transaction_mode machinery shared +// with TransactionStmt. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +// parseVariableSetStmt is gram.y's VariableSetStmt: +// +// SET set_rest | SET LOCAL set_rest | SET SESSION set_rest +func (p *parser) parseVariableSetStmt() *ast.Node { + p.expect(ast.Token_SET) + var n *ast.VariableSetStmt + switch p.kind() { + case ast.Token_LOCAL: + // LOCAL is also a ColId: "SET local = ..." names a variable + // "local". The LALR tables shift LOCAL and decide by the next + // token: TO/'='/'.' continue var_name, anything else means the + // SET LOCAL prefix. + if p.varNameContinues(1) { + n = p.parseSetRest() + } else { + p.next() + n = p.parseSetRest() + n.IsLocal = true + } + case ast.Token_SESSION: + // Same shape: SESSION AUTHORIZATION/CHARACTERISTICS belong to + // set_rest; "SET session = x" names a variable; otherwise SESSION + // is the scope prefix. + switch { + case p.varNameContinues(1), + p.kindN(1) == ast.Token_CHARACTERISTICS, + p.kindN(1) == ast.Token_AUTHORIZATION: + n = p.parseSetRest() + default: + p.next() + n = p.parseSetRest() + } + default: + n = p.parseSetRest() + } + return &ast.Node{Node: &ast.Node_VariableSetStmt{VariableSetStmt: n}} +} + +// varNameContinues reports whether the token after position n keeps the +// current keyword inside a var_name (generic_set's var_name TO/'='/FROM +// CURRENT paths, or a qualified name continuing with '.'). +func (p *parser) varNameContinues(n int) bool { + switch p.kindN(n) { + case ast.Token_TO, ast.Token('='), ast.Token('.'): + return true + case ast.Token_FROM: + // var_name FROM CURRENT_P + return p.kindN(n+1) == ast.Token_CURRENT_P + } + return false +} + +// parseSetRest is gram.y's set_rest. +func (p *parser) parseSetRest() *ast.VariableSetStmt { + tok := p.peek() + switch tok.Kind { + case ast.Token_TRANSACTION: + if !p.varNameContinues(1) { + p.next() + if p.have(ast.Token_SNAPSHOT) { + // set_rest_more: TRANSACTION SNAPSHOT Sconst + stok := p.peek() + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_MULTI, + Name: "TRANSACTION SNAPSHOT", + Args: []*ast.Node{makeStringConst(p.sconst(), stok.Start)}, + } + } + // set_rest: TRANSACTION transaction_mode_list + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_MULTI, + Name: "TRANSACTION", + Args: p.parseTransactionModeList(), + } + } + case ast.Token_SESSION: + if p.kindN(1) == ast.Token_CHARACTERISTICS { + // set_rest: SESSION CHARACTERISTICS AS TRANSACTION + // transaction_mode_list + p.next() + p.next() + p.expect(ast.Token_AS) + p.expect(ast.Token_TRANSACTION) + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_MULTI, + Name: "SESSION CHARACTERISTICS", + Args: p.parseTransactionModeList(), + } + } + } + return p.parseSetRestMore() +} + +// parseSetRestMore is gram.y's set_rest_more. The keyword-headed special +// syntaxes each also admit the keyword as a plain var_name; the lookahead +// checks reproduce how the LALR tables decide between them. +func (p *parser) parseSetRestMore() *ast.VariableSetStmt { + tok := p.peek() + switch tok.Kind { + case ast.Token_TIME: + // TIME ZONE zone_value + if p.kindN(1) == ast.Token_ZONE { + p.next() + p.next() + n := &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_VALUE, + Name: "timezone", + } + if zv := p.parseZoneValue(); zv != nil { + n.Args = []*ast.Node{zv} + } else { + n.Kind = ast.VariableSetKind_VAR_SET_DEFAULT + } + return n + } + case ast.Token_CATALOG_P: + if p.kindN(1) == ast.Token_SCONST { + p.next() + stok := p.peek() + p.ereport("base_yyparse", "current database cannot be changed", stok.Start) + } + case ast.Token_SCHEMA: + switch p.kindN(1) { + case ast.Token_SCONST: + p.next() + stok := p.peek() + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_VALUE, + Name: "search_path", + Args: []*ast.Node{makeStringConst(p.sconst(), stok.Start)}, + } + case ast.Token_PARAM: + p.next() + prm := p.next() + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_VALUE, + Name: "search_path", + Args: []*ast.Node{makeParamRef(prm.Ival, prm.Start)}, + } + } + case ast.Token_NAMES: + if !p.varNameContinues(1) { + // NAMES opt_encoding + p.next() + n := &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_VALUE, + Name: "client_encoding", + } + etok := p.peek() + switch etok.Kind { + case ast.Token_SCONST: + n.Args = []*ast.Node{makeStringConst(p.sconst(), etok.Start)} + case ast.Token_DEFAULT: + p.next() + n.Kind = ast.VariableSetKind_VAR_SET_DEFAULT + default: + n.Kind = ast.VariableSetKind_VAR_SET_DEFAULT + } + return n + } + case ast.Token_ROLE: + if !p.varNameContinues(1) { + p.next() + vtok := p.peek() + if vtok.Kind == ast.Token_PARAM { + p.next() + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_VALUE, + Name: "role", + Args: []*ast.Node{makeParamRef(vtok.Ival, vtok.Start)}, + } + } + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_VALUE, + Name: "role", + Args: []*ast.Node{makeStringConst(p.nonReservedWordOrSconst(), vtok.Start)}, + } + } + case ast.Token_SESSION: + if p.kindN(1) == ast.Token_AUTHORIZATION { + p.next() + p.next() + vtok := p.peek() + switch vtok.Kind { + case ast.Token_DEFAULT: + p.next() + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_DEFAULT, + Name: "session_authorization", + } + case ast.Token_PARAM: + p.next() + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_VALUE, + Name: "session_authorization", + Args: []*ast.Node{makeParamRef(vtok.Ival, vtok.Start)}, + } + } + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_VALUE, + Name: "session_authorization", + Args: []*ast.Node{makeStringConst(p.nonReservedWordOrSconst(), vtok.Start)}, + } + } + case ast.Token_XML_P: + if p.kindN(1) == ast.Token_OPTION { + p.next() + p.next() + vtok := p.peek() + opt := p.parseDocumentOrContent() + s := "CONTENT" + if opt == ast.XmlOptionType_XMLOPTION_DOCUMENT { + s = "DOCUMENT" + } + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_VALUE, + Name: "xmloption", + Args: []*ast.Node{makeStringConst(s, vtok.Start)}, + } + } + } + + // generic_set / var_name FROM CURRENT_P + name := p.parseVarName() + switch { + case p.have(ast.Token_TO), p.have(ast.Token('=')): + if p.kind() == ast.Token_DEFAULT { + p.next() + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_DEFAULT, + Name: name, + } + } + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_VALUE, + Name: name, + Args: p.parseVarList(), + } + case p.kind() == ast.Token_FROM: + p.next() + p.expect(ast.Token_CURRENT_P) + return &ast.VariableSetStmt{ + Kind: ast.VariableSetKind_VAR_SET_CURRENT, + Name: name, + } + } + p.syntaxErrorAt() + return nil +} + +// parseVarName is gram.y's var_name: ColId ('.' ColId)*. +func (p *parser) parseVarName() string { + name := p.colId() + for p.have(ast.Token('.')) { + name += "." + p.colId() + } + return name +} + +// parseVarList is gram.y's var_list. +func (p *parser) parseVarList() []*ast.Node { + list := []*ast.Node{p.parseVarValue()} + for p.have(ast.Token(',')) { + list = append(list, p.parseVarValue()) + } + return list +} + +// parseVarValue is gram.y's var_value. +func (p *parser) parseVarValue() *ast.Node { + tok := p.peek() + switch tok.Kind { + case ast.Token_PARAM: + p.next() + return makeParamRef(tok.Ival, tok.Start) + case ast.Token_FCONST, ast.Token_ICONST, ast.Token('+'), ast.Token('-'): + return makeAConst(p.parseNumericOnly(), tok.Start) + } + return makeStringConst(p.parseOptBooleanOrString(), tok.Start) +} + +// parseZoneValue is gram.y's zone_value; nil means DEFAULT/LOCAL. +func (p *parser) parseZoneValue() *ast.Node { + tok := p.peek() + switch tok.Kind { + case ast.Token_SCONST: + p.next() + return makeStringConst(tok.Str, tok.Start) + case ast.Token_PARAM: + p.next() + return makeParamRef(tok.Ival, tok.Start) + case ast.Token_IDENT: + p.next() + return makeStringConst(tok.Str, tok.Start) + case ast.Token_INTERVAL: + p.next() + if p.have(ast.Token('(')) { + // ConstInterval '(' Iconst ')' Sconst + itok := p.peek() + iv := p.iconst() + p.expect(ast.Token(')')) + t := SystemTypeName("interval") + t.Location = tok.Start + t.Typmods = []*ast.Node{ + makeIntConst(intervalFullRange, -1), + makeIntConst(iv, itok.Start), + } + stok := p.peek() + return makeStringConstCast(p.sconst(), stok.Start, t) + } + // ConstInterval Sconst opt_interval + stok := p.peek() + s := p.sconst() + mtok := p.peek() + typmods := p.parseOptInterval() + if typmods != nil { + c := asAConst(typmods[0]) + if ival := c.GetIval().GetIval(); ival&^(intervalMaskHour|intervalMaskMinute) != 0 { + p.ereport("base_yyparse", "time zone interval must be HOUR or HOUR TO MINUTE", mtok.Start) + } + } + t := SystemTypeName("interval") + t.Location = tok.Start + t.Typmods = typmods + return makeStringConstCast(s, stok.Start, t) + case ast.Token_FCONST, ast.Token_ICONST, ast.Token('+'), ast.Token('-'): + return makeAConst(p.parseNumericOnly(), tok.Start) + case ast.Token_DEFAULT, ast.Token_LOCAL: + p.next() + return nil + } + p.syntaxErrorAt() + return nil +} + +// nonReservedWordOrSconst is gram.y's NonReservedWord_or_Sconst. +func (p *parser) nonReservedWordOrSconst() string { + if p.kind() == ast.Token_SCONST { + return p.sconst() + } + return p.nonReservedWord() +} + +// parseIsoLevel is gram.y's iso_level. +func (p *parser) parseIsoLevel() string { + switch p.kind() { + case ast.Token_READ: + p.next() + switch p.kind() { + case ast.Token_UNCOMMITTED: + p.next() + return "read uncommitted" + case ast.Token_COMMITTED: + p.next() + return "read committed" + } + p.syntaxErrorAt() + case ast.Token_REPEATABLE: + p.next() + p.expect(ast.Token_READ) + return "repeatable read" + case ast.Token_SERIALIZABLE: + p.next() + return "serializable" + } + p.syntaxErrorAt() + return "" +} + +// transactionModeItemStarts reports whether the lookahead begins a +// transaction_mode_item. +func (p *parser) transactionModeItemStarts() bool { + switch p.kind() { + case ast.Token_ISOLATION, ast.Token_DEFERRABLE: + return true + case ast.Token_READ: + k := p.kindN(1) + return k == ast.Token_ONLY || k == ast.Token_WRITE + case ast.Token_NOT: + return p.kindN(1) == ast.Token_DEFERRABLE + } + return false +} + +// parseTransactionModeItem is gram.y's transaction_mode_item. +func (p *parser) parseTransactionModeItem() *ast.Node { + tok := p.peek() + switch tok.Kind { + case ast.Token_ISOLATION: + p.next() + p.expect(ast.Token_LEVEL) + ltok := p.peek() + return makeDefElem("transaction_isolation", makeStringConst(p.parseIsoLevel(), ltok.Start), tok.Start) + case ast.Token_READ: + p.next() + switch p.kind() { + case ast.Token_ONLY: + p.next() + return makeDefElem("transaction_read_only", makeIntConst(1, tok.Start), tok.Start) + case ast.Token_WRITE: + p.next() + return makeDefElem("transaction_read_only", makeIntConst(0, tok.Start), tok.Start) + } + p.syntaxErrorAt() + case ast.Token_DEFERRABLE: + p.next() + return makeDefElem("transaction_deferrable", makeIntConst(1, tok.Start), tok.Start) + case ast.Token_NOT: + p.next() + p.expect(ast.Token_DEFERRABLE) + return makeDefElem("transaction_deferrable", makeIntConst(0, tok.Start), tok.Start) + } + p.syntaxErrorAt() + return nil +} + +// parseTransactionModeList is gram.y's transaction_mode_list: items joined +// by commas or plain juxtaposition. +func (p *parser) parseTransactionModeList() []*ast.Node { + list := []*ast.Node{p.parseTransactionModeItem()} + for { + if p.kind() == ast.Token(',') && p.transactionModeItemStartsAt(1) { + p.next() + list = append(list, p.parseTransactionModeItem()) + continue + } + if p.transactionModeItemStarts() { + list = append(list, p.parseTransactionModeItem()) + continue + } + return list + } +} + +// transactionModeItemStartsAt is transactionModeItemStarts at offset n. +func (p *parser) transactionModeItemStartsAt(n int) bool { + switch p.kindN(n) { + case ast.Token_ISOLATION, ast.Token_DEFERRABLE: + return true + case ast.Token_READ: + k := p.kindN(n + 1) + return k == ast.Token_ONLY || k == ast.Token_WRITE + case ast.Token_NOT: + return p.kindN(n+1) == ast.Token_DEFERRABLE + } + return false +} + +// parseVariableResetStmt is gram.y's VariableResetStmt: RESET reset_rest. +func (p *parser) parseVariableResetStmt() *ast.Node { + p.expect(ast.Token_RESET) + return &ast.Node{Node: &ast.Node_VariableSetStmt{VariableSetStmt: p.parseResetRest()}} +} + +// parseResetRest is gram.y's reset_rest. +func (p *parser) parseResetRest() *ast.VariableSetStmt { + switch p.kind() { + case ast.Token_TIME: + if p.kindN(1) == ast.Token_ZONE { + p.next() + p.next() + return &ast.VariableSetStmt{Kind: ast.VariableSetKind_VAR_RESET, Name: "timezone"} + } + case ast.Token_TRANSACTION: + if p.kindN(1) == ast.Token_ISOLATION { + p.next() + p.next() + p.expect(ast.Token_LEVEL) + return &ast.VariableSetStmt{Kind: ast.VariableSetKind_VAR_RESET, Name: "transaction_isolation"} + } + case ast.Token_SESSION: + if p.kindN(1) == ast.Token_AUTHORIZATION { + p.next() + p.next() + return &ast.VariableSetStmt{Kind: ast.VariableSetKind_VAR_RESET, Name: "session_authorization"} + } + case ast.Token_ALL: + p.next() + return &ast.VariableSetStmt{Kind: ast.VariableSetKind_VAR_RESET_ALL} + } + // generic_reset: var_name + return &ast.VariableSetStmt{Kind: ast.VariableSetKind_VAR_RESET, Name: p.parseVarName()} +} + +// parseSetResetClause is gram.y's SetResetClause (SET or RESET without +// LOCAL, used by ALTER ... SET). +func (p *parser) parseSetResetClause() *ast.VariableSetStmt { + if p.have(ast.Token_SET) { + return p.parseSetRest() + } + if p.kind() == ast.Token_RESET { + p.next() + return p.parseResetRest() + } + p.syntaxErrorAt() + return nil +} + +// parseFunctionSetResetClause is gram.y's FunctionSetResetClause. +func (p *parser) parseFunctionSetResetClause() *ast.VariableSetStmt { + if p.have(ast.Token_SET) { + return p.parseSetRestMore() + } + if p.kind() == ast.Token_RESET { + p.next() + return p.parseResetRest() + } + p.syntaxErrorAt() + return nil +} + +// parseVariableShowStmt is gram.y's VariableShowStmt. +func (p *parser) parseVariableShowStmt() *ast.Node { + p.expect(ast.Token_SHOW) + n := &ast.VariableShowStmt{} + switch p.kind() { + case ast.Token_TIME: + if p.kindN(1) == ast.Token_ZONE { + p.next() + p.next() + n.Name = "timezone" + return nVariableShowStmt(n) + } + case ast.Token_TRANSACTION: + if p.kindN(1) == ast.Token_ISOLATION { + p.next() + p.next() + p.expect(ast.Token_LEVEL) + n.Name = "transaction_isolation" + return nVariableShowStmt(n) + } + case ast.Token_SESSION: + if p.kindN(1) == ast.Token_AUTHORIZATION { + p.next() + p.next() + n.Name = "session_authorization" + return nVariableShowStmt(n) + } + case ast.Token_ALL: + p.next() + n.Name = "all" + return nVariableShowStmt(n) + } + n.Name = p.parseVarName() + return nVariableShowStmt(n) +} + +// parseConstraintsSetStmt is gram.y's ConstraintsSetStmt: +// +// SET CONSTRAINTS constraints_set_list constraints_set_mode +// +// The caller has already consumed SET. +func (p *parser) parseConstraintsSetStmt() *ast.Node { + p.expect(ast.Token_CONSTRAINTS) + n := &ast.ConstraintsSetStmt{} + // constraints_set_list: ALL | qualified_name_list + if !p.have(ast.Token_ALL) { + n.Constraints = p.parseQualifiedNameList() + } + // constraints_set_mode: DEFERRED | IMMEDIATE + switch p.kind() { + case ast.Token_DEFERRED: + p.next() + n.Deferred = true + case ast.Token_IMMEDIATE: + p.next() + default: + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_ConstraintsSetStmt{ConstraintsSetStmt: n}} +} + +// parseCheckPointStmt is gram.y's CheckPointStmt. +func (p *parser) parseCheckPointStmt() *ast.Node { + p.expect(ast.Token_CHECKPOINT) + return &ast.Node{Node: &ast.Node_CheckPointStmt{CheckPointStmt: &ast.CheckPointStmt{}}} +} + +// parseDiscardStmt is gram.y's DiscardStmt. +func (p *parser) parseDiscardStmt() *ast.Node { + p.expect(ast.Token_DISCARD) + n := &ast.DiscardStmt{} + switch p.kind() { + case ast.Token_ALL: + p.next() + n.Target = ast.DiscardMode_DISCARD_ALL + case ast.Token_TEMP, ast.Token_TEMPORARY: + p.next() + n.Target = ast.DiscardMode_DISCARD_TEMP + case ast.Token_PLANS: + p.next() + n.Target = ast.DiscardMode_DISCARD_PLANS + case ast.Token_SEQUENCES: + p.next() + n.Target = ast.DiscardMode_DISCARD_SEQUENCES + default: + p.syntaxErrorAt() + } + return &ast.Node{Node: &ast.Node_DiscardStmt{DiscardStmt: n}} +} + +// makeAConst is gram.y's makeAConst: wrap a NumericOnly value node in an +// A_Const at the given location. +func makeAConst(v *ast.Node, location int32) *ast.Node { + c := &ast.A_Const{Location: location} + switch w := v.Node.(type) { + case *ast.Node_Integer: + c.Val = &ast.A_Const_Ival{Ival: w.Integer} + case *ast.Node_Float: + c.Val = &ast.A_Const_Fval{Fval: w.Float} + } + return nAConst(c) +} + +// parseQualifiedNameList is gram.y's qualified_name_list. +func (p *parser) parseQualifiedNameList() []*ast.Node { + list := []*ast.Node{nRangeVar(p.parseQualifiedName())} + for p.have(ast.Token(',')) { + list = append(list, nRangeVar(p.parseQualifiedName())) + } + return list +} + +func nVariableShowStmt(n *ast.VariableShowStmt) *ast.Node { + return &ast.Node{Node: &ast.Node_VariableShowStmt{VariableShowStmt: n}} +} diff --git a/internal/parse/utility_txn.go b/internal/parse/utility_txn.go new file mode 100644 index 0000000..6ab5a46 --- /dev/null +++ b/internal/parse/utility_txn.go @@ -0,0 +1,261 @@ +package parse + +// TransactionStmt (+ the legacy BEGIN/END forms), NOTIFY/LISTEN/UNLISTEN, +// LOAD, LOCK, and TRUNCATE. + +import ( + "github.com/sqlc-dev/oliphant/ast" +) + +// parseOptTransaction is gram.y's opt_transaction: WORK | TRANSACTION | ε. +func (p *parser) parseOptTransaction() { + if p.kind() == ast.Token_WORK || p.kind() == ast.Token_TRANSACTION { + p.next() + } +} + +// parseOptTransactionChain is gram.y's opt_transaction_chain. +func (p *parser) parseOptTransactionChain() bool { + if p.have(ast.Token_AND) { + if p.have(ast.Token_NO) { + p.expect(ast.Token_CHAIN) + return false + } + p.expect(ast.Token_CHAIN) + return true + } + return false +} + +func nTransactionStmt(n *ast.TransactionStmt) *ast.Node { + return &ast.Node{Node: &ast.Node_TransactionStmt{TransactionStmt: n}} +} + +// parseTransactionStmt is gram.y's TransactionStmt and +// TransactionStmtLegacy, dispatched on the leading keyword. +func (p *parser) parseTransactionStmt() *ast.Node { + tok := p.next() + n := &ast.TransactionStmt{Location: -1} + switch tok.Kind { + case ast.Token_ABORT_P: + n.Kind = ast.TransactionStmtKind_TRANS_STMT_ROLLBACK + p.parseOptTransaction() + n.Chain = p.parseOptTransactionChain() + case ast.Token_START: + n.Kind = ast.TransactionStmtKind_TRANS_STMT_START + p.expect(ast.Token_TRANSACTION) + if p.transactionModeItemStarts() { + n.Options = p.parseTransactionModeList() + } + case ast.Token_COMMIT: + n.Kind = ast.TransactionStmtKind_TRANS_STMT_COMMIT + if p.kind() == ast.Token_PREPARED { + p.next() + n.Kind = ast.TransactionStmtKind_TRANS_STMT_COMMIT_PREPARED + stok := p.peek() + n.Gid = p.sconst() + n.Location = stok.Start + break + } + p.parseOptTransaction() + n.Chain = p.parseOptTransactionChain() + case ast.Token_ROLLBACK: + if p.kind() == ast.Token_PREPARED { + p.next() + n.Kind = ast.TransactionStmtKind_TRANS_STMT_ROLLBACK_PREPARED + stok := p.peek() + n.Gid = p.sconst() + n.Location = stok.Start + break + } + p.parseOptTransaction() + if p.have(ast.Token_TO) { + n.Kind = ast.TransactionStmtKind_TRANS_STMT_ROLLBACK_TO + p.have(ast.Token_SAVEPOINT) + stok := p.peek() + n.SavepointName = p.colId() + n.Location = stok.Start + break + } + n.Kind = ast.TransactionStmtKind_TRANS_STMT_ROLLBACK + n.Chain = p.parseOptTransactionChain() + case ast.Token_SAVEPOINT: + n.Kind = ast.TransactionStmtKind_TRANS_STMT_SAVEPOINT + stok := p.peek() + n.SavepointName = p.colId() + n.Location = stok.Start + case ast.Token_RELEASE: + n.Kind = ast.TransactionStmtKind_TRANS_STMT_RELEASE + p.have(ast.Token_SAVEPOINT) + stok := p.peek() + n.SavepointName = p.colId() + n.Location = stok.Start + case ast.Token_BEGIN_P: + n.Kind = ast.TransactionStmtKind_TRANS_STMT_BEGIN + p.parseOptTransaction() + if p.transactionModeItemStarts() { + n.Options = p.parseTransactionModeList() + } + case ast.Token_END_P: + n.Kind = ast.TransactionStmtKind_TRANS_STMT_COMMIT + p.parseOptTransaction() + n.Chain = p.parseOptTransactionChain() + } + return nTransactionStmt(n) +} + +// parsePrepareTransactionStmt is TransactionStmt's PREPARE TRANSACTION +// Sconst; PREPARE is consumed by the dispatcher. +func (p *parser) parsePrepareTransactionStmt() *ast.Node { + p.expect(ast.Token_TRANSACTION) + stok := p.peek() + return nTransactionStmt(&ast.TransactionStmt{ + Kind: ast.TransactionStmtKind_TRANS_STMT_PREPARE, + Gid: p.sconst(), + Location: stok.Start, + }) +} + +// parseNotifyStmt is gram.y's NotifyStmt. +func (p *parser) parseNotifyStmt() *ast.Node { + p.expect(ast.Token_NOTIFY) + n := &ast.NotifyStmt{Conditionname: p.colId()} + if p.have(ast.Token(',')) { + n.Payload = p.sconst() + } + return &ast.Node{Node: &ast.Node_NotifyStmt{NotifyStmt: n}} +} + +// parseListenStmt is gram.y's ListenStmt. +func (p *parser) parseListenStmt() *ast.Node { + p.expect(ast.Token_LISTEN) + return &ast.Node{Node: &ast.Node_ListenStmt{ListenStmt: &ast.ListenStmt{ + Conditionname: p.colId(), + }}} +} + +// parseUnlistenStmt is gram.y's UnlistenStmt. +func (p *parser) parseUnlistenStmt() *ast.Node { + p.expect(ast.Token_UNLISTEN) + n := &ast.UnlistenStmt{} + if p.have(ast.Token('*')) { + // conditionname stays empty + } else { + n.Conditionname = p.colId() + } + return &ast.Node{Node: &ast.Node_UnlistenStmt{UnlistenStmt: n}} +} + +// parseLoadStmt is gram.y's LoadStmt: LOAD file_name. +func (p *parser) parseLoadStmt() *ast.Node { + p.expect(ast.Token_LOAD) + return &ast.Node{Node: &ast.Node_LoadStmt{LoadStmt: &ast.LoadStmt{ + Filename: p.sconst(), + }}} +} + +// Lock mode numbers from lockdefs.h. +const ( + accessShareLock = 1 + rowShareLock = 2 + rowExclusiveLock = 3 + shareUpdateExclusiveLock = 4 + shareLock = 5 + shareRowExclusiveLock = 6 + exclusiveLock = 7 + accessExclusiveLock = 8 +) + +// parseLockStmt is gram.y's LockStmt: +// +// LOCK_P opt_table relation_expr_list opt_lock opt_nowait +func (p *parser) parseLockStmt() *ast.Node { + p.expect(ast.Token_LOCK_P) + p.have(ast.Token_TABLE) + n := &ast.LockStmt{Mode: accessExclusiveLock} + n.Relations = p.parseRelationExprList() + if p.have(ast.Token_IN_P) { + // lock_type MODE + switch { + case p.have(ast.Token_ACCESS): + switch { + case p.have(ast.Token_SHARE): + n.Mode = accessShareLock + case p.have(ast.Token_EXCLUSIVE): + n.Mode = accessExclusiveLock + default: + p.syntaxErrorAt() + } + case p.have(ast.Token_ROW): + switch { + case p.have(ast.Token_SHARE): + n.Mode = rowShareLock + case p.have(ast.Token_EXCLUSIVE): + n.Mode = rowExclusiveLock + default: + p.syntaxErrorAt() + } + case p.have(ast.Token_SHARE): + switch { + case p.have(ast.Token_UPDATE): + p.expect(ast.Token_EXCLUSIVE) + n.Mode = shareUpdateExclusiveLock + case p.have(ast.Token_ROW): + p.expect(ast.Token_EXCLUSIVE) + n.Mode = shareRowExclusiveLock + default: + n.Mode = shareLock + } + case p.have(ast.Token_EXCLUSIVE): + n.Mode = exclusiveLock + default: + p.syntaxErrorAt() + } + p.expect(ast.Token_MODE) + } + n.Nowait = p.have(ast.Token_NOWAIT) + return &ast.Node{Node: &ast.Node_LockStmt{LockStmt: n}} +} + +// parseRelationExprList is gram.y's relation_expr_list. +func (p *parser) parseRelationExprList() []*ast.Node { + list := []*ast.Node{p.parseRelationExpr()} + for p.have(ast.Token(',')) { + list = append(list, p.parseRelationExpr()) + } + return list +} + +// parseOptDropBehavior is gram.y's opt_drop_behavior. +func (p *parser) parseOptDropBehavior() ast.DropBehavior { + switch p.kind() { + case ast.Token_CASCADE: + p.next() + return ast.DropBehavior_DROP_CASCADE + case ast.Token_RESTRICT: + p.next() + return ast.DropBehavior_DROP_RESTRICT + } + return ast.DropBehavior_DROP_RESTRICT +} + +// parseTruncateStmt is gram.y's TruncateStmt: +// +// TRUNCATE opt_table relation_expr_list opt_restart_seqs opt_drop_behavior +func (p *parser) parseTruncateStmt() *ast.Node { + p.expect(ast.Token_TRUNCATE) + p.have(ast.Token_TABLE) + n := &ast.TruncateStmt{} + n.Relations = p.parseRelationExprList() + switch p.kind() { + case ast.Token_CONTINUE_P: + p.next() + p.expect(ast.Token_IDENTITY_P) + case ast.Token_RESTART: + p.next() + p.expect(ast.Token_IDENTITY_P) + n.RestartSeqs = true + } + n.Behavior = p.parseOptDropBehavior() + return &ast.Node{Node: &ast.Node_TruncateStmt{TruncateStmt: n}} +} diff --git a/oracle/oracle b/oracle/oracle index 34360cb..19b19c1 100755 Binary files a/oracle/oracle and b/oracle/oracle differ diff --git a/parser/parser.go b/parser/parser.go index 3b2754f..ad087e5 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -152,8 +152,26 @@ func SplitWithScanner(input string, trimSpace bool) (result []string, err error) } } +// SplitWithParser splits on the RawStmt boundaries of a real parse +// (pg_query_split.c: pg_query_split_with_parser); a zero stmt_len runs to +// the end of the input. func SplitWithParser(input string, trimSpace bool) (result []string, err error) { - return nil, errNotImplemented("SplitWithParser") + tree, perr := parse.Parse(input) + if perr != nil { + return nil, scanErr(perr) + } + for _, raw := range tree.Stmts { + end := raw.StmtLocation + raw.StmtLen + if raw.StmtLen == 0 { + end = int32(len(input)) + } + stmt := input[raw.StmtLocation:end] + if trimSpace { + stmt = strings.TrimSpace(stmt) + } + result = append(result, stmt) + } + return result, nil } func FingerprintToUInt64(input string) (result uint64, err error) { @@ -170,8 +188,25 @@ func HashXXH3_64(input []byte, seed uint64) (result uint64) { return xxh3.Hash64Seed(input, seed) } +// IsUtilityStmt reports, per statement, whether it is a utility statement +// (pg_query_is_utility_stmt.c: everything except SELECT/INSERT/UPDATE/ +// DELETE/MERGE). func IsUtilityStmt(input string) (result []bool, err error) { - return nil, errNotImplemented("IsUtilityStmt") + tree, perr := parse.Parse(input) + if perr != nil { + return nil, scanErr(perr) + } + result = make([]bool, 0, len(tree.Stmts)) + for _, raw := range tree.Stmts { + switch raw.Stmt.Node.(type) { + case *ast.Node_SelectStmt, *ast.Node_InsertStmt, *ast.Node_UpdateStmt, + *ast.Node_DeleteStmt, *ast.Node_MergeStmt: + result = append(result, false) + default: + result = append(result, true) + } + } + return result, nil } func SummaryToProtobuf(input string, truncateLimit int) ([]byte, error) { diff --git a/parser/testdata/deparse/postgres_regress/alter_generic.metadata.json b/parser/testdata/deparse/postgres_regress/alter_generic.metadata.json index d5998bc..958ba62 100644 --- a/parser/testdata/deparse/postgres_regress/alter_generic.metadata.json +++ b/parser/testdata/deparse/postgres_regress/alter_generic.metadata.json @@ -1,6 +1,5 @@ { "todo": [ - "001", "002", "003", "004", diff --git a/parser/testdata/deparse/postgres_regress/alter_table.metadata.json b/parser/testdata/deparse/postgres_regress/alter_table.metadata.json index bfe6d13..16a336a 100644 --- a/parser/testdata/deparse/postgres_regress/alter_table.metadata.json +++ b/parser/testdata/deparse/postgres_regress/alter_table.metadata.json @@ -60,7 +60,6 @@ "058", "059", "060", - "061", "062", "063", "064", @@ -1237,7 +1236,6 @@ "581", "582", "583", - "584", "585", "586", "587", diff --git a/parser/testdata/deparse/postgres_regress/collate.icu.utf8.metadata.json b/parser/testdata/deparse/postgres_regress/collate.icu.utf8.metadata.json index ac3a9a6..90d2a91 100644 --- a/parser/testdata/deparse/postgres_regress/collate.icu.utf8.metadata.json +++ b/parser/testdata/deparse/postgres_regress/collate.icu.utf8.metadata.json @@ -186,7 +186,6 @@ "185", "186", "187", - "188", "189", "190", "191", diff --git a/parser/testdata/deparse/postgres_regress/collate.linux.utf8.metadata.json b/parser/testdata/deparse/postgres_regress/collate.linux.utf8.metadata.json index 83d100f..bee9810 100644 --- a/parser/testdata/deparse/postgres_regress/collate.linux.utf8.metadata.json +++ b/parser/testdata/deparse/postgres_regress/collate.linux.utf8.metadata.json @@ -179,7 +179,6 @@ "178", "179", "180", - "181", "182", "183", "184", diff --git a/parser/testdata/deparse/postgres_regress/collate.windows.win1252.metadata.json b/parser/testdata/deparse/postgres_regress/collate.windows.win1252.metadata.json index 24e4d39..fec01cc 100644 --- a/parser/testdata/deparse/postgres_regress/collate.windows.win1252.metadata.json +++ b/parser/testdata/deparse/postgres_regress/collate.windows.win1252.metadata.json @@ -150,7 +150,6 @@ "149", "150", "151", - "152", "153", "154", "155", diff --git a/parser/testdata/deparse/postgres_regress/constraints.metadata.json b/parser/testdata/deparse/postgres_regress/constraints.metadata.json index 60b2f8d..2fb26ba 100644 --- a/parser/testdata/deparse/postgres_regress/constraints.metadata.json +++ b/parser/testdata/deparse/postgres_regress/constraints.metadata.json @@ -14,8 +14,6 @@ "012", "013", "014", - "015", - "016", "017", "018", "019", diff --git a/parser/testdata/deparse/postgres_regress/conversion.metadata.json b/parser/testdata/deparse/postgres_regress/conversion.metadata.json index 8836c0c..6371c10 100644 --- a/parser/testdata/deparse/postgres_regress/conversion.metadata.json +++ b/parser/testdata/deparse/postgres_regress/conversion.metadata.json @@ -1,8 +1,6 @@ { "todo": [ - "001", "002", - "003", "004", "005", "006", diff --git a/parser/testdata/deparse/postgres_regress/copy2.metadata.json b/parser/testdata/deparse/postgres_regress/copy2.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/deparse/postgres_regress/copy2.metadata.json +++ b/parser/testdata/deparse/postgres_regress/copy2.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/deparse/postgres_regress/create_am.metadata.json b/parser/testdata/deparse/postgres_regress/create_am.metadata.json index fbb7044..7d5792b 100644 --- a/parser/testdata/deparse/postgres_regress/create_am.metadata.json +++ b/parser/testdata/deparse/postgres_regress/create_am.metadata.json @@ -35,8 +35,6 @@ "033", "034", "035", - "037", - "038", "039", "040", "041", diff --git a/parser/testdata/deparse/postgres_regress/create_function_c.metadata.json b/parser/testdata/deparse/postgres_regress/create_function_c.metadata.json index 90204d5..44489c3 100644 --- a/parser/testdata/deparse/postgres_regress/create_function_c.metadata.json +++ b/parser/testdata/deparse/postgres_regress/create_function_c.metadata.json @@ -1,8 +1,6 @@ { "todo": [ - "001", "002", - "003", "005" ] } diff --git a/parser/testdata/deparse/postgres_regress/create_function_sql.metadata.json b/parser/testdata/deparse/postgres_regress/create_function_sql.metadata.json index 86305c3..bbad950 100644 --- a/parser/testdata/deparse/postgres_regress/create_function_sql.metadata.json +++ b/parser/testdata/deparse/postgres_regress/create_function_sql.metadata.json @@ -59,20 +59,15 @@ "057", "058", "059", - "060", "062", - "063", "064", - "065", "066", "067", "068", - "069", "070", "071", "072", "073", - "074", "075", "076", "077", @@ -126,7 +121,6 @@ "125", "126", "127", - "128", "129", "130", "131", diff --git a/parser/testdata/deparse/postgres_regress/create_index.metadata.json b/parser/testdata/deparse/postgres_regress/create_index.metadata.json index 185d38e..fb2d23e 100644 --- a/parser/testdata/deparse/postgres_regress/create_index.metadata.json +++ b/parser/testdata/deparse/postgres_regress/create_index.metadata.json @@ -2,7 +2,6 @@ "todo": [ "001", "002", - "003", "004", "005", "006", @@ -572,7 +571,6 @@ "572", "573", "574", - "575", "576", "577", "578", diff --git a/parser/testdata/deparse/postgres_regress/create_operator.metadata.json b/parser/testdata/deparse/postgres_regress/create_operator.metadata.json index bb4c277..ee386e5 100644 --- a/parser/testdata/deparse/postgres_regress/create_operator.metadata.json +++ b/parser/testdata/deparse/postgres_regress/create_operator.metadata.json @@ -10,7 +10,6 @@ "008", "009", "010", - "011", "012", "013", "015", diff --git a/parser/testdata/deparse/postgres_regress/create_procedure.metadata.json b/parser/testdata/deparse/postgres_regress/create_procedure.metadata.json index c169184..2124d37 100644 --- a/parser/testdata/deparse/postgres_regress/create_procedure.metadata.json +++ b/parser/testdata/deparse/postgres_regress/create_procedure.metadata.json @@ -11,12 +11,10 @@ "009", "010", "011", - "012", "013", "014", "015", "016", - "017", "018", "019", "020", diff --git a/parser/testdata/deparse/postgres_regress/create_table.metadata.json b/parser/testdata/deparse/postgres_regress/create_table.metadata.json index 5e22279..16c3b3b 100644 --- a/parser/testdata/deparse/postgres_regress/create_table.metadata.json +++ b/parser/testdata/deparse/postgres_regress/create_table.metadata.json @@ -30,7 +30,6 @@ "028", "029", "031", - "032", "033", "034", "035", @@ -74,7 +73,6 @@ "073", "074", "075", - "076", "077", "078", "079", @@ -132,7 +130,6 @@ "131", "132", "133", - "134", "135", "136", "137", diff --git a/parser/testdata/deparse/postgres_regress/create_type.metadata.json b/parser/testdata/deparse/postgres_regress/create_type.metadata.json index b064cb7..0a546c6 100644 --- a/parser/testdata/deparse/postgres_regress/create_type.metadata.json +++ b/parser/testdata/deparse/postgres_regress/create_type.metadata.json @@ -1,9 +1,5 @@ { "todo": [ - "001", - "002", - "003", - "004", "005", "006", "007", @@ -61,7 +57,6 @@ "059", "060", "061", - "062", "063", "064", "065", diff --git a/parser/testdata/deparse/postgres_regress/create_view.metadata.json b/parser/testdata/deparse/postgres_regress/create_view.metadata.json index 0aae9dc..f3d65ad 100644 --- a/parser/testdata/deparse/postgres_regress/create_view.metadata.json +++ b/parser/testdata/deparse/postgres_regress/create_view.metadata.json @@ -1,6 +1,5 @@ { "todo": [ - "001", "002", "004", "005", diff --git a/parser/testdata/deparse/postgres_regress/errors.metadata.json b/parser/testdata/deparse/postgres_regress/errors.metadata.json index 2fd3b8b..cbe4108 100644 --- a/parser/testdata/deparse/postgres_regress/errors.metadata.json +++ b/parser/testdata/deparse/postgres_regress/errors.metadata.json @@ -10,9 +10,7 @@ "009", "010", "012", - "013", "014", - "015", "016", "017", "018", @@ -25,40 +23,16 @@ "025", "026", "027", - "028", - "029", "030", - "031", - "032", - "033", "034", "035", "036", - "037", - "038", "039", - "040", - "041", "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", "050", - "051", - "052", "053", "054", - "055", - "056", - "057", "058", - "059", - "060", - "061", "062", "063", "064", @@ -69,17 +43,6 @@ "069", "070", "071", - "072", - "073", - "074", - "075", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085" + "072" ] } diff --git a/parser/testdata/deparse/postgres_regress/event_trigger.metadata.json b/parser/testdata/deparse/postgres_regress/event_trigger.metadata.json index 21e7df0..d1d36fe 100644 --- a/parser/testdata/deparse/postgres_regress/event_trigger.metadata.json +++ b/parser/testdata/deparse/postgres_regress/event_trigger.metadata.json @@ -16,7 +16,6 @@ "014", "015", "016", - "017", "018", "019", "020", diff --git a/parser/testdata/deparse/postgres_regress/foreign_data.metadata.json b/parser/testdata/deparse/postgres_regress/foreign_data.metadata.json index efde331..c02bf54 100644 --- a/parser/testdata/deparse/postgres_regress/foreign_data.metadata.json +++ b/parser/testdata/deparse/postgres_regress/foreign_data.metadata.json @@ -1,6 +1,5 @@ { "todo": [ - "001", "002", "003", "004", @@ -36,7 +35,6 @@ "034", "035", "036", - "037", "038", "039", "040", @@ -110,7 +108,6 @@ "108", "109", "110", - "111", "112", "113", "114", @@ -199,7 +196,6 @@ "197", "198", "199", - "200", "201", "202", "203", diff --git a/parser/testdata/deparse/postgres_regress/foreign_key.metadata.json b/parser/testdata/deparse/postgres_regress/foreign_key.metadata.json index 0d39ce9..d3c3ad7 100644 --- a/parser/testdata/deparse/postgres_regress/foreign_key.metadata.json +++ b/parser/testdata/deparse/postgres_regress/foreign_key.metadata.json @@ -382,7 +382,6 @@ "225", "226", "227", - "228", "229", "230", "231", @@ -579,9 +578,6 @@ "422", "423", "424", - "425", - "426", - "427", "428", "429", "430", diff --git a/parser/testdata/deparse/postgres_regress/generated.metadata.json b/parser/testdata/deparse/postgres_regress/generated.metadata.json index b6ecb7b..3dedd91 100644 --- a/parser/testdata/deparse/postgres_regress/generated.metadata.json +++ b/parser/testdata/deparse/postgres_regress/generated.metadata.json @@ -20,7 +20,6 @@ "018", "019", "020", - "021", "022", "023", "024", diff --git a/parser/testdata/deparse/postgres_regress/indirect_toast.metadata.json b/parser/testdata/deparse/postgres_regress/indirect_toast.metadata.json index d49a93c..122ff18 100644 --- a/parser/testdata/deparse/postgres_regress/indirect_toast.metadata.json +++ b/parser/testdata/deparse/postgres_regress/indirect_toast.metadata.json @@ -1,6 +1,5 @@ { "todo": [ - "001", "002", "003", "004", diff --git a/parser/testdata/deparse/postgres_regress/largeobject.metadata.json b/parser/testdata/deparse/postgres_regress/largeobject.metadata.json index 268ea7b..8ebfb3c 100644 --- a/parser/testdata/deparse/postgres_regress/largeobject.metadata.json +++ b/parser/testdata/deparse/postgres_regress/largeobject.metadata.json @@ -29,7 +29,6 @@ "028", "029", "030", - "031", "032", "033", "034", diff --git a/parser/testdata/deparse/postgres_regress/lock.metadata.json b/parser/testdata/deparse/postgres_regress/lock.metadata.json index 507be8d..9b2d87e 100644 --- a/parser/testdata/deparse/postgres_regress/lock.metadata.json +++ b/parser/testdata/deparse/postgres_regress/lock.metadata.json @@ -129,7 +129,6 @@ "127", "128", "129", - "130", "131" ] } diff --git a/parser/testdata/deparse/postgres_regress/misc.metadata.json b/parser/testdata/deparse/postgres_regress/misc.metadata.json index a5cd28a..069aef8 100644 --- a/parser/testdata/deparse/postgres_regress/misc.metadata.json +++ b/parser/testdata/deparse/postgres_regress/misc.metadata.json @@ -1,7 +1,5 @@ { "todo": [ - "001", - "002", "003", "004", "005", diff --git a/parser/testdata/deparse/postgres_regress/misc_functions.metadata.json b/parser/testdata/deparse/postgres_regress/misc_functions.metadata.json index dd486fa..f1db180 100644 --- a/parser/testdata/deparse/postgres_regress/misc_functions.metadata.json +++ b/parser/testdata/deparse/postgres_regress/misc_functions.metadata.json @@ -22,7 +22,6 @@ "020", "021", "022", - "023", "024", "025", "026", @@ -91,7 +90,6 @@ "091", "092", "093", - "094", "095", "096", "097", diff --git a/parser/testdata/deparse/postgres_regress/namespace.metadata.json b/parser/testdata/deparse/postgres_regress/namespace.metadata.json index 6e8763d..7005637 100644 --- a/parser/testdata/deparse/postgres_regress/namespace.metadata.json +++ b/parser/testdata/deparse/postgres_regress/namespace.metadata.json @@ -25,7 +25,6 @@ "023", "024", "025", - "026", "027", "028", "029", diff --git a/parser/testdata/deparse/postgres_regress/publication.metadata.json b/parser/testdata/deparse/postgres_regress/publication.metadata.json index 8cf9d31..ae5b33b 100644 --- a/parser/testdata/deparse/postgres_regress/publication.metadata.json +++ b/parser/testdata/deparse/postgres_regress/publication.metadata.json @@ -43,8 +43,6 @@ "041", "042", "043", - "044", - "045", "046", "047", "048", @@ -110,8 +108,6 @@ "108", "109", "110", - "111", - "112", "113", "114", "115", @@ -508,8 +504,6 @@ "506", "507", "508", - "509", - "510", "511", "512", "513", @@ -526,8 +520,6 @@ "524", "525", "526", - "527", - "528", "529", "530", "531", @@ -567,7 +559,6 @@ "565", "566", "567", - "568", "569", "570", "571", diff --git a/parser/testdata/deparse/postgres_regress/rowsecurity.metadata.json b/parser/testdata/deparse/postgres_regress/rowsecurity.metadata.json index 2c2ac38..3240031 100644 --- a/parser/testdata/deparse/postgres_regress/rowsecurity.metadata.json +++ b/parser/testdata/deparse/postgres_regress/rowsecurity.metadata.json @@ -36,7 +36,6 @@ "034", "035", "036", - "037", "038", "039", "040", diff --git a/parser/testdata/deparse/postgres_regress/rules.metadata.json b/parser/testdata/deparse/postgres_regress/rules.metadata.json index 6964785..ac76969 100644 --- a/parser/testdata/deparse/postgres_regress/rules.metadata.json +++ b/parser/testdata/deparse/postgres_regress/rules.metadata.json @@ -570,9 +570,7 @@ "569", "570", "571", - "572", "573", - "574", "575", "576", "577", diff --git a/parser/testdata/deparse/postgres_regress/stats.metadata.json b/parser/testdata/deparse/postgres_regress/stats.metadata.json index 99b6ab6..061c0cb 100644 --- a/parser/testdata/deparse/postgres_regress/stats.metadata.json +++ b/parser/testdata/deparse/postgres_regress/stats.metadata.json @@ -195,14 +195,11 @@ "237", "238", "239", - "240", "241", "242", "243", "244", "245", - "246", - "247", "248", "249", "251", diff --git a/parser/testdata/deparse/postgres_regress/stats_ext.metadata.json b/parser/testdata/deparse/postgres_regress/stats_ext.metadata.json index b2f6706..c8ed76b 100644 --- a/parser/testdata/deparse/postgres_regress/stats_ext.metadata.json +++ b/parser/testdata/deparse/postgres_regress/stats_ext.metadata.json @@ -2,9 +2,6 @@ "todo": [ "001", "002", - "003", - "004", - "005", "006", "007", "008", @@ -23,8 +20,6 @@ "021", "022", "023", - "024", - "025", "026", "027", "028", diff --git a/parser/testdata/deparse/postgres_regress/subscription.metadata.json b/parser/testdata/deparse/postgres_regress/subscription.metadata.json index 494e73b..1bf8a2b 100644 --- a/parser/testdata/deparse/postgres_regress/subscription.metadata.json +++ b/parser/testdata/deparse/postgres_regress/subscription.metadata.json @@ -5,8 +5,6 @@ "003", "004", "005", - "006", - "007", "008", "009", "010", diff --git a/parser/testdata/deparse/postgres_regress/test_setup.metadata.json b/parser/testdata/deparse/postgres_regress/test_setup.metadata.json index f11579c..c047e8e 100644 --- a/parser/testdata/deparse/postgres_regress/test_setup.metadata.json +++ b/parser/testdata/deparse/postgres_regress/test_setup.metadata.json @@ -54,8 +54,6 @@ "059", "060", "061", - "062", - "063", "064", "065", "066", diff --git a/parser/testdata/deparse/postgres_regress/transactions.metadata.json b/parser/testdata/deparse/postgres_regress/transactions.metadata.json index df001e2..33429cd 100644 --- a/parser/testdata/deparse/postgres_regress/transactions.metadata.json +++ b/parser/testdata/deparse/postgres_regress/transactions.metadata.json @@ -382,68 +382,43 @@ "385", "386", "387", - "388", "390", "391", - "392", "394", "395", - "397", "398", "399", - "401", "402", "403", - "405", "407", - "409", "410", "411", "412", "414", - "416", "417", "419", - "421", "422", - "423", "424", - "426", "427", - "429", - "430", - "431", "432", - "433", "434", "435", - "436", "437", "438", "439", - "441", "443", - "445", "447", - "449", "451", - "453", "455", - "456", "458", "459", "460", - "461", "463", "464", "465", "466", - "467", - "469", "471", "472", - "473", - "475", "477", "478", "479", diff --git a/parser/testdata/deparse/postgres_regress/triggers.metadata.json b/parser/testdata/deparse/postgres_regress/triggers.metadata.json index a56f329..1fda10e 100644 --- a/parser/testdata/deparse/postgres_regress/triggers.metadata.json +++ b/parser/testdata/deparse/postgres_regress/triggers.metadata.json @@ -1,10 +1,5 @@ { "todo": [ - "001", - "002", - "003", - "004", - "005", "006", "007", "008", @@ -145,7 +140,6 @@ "1039", "104", "1040", - "1041", "1042", "1043", "1044", @@ -238,9 +232,7 @@ "179", "180", "181", - "182", "183", - "184", "185", "186", "187", diff --git a/parser/testdata/deparse/postgres_regress/tuplesort.metadata.json b/parser/testdata/deparse/postgres_regress/tuplesort.metadata.json index c2deed3..3f30b56 100644 --- a/parser/testdata/deparse/postgres_regress/tuplesort.metadata.json +++ b/parser/testdata/deparse/postgres_regress/tuplesort.metadata.json @@ -102,9 +102,7 @@ "100", "101", "102", - "103", "104", - "105", "106" ] } diff --git a/parser/testdata/deparse/postgres_regress/vacuum.metadata.json b/parser/testdata/deparse/postgres_regress/vacuum.metadata.json index f4b786f..9b0a401 100644 --- a/parser/testdata/deparse/postgres_regress/vacuum.metadata.json +++ b/parser/testdata/deparse/postgres_regress/vacuum.metadata.json @@ -179,7 +179,6 @@ "177", "178", "179", - "180", "181", "182", "183", diff --git a/parser/testdata/deparse/postgres_regress/window.metadata.json b/parser/testdata/deparse/postgres_regress/window.metadata.json index 7124123..324ef54 100644 --- a/parser/testdata/deparse/postgres_regress/window.metadata.json +++ b/parser/testdata/deparse/postgres_regress/window.metadata.json @@ -122,12 +122,10 @@ "120", "121", "122", - "123", "124", "125", "126", "127", - "128", "129", "130", "131", diff --git a/parser/testdata/deparse/postgres_regress/with.metadata.json b/parser/testdata/deparse/postgres_regress/with.metadata.json index b24b526..f20df62 100644 --- a/parser/testdata/deparse/postgres_regress/with.metadata.json +++ b/parser/testdata/deparse/postgres_regress/with.metadata.json @@ -285,8 +285,6 @@ "283", "284", "285", - "286", - "287", "288", "289", "290", diff --git a/parser/testdata/parse/deparse/comment_multiline.metadata.json b/parser/testdata/parse/deparse/comment_multiline.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/deparse/comment_multiline.metadata.json +++ b/parser/testdata/parse/deparse/comment_multiline.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/deparse/ddl_alter_table_add_constraint.metadata.json b/parser/testdata/parse/deparse/ddl_alter_table_add_constraint.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/deparse/ddl_alter_table_add_constraint.metadata.json +++ b/parser/testdata/parse/deparse/ddl_alter_table_add_constraint.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/deparse/ddl_create_index.metadata.json b/parser/testdata/parse/deparse/ddl_create_index.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/deparse/ddl_create_index.metadata.json +++ b/parser/testdata/parse/deparse/ddl_create_index.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/deparse/ddl_create_table.metadata.json b/parser/testdata/parse/deparse/ddl_create_table.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/deparse/ddl_create_table.metadata.json +++ b/parser/testdata/parse/deparse/ddl_create_table.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/deparse/ddl_create_trigger.metadata.json b/parser/testdata/parse/deparse/ddl_create_trigger.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/deparse/ddl_create_trigger.metadata.json +++ b/parser/testdata/parse/deparse/ddl_create_trigger.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/deparse/ddl_create_type.metadata.json b/parser/testdata/parse/deparse/ddl_create_type.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/deparse/ddl_create_type.metadata.json +++ b/parser/testdata/parse/deparse/ddl_create_type.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/deparse_depesz/12-explains_01-base.metadata.json b/parser/testdata/parse/deparse_depesz/12-explains_01-base.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/deparse_depesz/12-explains_01-base.metadata.json +++ b/parser/testdata/parse/deparse_depesz/12-explains_01-base.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/deparse_depesz/12-explains_02-analyze.metadata.json b/parser/testdata/parse/deparse_depesz/12-explains_02-analyze.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/deparse_depesz/12-explains_02-analyze.metadata.json +++ b/parser/testdata/parse/deparse_depesz/12-explains_02-analyze.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/deparse_depesz/12-explains_03-verbose.metadata.json b/parser/testdata/parse/deparse_depesz/12-explains_03-verbose.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/deparse_depesz/12-explains_03-verbose.metadata.json +++ b/parser/testdata/parse/deparse_depesz/12-explains_03-verbose.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/deparse_depesz/12-explains_04-analyze-verbose.metadata.json b/parser/testdata/parse/deparse_depesz/12-explains_04-analyze-verbose.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/deparse_depesz/12-explains_04-analyze-verbose.metadata.json +++ b/parser/testdata/parse/deparse_depesz/12-explains_04-analyze-verbose.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/deparse_depesz/12-explains_05-other.metadata.json b/parser/testdata/parse/deparse_depesz/12-explains_05-other.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/deparse_depesz/12-explains_05-other.metadata.json +++ b/parser/testdata/parse/deparse_depesz/12-explains_05-other.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/libpg_query.metadata.json b/parser/testdata/parse/libpg_query.metadata.json index beb223c..737fd31 100644 --- a/parser/testdata/parse/libpg_query.metadata.json +++ b/parser/testdata/parse/libpg_query.metadata.json @@ -1,16 +1,3 @@ { - "todo": [ - "009", - "010", - "012", - "015", - "016", - "017", - "018", - "019", - "025", - "026", - "034", - "035" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/advisory_lock.metadata.json b/parser/testdata/parse/postgres_regress/advisory_lock.metadata.json index 7de0560..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/advisory_lock.metadata.json +++ b/parser/testdata/parse/postgres_regress/advisory_lock.metadata.json @@ -1,12 +1,3 @@ { - "todo": [ - "002", - "008", - "010", - "014", - "018", - "022", - "026", - "029" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/aggregates.metadata.json b/parser/testdata/parse/postgres_regress/aggregates.metadata.json index 04c0775..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/aggregates.metadata.json +++ b/parser/testdata/parse/postgres_regress/aggregates.metadata.json @@ -1,230 +1,3 @@ { - "todo": [ - "001", - "002", - "004", - "081", - "095", - "109", - "111", - "113", - "119", - "125", - "127", - "129", - "131", - "133", - "134", - "135", - "137", - "138", - "140", - "142", - "144", - "146", - "148", - "150", - "152", - "154", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "168", - "170", - "172", - "173", - "174", - "175", - "177", - "181", - "182", - "183", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "195", - "196", - "197", - "198", - "199", - "200", - "201", - "208", - "209", - "210", - "211", - "212", - "213", - "214", - "216", - "217", - "218", - "219", - "220", - "221", - "241", - "244", - "247", - "250", - "253", - "256", - "259", - "262", - "275", - "283", - "284", - "286", - "287", - "288", - "289", - "290", - "291", - "292", - "294", - "295", - "297", - "298", - "300", - "301", - "302", - "303", - "304", - "305", - "306", - "307", - "357", - "360", - "367", - "368", - "369", - "370", - "371", - "372", - "373", - "383", - "384", - "385", - "388", - "389", - "390", - "391", - "392", - "393", - "395", - "396", - "397", - "398", - "400", - "401", - "402", - "403", - "404", - "405", - "406", - "407", - "408", - "409", - "410", - "411", - "412", - "413", - "414", - "415", - "416", - "417", - "418", - "419", - "420", - "421", - "422", - "424", - "425", - "426", - "427", - "428", - "429", - "430", - "432", - "433", - "434", - "435", - "436", - "437", - "438", - "439", - "440", - "441", - "442", - "443", - "444", - "446", - "447", - "448", - "449", - "450", - "451", - "453", - "454", - "455", - "456", - "457", - "458", - "459", - "460", - "461", - "463", - "465", - "471", - "472", - "473", - "474", - "475", - "477", - "478", - "479", - "480", - "481", - "482", - "483", - "484", - "485", - "486", - "487", - "488", - "489", - "490", - "491", - "492", - "493", - "494", - "495", - "496", - "497", - "498", - "499", - "500", - "501", - "502", - "507", - "508", - "509", - "510", - "511", - "512", - "513", - "514" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/alter_generic.metadata.json b/parser/testdata/parse/postgres_regress/alter_generic.metadata.json index 28b5eba..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/alter_generic.metadata.json +++ b/parser/testdata/parse/postgres_regress/alter_generic.metadata.json @@ -1,323 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "148", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179", - "180", - "181", - "182", - "183", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "195", - "196", - "197", - "198", - "199", - "200", - "201", - "202", - "203", - "204", - "205", - "206", - "207", - "208", - "209", - "210", - "211", - "212", - "213", - "214", - "215", - "216", - "217", - "218", - "219", - "220", - "221", - "222", - "223", - "224", - "225", - "226", - "227", - "228", - "229", - "230", - "231", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "248", - "249", - "250", - "251", - "252", - "253", - "254", - "255", - "256", - "257", - "258", - "259", - "260", - "261", - "262", - "263", - "264", - "265", - "266", - "268", - "269", - "270", - "271", - "272", - "273", - "274", - "275", - "276", - "277", - "278", - "279", - "280", - "281", - "282", - "283", - "284", - "285", - "287", - "288", - "289", - "290", - "291", - "292", - "293", - "294", - "295", - "296", - "297", - "298", - "299", - "300", - "301", - "302", - "303", - "304", - "306", - "307", - "308", - "309", - "310", - "311", - "312", - "313", - "315", - "316", - "317", - "318", - "319", - "320", - "321", - "322", - "324", - "325", - "326", - "327", - "328", - "329", - "330", - "331", - "332" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/alter_operator.metadata.json b/parser/testdata/parse/postgres_regress/alter_operator.metadata.json index 51ee963..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/alter_operator.metadata.json +++ b/parser/testdata/parse/postgres_regress/alter_operator.metadata.json @@ -1,55 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "005", - "006", - "009", - "010", - "013", - "016", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "036", - "038", - "039", - "041", - "042", - "043", - "044", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/alter_table.metadata.json b/parser/testdata/parse/postgres_regress/alter_table.metadata.json index ab39fd4..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/alter_table.metadata.json +++ b/parser/testdata/parse/postgres_regress/alter_table.metadata.json @@ -1,1310 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "073", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "096", - "099", - "100", - "1001", - "1002", - "1003", - "1005", - "1006", - "1007", - "1009", - "101", - "1010", - "1011", - "1012", - "1013", - "1014", - "1015", - "1016", - "1018", - "1019", - "1020", - "1021", - "1023", - "1024", - "1025", - "1026", - "1027", - "1028", - "1029", - "103", - "1031", - "1033", - "1035", - "1037", - "1038", - "1039", - "1040", - "1041", - "1042", - "1043", - "1044", - "1045", - "1046", - "1047", - "1048", - "1049", - "105", - "1050", - "1051", - "1054", - "1055", - "1056", - "1057", - "1058", - "1059", - "106", - "1060", - "1061", - "1062", - "1063", - "1064", - "1065", - "1066", - "1067", - "1068", - "1069", - "107", - "1070", - "1076", - "1077", - "1078", - "1079", - "108", - "1080", - "1081", - "1082", - "1083", - "1084", - "1085", - "1086", - "1087", - "1088", - "1089", - "109", - "1090", - "1091", - "1092", - "1093", - "1094", - "1095", - "1096", - "1097", - "1098", - "1099", - "110", - "1100", - "1101", - "1102", - "1103", - "1104", - "1105", - "1106", - "1107", - "1108", - "1109", - "111", - "1110", - "1111", - "1112", - "1113", - "1114", - "1115", - "1116", - "1117", - "1118", - "1119", - "112", - "1120", - "1121", - "1122", - "1123", - "1124", - "1125", - "1126", - "1127", - "1128", - "1129", - "113", - "1130", - "1131", - "1132", - "1133", - "1134", - "1135", - "1136", - "1137", - "1138", - "1139", - "114", - "1140", - "1141", - "1142", - "1143", - "1144", - "1145", - "1146", - "1147", - "1149", - "115", - "1150", - "1151", - "1152", - "1153", - "1154", - "1155", - "1156", - "1157", - "1158", - "1159", - "116", - "1160", - "1161", - "1162", - "1163", - "1164", - "1165", - "1166", - "1167", - "1168", - "1169", - "117", - "1170", - "1171", - "1172", - "1173", - "1174", - "1175", - "1176", - "1177", - "1178", - "1179", - "118", - "1180", - "1181", - "1182", - "1183", - "1184", - "1185", - "1189", - "119", - "1190", - "1191", - "1192", - "1193", - "1194", - "1198", - "1199", - "1200", - "1201", - "1202", - "1203", - "1204", - "1208", - "121", - "1210", - "1211", - "1212", - "1213", - "1214", - "1215", - "1216", - "1217", - "1218", - "122", - "1222", - "1223", - "1224", - "1225", - "1226", - "1228", - "1229", - "123", - "1230", - "1231", - "1232", - "1234", - "1235", - "1236", - "1237", - "1238", - "124", - "1240", - "1241", - "1242", - "1243", - "1244", - "1245", - "1247", - "1248", - "1249", - "1250", - "1251", - "1252", - "1253", - "1254", - "1255", - "1256", - "1257", - "1258", - "1259", - "126", - "1260", - "1261", - "1262", - "1263", - "1264", - "1265", - "1267", - "1268", - "1269", - "127", - "1270", - "1272", - "1273", - "1274", - "1275", - "1276", - "1277", - "1278", - "1279", - "128", - "1280", - "1281", - "1282", - "1283", - "1284", - "1285", - "1286", - "1287", - "1288", - "1289", - "129", - "1290", - "1291", - "1292", - "1293", - "1294", - "1295", - "1296", - "1297", - "1298", - "1299", - "1300", - "1301", - "1302", - "1303", - "1304", - "1305", - "1306", - "1307", - "1308", - "1309", - "131", - "1310", - "1311", - "1312", - "1313", - "1314", - "1315", - "1316", - "1317", - "1318", - "1319", - "132", - "1320", - "1323", - "1324", - "1325", - "1326", - "1327", - "1328", - "1329", - "133", - "1330", - "1331", - "1332", - "1333", - "1334", - "1335", - "1336", - "1337", - "1338", - "1339", - "134", - "1340", - "1341", - "1342", - "1343", - "1344", - "1345", - "1346", - "1347", - "1348", - "1349", - "135", - "1352", - "1353", - "1354", - "1355", - "1356", - "1357", - "1358", - "1359", - "136", - "1360", - "1362", - "1364", - "1365", - "1367", - "1368", - "137", - "1370", - "1371", - "1372", - "1373", - "1374", - "1375", - "1376", - "1377", - "1378", - "1379", - "138", - "1381", - "1383", - "1384", - "1385", - "1386", - "1387", - "1388", - "139", - "1390", - "1391", - "1392", - "1393", - "1394", - "1396", - "1398", - "1399", - "1400", - "1401", - "1402", - "1403", - "1404", - "1405", - "1406", - "1407", - "1408", - "1409", - "141", - "1410", - "1411", - "1412", - "1413", - "1416", - "1417", - "1418", - "1419", - "142", - "1421", - "1422", - "1424", - "1425", - "1426", - "1427", - "1428", - "1429", - "143", - "1430", - "1431", - "1432", - "1433", - "1434", - "1435", - "1436", - "1437", - "1438", - "1439", - "144", - "1440", - "1441", - "1442", - "1443", - "1444", - "1445", - "1447", - "1449", - "145", - "1450", - "1451", - "1453", - "1455", - "1456", - "1457", - "1458", - "1459", - "146", - "1460", - "1461", - "1462", - "1463", - "1464", - "1465", - "1466", - "1467", - "1468", - "1469", - "147", - "1470", - "1471", - "1474", - "1475", - "1476", - "1477", - "1478", - "148", - "1480", - "1481", - "1482", - "1483", - "1484", - "1485", - "1486", - "1487", - "1488", - "1489", - "149", - "1490", - "1491", - "1492", - "1493", - "1494", - "1495", - "1496", - "1497", - "1499", - "150", - "1500", - "1501", - "1502", - "1503", - "1504", - "1505", - "1506", - "1507", - "1508", - "1509", - "151", - "1510", - "1511", - "1512", - "1513", - "1514", - "1515", - "1516", - "1517", - "1518", - "1519", - "152", - "1520", - "1521", - "1522", - "1523", - "1524", - "1525", - "1526", - "1527", - "1528", - "153", - "1530", - "1531", - "1532", - "1533", - "1534", - "1535", - "1536", - "1537", - "1538", - "1539", - "154", - "1541", - "1543", - "1544", - "1545", - "1546", - "1547", - "1548", - "1549", - "155", - "1550", - "1551", - "1553", - "1554", - "1555", - "1556", - "1557", - "1558", - "1559", - "156", - "1560", - "1561", - "1563", - "1565", - "1566", - "1567", - "1568", - "1569", - "157", - "1570", - "1571", - "1572", - "1573", - "1574", - "1575", - "1576", - "1577", - "1578", - "1579", - "158", - "1580", - "1581", - "1583", - "1584", - "1585", - "1586", - "1587", - "1588", - "1589", - "159", - "1590", - "1591", - "1592", - "1593", - "1594", - "1596", - "1597", - "1599", - "160", - "1600", - "1602", - "1603", - "1604", - "1605", - "1606", - "1607", - "1608", - "1609", - "161", - "1610", - "1611", - "1612", - "1613", - "1614", - "1615", - "1616", - "1617", - "1618", - "1619", - "162", - "1620", - "1621", - "1622", - "1623", - "1624", - "1625", - "1626", - "1627", - "1629", - "163", - "1631", - "1633", - "1635", - "1636", - "1637", - "1638", - "164", - "1640", - "1642", - "1644", - "1645", - "1646", - "1647", - "1648", - "1649", - "165", - "1650", - "1651", - "1652", - "1653", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179", - "180", - "188", - "189", - "190", - "192", - "193", - "195", - "196", - "198", - "199", - "200", - "201", - "202", - "204", - "205", - "207", - "208", - "210", - "211", - "213", - "214", - "216", - "217", - "218", - "219", - "220", - "223", - "224", - "226", - "228", - "229", - "230", - "231", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "248", - "249", - "251", - "252", - "253", - "254", - "255", - "256", - "259", - "260", - "261", - "262", - "263", - "264", - "266", - "267", - "270", - "271", - "272", - "273", - "274", - "275", - "276", - "277", - "278", - "279", - "280", - "281", - "282", - "283", - "284", - "285", - "286", - "287", - "288", - "289", - "290", - "291", - "292", - "293", - "294", - "297", - "298", - "301", - "302", - "304", - "306", - "307", - "308", - "309", - "310", - "311", - "314", - "315", - "316", - "318", - "319", - "320", - "321", - "322", - "327", - "328", - "329", - "330", - "331", - "332", - "333", - "334", - "337", - "338", - "339", - "340", - "341", - "342", - "343", - "344", - "346", - "347", - "348", - "349", - "350", - "352", - "353", - "354", - "355", - "356", - "360", - "361", - "362", - "363", - "364", - "368", - "369", - "370", - "373", - "375", - "376", - "377", - "378", - "379", - "380", - "386", - "387", - "388", - "391", - "392", - "393", - "398", - "399", - "400", - "401", - "402", - "405", - "407", - "408", - "410", - "412", - "413", - "414", - "415", - "416", - "418", - "419", - "420", - "421", - "423", - "424", - "425", - "426", - "427", - "428", - "429", - "431", - "432", - "433", - "434", - "436", - "437", - "438", - "439", - "440", - "441", - "450", - "451", - "455", - "456", - "457", - "458", - "459", - "460", - "461", - "462", - "463", - "464", - "466", - "468", - "469", - "470", - "471", - "472", - "473", - "474", - "475", - "476", - "478", - "479", - "480", - "481", - "482", - "483", - "485", - "486", - "489", - "490", - "491", - "493", - "494", - "495", - "496", - "497", - "498", - "499", - "500", - "503", - "506", - "507", - "509", - "511", - "514", - "516", - "517", - "518", - "520", - "522", - "524", - "525", - "528", - "529", - "530", - "531", - "532", - "534", - "536", - "539", - "540", - "541", - "542", - "543", - "544", - "546", - "547", - "582", - "583", - "584", - "585", - "586", - "588", - "589", - "590", - "591", - "592", - "593", - "594", - "595", - "596", - "597", - "598", - "599", - "600", - "601", - "602", - "603", - "604", - "605", - "606", - "607", - "608", - "609", - "610", - "611", - "612", - "613", - "614", - "615", - "616", - "617", - "618", - "619", - "620", - "621", - "622", - "623", - "625", - "627", - "630", - "631", - "632", - "633", - "635", - "636", - "638", - "639", - "642", - "643", - "645", - "646", - "650", - "653", - "654", - "655", - "656", - "657", - "658", - "659", - "660", - "661", - "662", - "664", - "674", - "675", - "676", - "677", - "678", - "679", - "680", - "681", - "682", - "683", - "684", - "685", - "686", - "687", - "688", - "689", - "690", - "691", - "692", - "693", - "694", - "695", - "696", - "697", - "698", - "700", - "702", - "703", - "704", - "705", - "706", - "708", - "709", - "710", - "711", - "712", - "713", - "714", - "715", - "716", - "717", - "718", - "719", - "720", - "721", - "722", - "723", - "724", - "726", - "727", - "728", - "729", - "730", - "731", - "732", - "733", - "734", - "736", - "737", - "738", - "739", - "740", - "742", - "743", - "744", - "745", - "752", - "753", - "754", - "757", - "764", - "765", - "766", - "770", - "771", - "772", - "777", - "779", - "780", - "781", - "782", - "783", - "784", - "785", - "787", - "788", - "789", - "790", - "791", - "792", - "793", - "794", - "795", - "796", - "797", - "798", - "799", - "804", - "806", - "807", - "808", - "809", - "810", - "811", - "812", - "813", - "814", - "815", - "816", - "818", - "819", - "820", - "821", - "822", - "823", - "824", - "826", - "828", - "829", - "830", - "831", - "832", - "833", - "834", - "835", - "836", - "837", - "838", - "839", - "840", - "841", - "844", - "847", - "850", - "851", - "852", - "853", - "854", - "855", - "856", - "857", - "858", - "859", - "860", - "862", - "863", - "865", - "867", - "868", - "869", - "870", - "871", - "873", - "875", - "876", - "877", - "878", - "880", - "882", - "883", - "884", - "886", - "887", - "888", - "889", - "890", - "891", - "892", - "893", - "897", - "898", - "899", - "900", - "901", - "902", - "903", - "904", - "905", - "906", - "908", - "909", - "910", - "912", - "913", - "915", - "916", - "917", - "918", - "919", - "920", - "921", - "922", - "923", - "924", - "928", - "929", - "930", - "939", - "940", - "941", - "942", - "943", - "944", - "945", - "947", - "949", - "950", - "952", - "953", - "954", - "956", - "957", - "958", - "960", - "961", - "962", - "964", - "965", - "966", - "968", - "969", - "970", - "972", - "973", - "974", - "976", - "977", - "978", - "980", - "981", - "982", - "984", - "985", - "986", - "988", - "989", - "990", - "992", - "993", - "994", - "996", - "997", - "999" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/amutils.metadata.json b/parser/testdata/parse/postgres_regress/amutils.metadata.json index 9048bdc..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/amutils.metadata.json +++ b/parser/testdata/parse/postgres_regress/amutils.metadata.json @@ -1,7 +1,3 @@ { - "todo": [ - "006", - "007", - "009" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/arrays.metadata.json b/parser/testdata/parse/postgres_regress/arrays.metadata.json index 3364224..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/arrays.metadata.json +++ b/parser/testdata/parse/postgres_regress/arrays.metadata.json @@ -1,40 +1,3 @@ { - "todo": [ - "001", - "002", - "004", - "048", - "064", - "075", - "107", - "109", - "119", - "155", - "223", - "230", - "231", - "234", - "238", - "239", - "245", - "300", - "312", - "313", - "315", - "318", - "319", - "320", - "321", - "322", - "325", - "326", - "444", - "449", - "451", - "452", - "457", - "458", - "460", - "461" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/async.metadata.json b/parser/testdata/parse/postgres_regress/async.metadata.json index 72d3a4f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/async.metadata.json +++ b/parser/testdata/parse/postgres_regress/async.metadata.json @@ -1,8 +1,3 @@ { - "todo": [ - "007", - "008", - "009", - "010" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/bit.metadata.json b/parser/testdata/parse/postgres_regress/bit.metadata.json index 815e758..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/bit.metadata.json +++ b/parser/testdata/parse/postgres_regress/bit.metadata.json @@ -1,17 +1,3 @@ { - "todo": [ - "001", - "008", - "030", - "031", - "036", - "037", - "038", - "043", - "085", - "096", - "105", - "106", - "120" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/bitmapops.metadata.json b/parser/testdata/parse/postgres_regress/bitmapops.metadata.json index c3d0ee8..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/bitmapops.metadata.json +++ b/parser/testdata/parse/postgres_regress/bitmapops.metadata.json @@ -1,11 +1,3 @@ { - "todo": [ - "001", - "003", - "004", - "005", - "006", - "007", - "010" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/boolean.metadata.json b/parser/testdata/parse/postgres_regress/boolean.metadata.json index 134ef67..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/boolean.metadata.json +++ b/parser/testdata/parse/postgres_regress/boolean.metadata.json @@ -1,12 +1,3 @@ { - "todo": [ - "044", - "054", - "073", - "078", - "095", - "096", - "097", - "098" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/box.metadata.json b/parser/testdata/parse/postgres_regress/box.metadata.json index ace92a1..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/box.metadata.json +++ b/parser/testdata/parse/postgres_regress/box.metadata.json @@ -1,41 +1,3 @@ { - "todo": [ - "001", - "030", - "032", - "034", - "036", - "038", - "040", - "042", - "044", - "046", - "048", - "050", - "052", - "054", - "056", - "058", - "059", - "060", - "061", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "087", - "088", - "089", - "090", - "092", - "093", - "095", - "096", - "097" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/brin.metadata.json b/parser/testdata/parse/postgres_regress/brin.metadata.json index c7816ad..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/brin.metadata.json +++ b/parser/testdata/parse/postgres_regress/brin.metadata.json @@ -1,39 +1,3 @@ { - "todo": [ - "001", - "004", - "005", - "007", - "008", - "009", - "012", - "022", - "023", - "024", - "031", - "032", - "038", - "039", - "041", - "042", - "043", - "044", - "045", - "046", - "048", - "050", - "051", - "052", - "054", - "055", - "057", - "058", - "059", - "060", - "062", - "063", - "065", - "067", - "068" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/brin_bloom.metadata.json b/parser/testdata/parse/postgres_regress/brin_bloom.metadata.json index 7440f0b..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/brin_bloom.metadata.json +++ b/parser/testdata/parse/postgres_regress/brin_bloom.metadata.json @@ -1,23 +1,3 @@ { - "todo": [ - "001", - "004", - "005", - "006", - "007", - "008", - "010", - "011", - "012", - "015", - "025", - "026", - "027", - "034", - "036", - "037", - "038", - "039", - "040" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/brin_multi.metadata.json b/parser/testdata/parse/postgres_regress/brin_multi.metadata.json index 8ceb2ad..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/brin_multi.metadata.json +++ b/parser/testdata/parse/postgres_regress/brin_multi.metadata.json @@ -1,83 +1,3 @@ { - "todo": [ - "001", - "004", - "005", - "006", - "007", - "008", - "009", - "011", - "012", - "013", - "016", - "020", - "021", - "024", - "032", - "034", - "035", - "036", - "037", - "038", - "045", - "047", - "048", - "049", - "050", - "051", - "052", - "054", - "055", - "056", - "077", - "099", - "100", - "101", - "103", - "104", - "111", - "119", - "120", - "121", - "122", - "125", - "126", - "127", - "130", - "131", - "132", - "133", - "134", - "135", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "166", - "167", - "168", - "169", - "170", - "171", - "172" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/btree_index.metadata.json b/parser/testdata/parse/postgres_regress/btree_index.metadata.json index 3eabe40..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/btree_index.metadata.json +++ b/parser/testdata/parse/postgres_regress/btree_index.metadata.json @@ -1,63 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "029", - "030", - "031", - "032", - "034", - "036", - "038", - "040", - "042", - "043", - "044", - "045", - "047", - "049", - "050", - "051", - "052", - "054", - "056", - "057", - "058", - "059", - "060", - "061", - "063", - "065", - "067", - "069", - "072", - "073", - "074", - "075", - "076", - "079", - "080", - "081", - "083", - "085", - "087", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/case.metadata.json b/parser/testdata/parse/postgres_regress/case.metadata.json index a1a6197..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/case.metadata.json +++ b/parser/testdata/parse/postgres_regress/case.metadata.json @@ -1,27 +1,3 @@ { - "todo": [ - "001", - "002", - "033", - "034", - "035", - "042", - "043", - "045", - "046", - "047", - "048", - "050", - "051", - "052", - "053", - "054", - "055", - "058", - "059", - "060", - "062", - "063", - "064" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/char.metadata.json b/parser/testdata/parse/postgres_regress/char.metadata.json index 80ec909..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/char.metadata.json +++ b/parser/testdata/parse/postgres_regress/char.metadata.json @@ -1,6 +1,3 @@ { - "todo": [ - "002", - "018" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/circle.metadata.json b/parser/testdata/parse/postgres_regress/circle.metadata.json index d7dfa22..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/circle.metadata.json +++ b/parser/testdata/parse/postgres_regress/circle.metadata.json @@ -1,6 +1,3 @@ { - "todo": [ - "001", - "002" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/cluster.metadata.json b/parser/testdata/parse/postgres_regress/cluster.metadata.json index 52b2ab1..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/cluster.metadata.json +++ b/parser/testdata/parse/postgres_regress/cluster.metadata.json @@ -1,110 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "013", - "046", - "057", - "059", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "075", - "076", - "077", - "088", - "089", - "090", - "091", - "096", - "098", - "104", - "111", - "113", - "115", - "117", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "140", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "167", - "168", - "169", - "171", - "172", - "173", - "174", - "175", - "177", - "179", - "180", - "182", - "183", - "184", - "186", - "188", - "189", - "191", - "192", - "193", - "195", - "197", - "198", - "199", - "200", - "201", - "202", - "203", - "204" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/collate.icu.utf8.metadata.json b/parser/testdata/parse/postgres_regress/collate.icu.utf8.metadata.json index 7083dc4..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/collate.icu.utf8.metadata.json +++ b/parser/testdata/parse/postgres_regress/collate.icu.utf8.metadata.json @@ -1,205 +1,3 @@ { - "todo": [ - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "023", - "024", - "025", - "028", - "040", - "062", - "070", - "071", - "072", - "089", - "111", - "120", - "121", - "122", - "125", - "127", - "134", - "138", - "139", - "140", - "141", - "142", - "143", - "145", - "146", - "148", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "180", - "181", - "182", - "184", - "185", - "186", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "195", - "196", - "197", - "198", - "199", - "200", - "201", - "204", - "205", - "208", - "209", - "210", - "212", - "213", - "214", - "216", - "217", - "219", - "221", - "222", - "223", - "225", - "226", - "228", - "229", - "233", - "234", - "235", - "236", - "237", - "243", - "249", - "250", - "253", - "255", - "257", - "258", - "259", - "269", - "277", - "281", - "283", - "286", - "287", - "288", - "289", - "309", - "311", - "314", - "315", - "316", - "317", - "337", - "339", - "342", - "344", - "345", - "350", - "357", - "362", - "365", - "366", - "367", - "368", - "374", - "376", - "387", - "389", - "400", - "401", - "405", - "406", - "410", - "411", - "412", - "416", - "417", - "418", - "422", - "423", - "424", - "428", - "429", - "430", - "434", - "435", - "439", - "440", - "444", - "445", - "446", - "450", - "451", - "452", - "456", - "457", - "458", - "459", - "460", - "462", - "463", - "464", - "466", - "467", - "469", - "471", - "472", - "474", - "475", - "477", - "479", - "480", - "482", - "483", - "484", - "485", - "486", - "487", - "496", - "497", - "498", - "499", - "500", - "501" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/collate.linux.utf8.metadata.json b/parser/testdata/parse/postgres_regress/collate.linux.utf8.metadata.json index b3049c0..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/collate.linux.utf8.metadata.json +++ b/parser/testdata/parse/postgres_regress/collate.linux.utf8.metadata.json @@ -1,82 +1,3 @@ { - "todo": [ - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "023", - "024", - "025", - "028", - "040", - "062", - "070", - "078", - "079", - "080", - "097", - "119", - "128", - "129", - "130", - "133", - "135", - "142", - "146", - "147", - "148", - "149", - "150", - "151", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "165", - "166", - "167", - "168", - "169", - "170", - "171", - "173", - "174", - "175", - "177", - "178", - "179", - "181", - "182", - "183", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "197", - "198", - "200", - "201", - "202", - "203" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/collate.metadata.json b/parser/testdata/parse/postgres_regress/collate.metadata.json index ad818c3..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/collate.metadata.json +++ b/parser/testdata/parse/postgres_regress/collate.metadata.json @@ -1,65 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "013", - "014", - "015", - "018", - "028", - "033", - "034", - "035", - "048", - "071", - "083", - "087", - "090", - "091", - "092", - "093", - "094", - "095", - "097", - "098", - "099", - "100", - "102", - "105", - "107", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/collate.utf8.metadata.json b/parser/testdata/parse/postgres_regress/collate.utf8.metadata.json index 6381c8e..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/collate.utf8.metadata.json +++ b/parser/testdata/parse/postgres_regress/collate.utf8.metadata.json @@ -1,11 +1,3 @@ { - "todo": [ - "002", - "003", - "004", - "005", - "006", - "007", - "010" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/collate.windows.win1252.metadata.json b/parser/testdata/parse/postgres_regress/collate.windows.win1252.metadata.json index 104d2d0..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/collate.windows.win1252.metadata.json +++ b/parser/testdata/parse/postgres_regress/collate.windows.win1252.metadata.json @@ -1,79 +1,3 @@ { - "todo": [ - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "023", - "024", - "025", - "028", - "053", - "057", - "058", - "072", - "093", - "099", - "100", - "101", - "104", - "106", - "113", - "117", - "118", - "119", - "120", - "121", - "122", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "144", - "145", - "146", - "148", - "149", - "150", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "168", - "169", - "170", - "171", - "172", - "173" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/combocid.metadata.json b/parser/testdata/parse/postgres_regress/combocid.metadata.json index 8a01a83..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/combocid.metadata.json +++ b/parser/testdata/parse/postgres_regress/combocid.metadata.json @@ -1,21 +1,3 @@ { - "todo": [ - "001", - "002", - "016", - "019", - "021", - "023", - "028", - "030", - "043", - "048", - "050", - "052", - "054", - "057", - "059", - "061", - "062" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/compression.metadata.json b/parser/testdata/parse/postgres_regress/compression.metadata.json index 1022e45..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/compression.metadata.json +++ b/parser/testdata/parse/postgres_regress/compression.metadata.json @@ -1,48 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "005", - "013", - "017", - "018", - "019", - "020", - "025", - "026", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "042", - "045", - "046", - "047", - "048", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "064", - "065", - "066", - "067", - "073", - "075", - "076", - "077", - "084", - "085", - "086", - "087" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/constraints.metadata.json b/parser/testdata/parse/postgres_regress/constraints.metadata.json index 6e9982a..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/constraints.metadata.json +++ b/parser/testdata/parse/postgres_regress/constraints.metadata.json @@ -1,148 +1,3 @@ { - "todo": [ - "001", - "008", - "009", - "015", - "016", - "017", - "018", - "019", - "027", - "028", - "036", - "037", - "059", - "063", - "064", - "065", - "071", - "072", - "073", - "076", - "077", - "078", - "083", - "085", - "086", - "096", - "102", - "107", - "115", - "116", - "124", - "125", - "137", - "138", - "148", - "149", - "157", - "158", - "164", - "166", - "169", - "170", - "173", - "175", - "176", - "177", - "184", - "186", - "188", - "189", - "190", - "192", - "193", - "194", - "196", - "197", - "198", - "199", - "200", - "202", - "204", - "206", - "207", - "209", - "210", - "211", - "212", - "213", - "215", - "216", - "217", - "218", - "219", - "220", - "221", - "222", - "224", - "225", - "226", - "227", - "228", - "229", - "230", - "231", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "248", - "250", - "255", - "257", - "258", - "267", - "268", - "269", - "270", - "275", - "277", - "278", - "281", - "282", - "286", - "288", - "290", - "291", - "292", - "293", - "294", - "295", - "296", - "297", - "298", - "299", - "300", - "301", - "302", - "303", - "304", - "305", - "306", - "307", - "308", - "309", - "310", - "311", - "312", - "313", - "314", - "315", - "316", - "317", - "318", - "319" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/conversion.metadata.json b/parser/testdata/parse/postgres_regress/conversion.metadata.json index cd9267f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/conversion.metadata.json +++ b/parser/testdata/parse/postgres_regress/conversion.metadata.json @@ -1,28 +1,3 @@ { - "todo": [ - "001", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "025", - "034", - "038", - "043", - "047", - "053", - "058" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/copy.metadata.json b/parser/testdata/parse/postgres_regress/copy.metadata.json index 5fc0bf7..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/copy.metadata.json +++ b/parser/testdata/parse/postgres_regress/copy.metadata.json @@ -1,43 +1,3 @@ { - "todo": [ - "001", - "007", - "010", - "014", - "017", - "020", - "021", - "022", - "023", - "024", - "029", - "031", - "032", - "034", - "036", - "037", - "038", - "041", - "042", - "043", - "047", - "048", - "049", - "050", - "052", - "054", - "055", - "056", - "057", - "058", - "059", - "070", - "076", - "077", - "081", - "082", - "083", - "084", - "087" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/copy2.metadata.json b/parser/testdata/parse/postgres_regress/copy2.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/copy2.metadata.json +++ b/parser/testdata/parse/postgres_regress/copy2.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/copydml.metadata.json b/parser/testdata/parse/postgres_regress/copydml.metadata.json index 656afe6..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/copydml.metadata.json +++ b/parser/testdata/parse/postgres_regress/copydml.metadata.json @@ -1,36 +1,3 @@ { - "todo": [ - "001", - "013", - "015", - "016", - "018", - "019", - "021", - "022", - "024", - "025", - "027", - "028", - "030", - "031", - "033", - "034", - "036", - "037", - "039", - "040", - "042", - "043", - "045", - "046", - "048", - "049", - "051", - "052", - "053", - "054", - "058", - "059" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/copyselect.metadata.json b/parser/testdata/parse/postgres_regress/copyselect.metadata.json index 0e9fa4a..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/copyselect.metadata.json +++ b/parser/testdata/parse/postgres_regress/copyselect.metadata.json @@ -1,8 +1,3 @@ { - "todo": [ - "001", - "007", - "013", - "021" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_aggregate.metadata.json b/parser/testdata/parse/postgres_regress/create_aggregate.metadata.json index 4fbedec..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_aggregate.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_aggregate.metadata.json @@ -1,60 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "041", - "042", - "043", - "045", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_am.metadata.json b/parser/testdata/parse/postgres_regress/create_am.metadata.json index 2b42ba9..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_am.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_am.metadata.json @@ -1,110 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "014", - "016", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "031", - "034", - "037", - "038", - "039", - "041", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "054", - "056", - "058", - "060", - "063", - "064", - "065", - "067", - "068", - "070", - "071", - "073", - "076", - "077", - "078", - "079", - "080", - "081", - "083", - "084", - "085", - "086", - "089", - "092", - "093", - "096", - "097", - "099", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "119", - "120", - "121", - "122", - "123", - "124", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "136", - "137", - "138", - "139", - "140", - "141", - "142" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_cast.metadata.json b/parser/testdata/parse/postgres_regress/create_cast.metadata.json index 1d443af..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_cast.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_cast.metadata.json @@ -1,19 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "007", - "010", - "011", - "014", - "016", - "017", - "018", - "020", - "021", - "022" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_function_c.metadata.json b/parser/testdata/parse/postgres_regress/create_function_c.metadata.json index 90204d5..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_function_c.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_function_c.metadata.json @@ -1,8 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "005" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_function_sql.metadata.json b/parser/testdata/parse/postgres_regress/create_function_sql.metadata.json index e421d63..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_function_sql.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_function_sql.metadata.json @@ -1,110 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "012", - "013", - "014", - "015", - "017", - "018", - "020", - "021", - "022", - "024", - "025", - "026", - "028", - "029", - "031", - "032", - "034", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "049", - "050", - "051", - "057", - "058", - "059", - "060", - "062", - "063", - "064", - "065", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "089", - "090", - "092", - "093", - "095", - "096", - "097", - "098", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "125", - "127", - "128", - "129", - "131", - "132", - "133", - "135", - "137", - "138", - "139", - "141", - "144", - "146", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "155" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_index.metadata.json b/parser/testdata/parse/postgres_regress/create_index.metadata.json index bfc7fa2..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_index.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_index.metadata.json @@ -1,398 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "027", - "028", - "029", - "030", - "032", - "033", - "036", - "037", - "038", - "039", - "040", - "041", - "062", - "063", - "064", - "065", - "067", - "069", - "071", - "073", - "075", - "077", - "079", - "081", - "083", - "085", - "087", - "089", - "091", - "093", - "095", - "097", - "099", - "101", - "103", - "105", - "107", - "108", - "109", - "110", - "112", - "113", - "114", - "115", - "117", - "122", - "123", - "124", - "125", - "126", - "139", - "140", - "153", - "154", - "162", - "163", - "164", - "165", - "167", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "178", - "179", - "180", - "181", - "182", - "190", - "192", - "193", - "195", - "198", - "199", - "200", - "206", - "207", - "208", - "214", - "215", - "216", - "221", - "222", - "223", - "224", - "225", - "226", - "229", - "230", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "249", - "250", - "251", - "253", - "254", - "255", - "256", - "257", - "259", - "260", - "261", - "263", - "264", - "265", - "266", - "267", - "268", - "269", - "270", - "271", - "272", - "273", - "274", - "275", - "276", - "277", - "278", - "280", - "281", - "282", - "283", - "284", - "285", - "286", - "287", - "288", - "289", - "290", - "291", - "292", - "293", - "294", - "295", - "296", - "297", - "298", - "299", - "300", - "301", - "302", - "303", - "305", - "306", - "307", - "308", - "315", - "316", - "324", - "325", - "332", - "333", - "340", - "341", - "342", - "343", - "344", - "351", - "352", - "353", - "354", - "355", - "357", - "359", - "360", - "361", - "362", - "364", - "366", - "368", - "370", - "372", - "374", - "376", - "378", - "380", - "382", - "384", - "386", - "388", - "390", - "391", - "392", - "393", - "394", - "395", - "396", - "397", - "398", - "399", - "400", - "401", - "402", - "403", - "404", - "405", - "406", - "407", - "408", - "409", - "410", - "413", - "415", - "416", - "418", - "420", - "421", - "422", - "424", - "425", - "426", - "428", - "430", - "432", - "433", - "434", - "435", - "436", - "438", - "439", - "440", - "441", - "443", - "445", - "446", - "447", - "448", - "449", - "450", - "451", - "452", - "453", - "454", - "455", - "456", - "457", - "458", - "459", - "460", - "461", - "462", - "463", - "464", - "468", - "469", - "471", - "472", - "475", - "476", - "477", - "478", - "479", - "480", - "481", - "482", - "483", - "485", - "487", - "489", - "491", - "492", - "493", - "494", - "495", - "496", - "497", - "498", - "500", - "502", - "504", - "506", - "507", - "508", - "509", - "510", - "511", - "512", - "513", - "514", - "515", - "516", - "517", - "518", - "519", - "520", - "521", - "522", - "523", - "524", - "526", - "527", - "528", - "530", - "531", - "532", - "533", - "535", - "536", - "537", - "538", - "539", - "544", - "548", - "554", - "555", - "557", - "558", - "559", - "560", - "561", - "562", - "563", - "564", - "565", - "566", - "567", - "568", - "570", - "571", - "572", - "573", - "575", - "577", - "578", - "579", - "580", - "581", - "583", - "585", - "586", - "587", - "588", - "589", - "592", - "593", - "595", - "596", - "597", - "598", - "599", - "600", - "601", - "602", - "603", - "604", - "605", - "606", - "607", - "608", - "609", - "610", - "611" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_index_spgist.metadata.json b/parser/testdata/parse/postgres_regress/create_index_spgist.metadata.json index fd2f15d..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_index_spgist.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_index_spgist.metadata.json @@ -1,105 +1,3 @@ { - "todo": [ - "001", - "004", - "005", - "006", - "007", - "011", - "012", - "013", - "014", - "025", - "026", - "027", - "042", - "043", - "044", - "045", - "047", - "049", - "051", - "053", - "055", - "057", - "059", - "061", - "063", - "065", - "066", - "068", - "069", - "071", - "072", - "074", - "076", - "078", - "080", - "082", - "084", - "086", - "088", - "089", - "091", - "092", - "094", - "095", - "097", - "098", - "099", - "101", - "103", - "105", - "107", - "109", - "111", - "113", - "115", - "117", - "119", - "121", - "123", - "125", - "127", - "129", - "131", - "133", - "134", - "135", - "136", - "138", - "140", - "142", - "144", - "146", - "148", - "150", - "152", - "154", - "156", - "158", - "160", - "162", - "164", - "166", - "168", - "170", - "172", - "174", - "176", - "178", - "180", - "182", - "184", - "186", - "188", - "190", - "192", - "194", - "196", - "198", - "200", - "201", - "202" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_misc.metadata.json b/parser/testdata/parse/postgres_regress/create_misc.metadata.json index 6d5c740..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_misc.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_misc.metadata.json @@ -1,27 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "057", - "058", - "059", - "060", - "061", - "062", - "071", - "072", - "073", - "074", - "075", - "076", - "078", - "080", - "082", - "084", - "086" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_operator.metadata.json b/parser/testdata/parse/postgres_regress/create_operator.metadata.json index 4cc5552..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_operator.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_operator.metadata.json @@ -1,83 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "017", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_procedure.metadata.json b/parser/testdata/parse/postgres_regress/create_procedure.metadata.json index 3d81b6a..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_procedure.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_procedure.metadata.json @@ -1,105 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "008", - "009", - "010", - "012", - "013", - "015", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_role.metadata.json b/parser/testdata/parse/postgres_regress/create_role.metadata.json index 6835d4b..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_role.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_role.metadata.json @@ -1,141 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_schema.metadata.json b/parser/testdata/parse/postgres_regress/create_schema.metadata.json index 7249d3a..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_schema.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_schema.metadata.json @@ -1,31 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_table.metadata.json b/parser/testdata/parse/postgres_regress/create_table.metadata.json index b4bb322..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_table.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_table.metadata.json @@ -1,303 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "007", - "008", - "010", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "024", - "025", - "027", - "028", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "092", - "093", - "094", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "114", - "115", - "116", - "117", - "118", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179", - "180", - "181", - "182", - "183", - "184", - "185", - "186", - "187", - "188", - "189", - "191", - "192", - "193", - "194", - "195", - "196", - "197", - "198", - "199", - "200", - "201", - "202", - "203", - "204", - "205", - "207", - "208", - "209", - "210", - "211", - "212", - "213", - "214", - "215", - "216", - "217", - "218", - "219", - "220", - "221", - "222", - "223", - "224", - "225", - "226", - "227", - "229", - "230", - "232", - "234", - "235", - "236", - "238", - "239", - "240", - "241", - "242", - "244", - "245", - "246", - "247", - "248", - "249", - "250", - "251", - "252", - "253", - "254", - "255", - "256", - "257", - "258", - "259", - "260", - "261", - "262", - "263", - "264", - "265", - "266", - "267", - "268", - "269", - "272", - "273", - "274", - "275", - "276", - "277", - "278", - "280", - "281", - "282", - "283", - "284", - "285", - "286", - "287", - "288", - "289", - "290", - "291", - "292", - "293", - "294", - "295", - "296", - "297", - "298", - "300", - "301", - "302", - "303", - "304", - "307", - "308", - "309", - "310", - "311", - "312", - "313", - "315", - "316", - "317", - "318", - "319", - "320", - "321", - "322", - "323", - "324", - "325", - "326" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_table_like.metadata.json b/parser/testdata/parse/postgres_regress/create_table_like.metadata.json index e5aa037..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_table_like.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_table_like.metadata.json @@ -1,107 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "011", - "012", - "015", - "016", - "017", - "019", - "020", - "025", - "026", - "029", - "032", - "035", - "036", - "039", - "042", - "045", - "046", - "047", - "048", - "049", - "050", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "072", - "073", - "074", - "075", - "076", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "113", - "114", - "116", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_type.metadata.json b/parser/testdata/parse/postgres_regress/create_type.metadata.json index 9175d93..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_type.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_type.metadata.json @@ -1,67 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "062", - "063", - "065", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "083", - "084", - "085" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/create_view.metadata.json b/parser/testdata/parse/postgres_regress/create_view.metadata.json index 4ef138c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/create_view.metadata.json +++ b/parser/testdata/parse/postgres_regress/create_view.metadata.json @@ -1,208 +1,3 @@ { - "todo": [ - "001", - "002", - "004", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "018", - "019", - "021", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "076", - "077", - "078", - "079", - "080", - "081", - "083", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "104", - "106", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "151", - "152", - "158", - "164", - "165", - "171", - "177", - "178", - "179", - "181", - "183", - "185", - "187", - "188", - "191", - "192", - "193", - "194", - "196", - "198", - "200", - "201", - "202", - "203", - "207", - "208", - "209", - "210", - "212", - "213", - "214", - "216", - "218", - "219", - "220", - "221", - "223", - "225", - "227", - "228", - "229", - "232", - "233", - "235", - "237", - "240", - "241", - "242", - "244", - "248", - "249", - "250", - "253", - "255", - "257", - "258", - "262", - "266", - "270", - "271", - "272", - "274", - "278", - "280", - "282", - "284", - "286", - "288", - "291", - "293", - "295", - "296", - "297", - "299", - "300", - "301", - "305", - "306", - "307" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/database.metadata.json b/parser/testdata/parse/postgres_regress/database.metadata.json index 5741e52..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/database.metadata.json +++ b/parser/testdata/parse/postgres_regress/database.metadata.json @@ -1,19 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/date.metadata.json b/parser/testdata/parse/postgres_regress/date.metadata.json index 22d9859..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/date.metadata.json +++ b/parser/testdata/parse/postgres_regress/date.metadata.json @@ -1,10 +1,3 @@ { - "todo": [ - "001", - "022", - "023", - "068", - "113", - "167" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/delete.metadata.json b/parser/testdata/parse/postgres_regress/delete.metadata.json index b7e3a9e..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/delete.metadata.json +++ b/parser/testdata/parse/postgres_regress/delete.metadata.json @@ -1,6 +1,3 @@ { - "todo": [ - "001", - "010" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/dependency.metadata.json b/parser/testdata/parse/postgres_regress/dependency.metadata.json index cfdb638..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/dependency.metadata.json +++ b/parser/testdata/parse/postgres_regress/dependency.metadata.json @@ -1,64 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "053", - "054", - "056", - "057", - "058", - "059", - "060", - "061", - "062" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/domain.metadata.json b/parser/testdata/parse/postgres_regress/domain.metadata.json index bdf8a2a..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/domain.metadata.json +++ b/parser/testdata/parse/postgres_regress/domain.metadata.json @@ -1,173 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "013", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "038", - "039", - "040", - "041", - "042", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "075", - "077", - "079", - "084", - "085", - "086", - "088", - "090", - "092", - "094", - "097", - "100", - "102", - "103", - "106", - "109", - "112", - "113", - "114", - "117", - "118", - "119", - "123", - "126", - "127", - "128", - "129", - "131", - "133", - "135", - "137", - "140", - "142", - "143", - "144", - "145", - "147", - "148", - "149", - "151", - "152", - "153", - "154", - "158", - "160", - "162", - "164", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "181", - "188", - "189", - "190", - "191", - "194", - "195", - "196", - "197", - "202", - "204", - "206", - "212", - "213", - "214", - "216", - "217", - "218", - "220", - "221", - "222", - "223", - "225", - "226", - "227", - "228", - "229", - "231", - "232", - "233", - "234", - "235", - "237", - "238", - "239", - "240", - "241", - "242", - "246", - "247", - "248", - "249", - "250", - "251", - "254", - "255", - "258", - "259", - "262", - "263", - "266", - "272", - "275", - "276", - "277", - "279", - "281", - "283", - "285", - "287", - "289", - "290", - "291", - "292", - "295", - "299", - "300", - "301", - "302", - "303", - "304", - "305", - "306", - "307", - "308", - "309", - "310", - "311", - "315" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/drop_if_exists.metadata.json b/parser/testdata/parse/postgres_regress/drop_if_exists.metadata.json index 3b3c7f2..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/drop_if_exists.metadata.json +++ b/parser/testdata/parse/postgres_regress/drop_if_exists.metadata.json @@ -1,165 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/drop_operator.metadata.json b/parser/testdata/parse/postgres_regress/drop_operator.metadata.json index b932793..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/drop_operator.metadata.json +++ b/parser/testdata/parse/postgres_regress/drop_operator.metadata.json @@ -1,12 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "006", - "007", - "008", - "009", - "012" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/enum.metadata.json b/parser/testdata/parse/postgres_regress/enum.metadata.json index 4e66b7b..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/enum.metadata.json +++ b/parser/testdata/parse/postgres_regress/enum.metadata.json @@ -1,100 +1,3 @@ { - "todo": [ - "001", - "009", - "011", - "013", - "014", - "015", - "016", - "019", - "020", - "021", - "022", - "024", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "058", - "073", - "074", - "075", - "085", - "086", - "088", - "089", - "090", - "091", - "095", - "109", - "111", - "113", - "115", - "116", - "117", - "122", - "123", - "124", - "125", - "127", - "128", - "129", - "130", - "131", - "132", - "134", - "137", - "139", - "140", - "143", - "144", - "145", - "147", - "148", - "149", - "151", - "152", - "153", - "154", - "155", - "157", - "158", - "159", - "160", - "161", - "162", - "164", - "165", - "166", - "167", - "168" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/equivclass.metadata.json b/parser/testdata/parse/postgres_regress/equivclass.metadata.json index 364fcc5..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/equivclass.metadata.json +++ b/parser/testdata/parse/postgres_regress/equivclass.metadata.json @@ -1,83 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/errors.metadata.json b/parser/testdata/parse/postgres_regress/errors.metadata.json index f71830c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/errors.metadata.json +++ b/parser/testdata/parse/postgres_regress/errors.metadata.json @@ -1,64 +1,3 @@ { - "todo": [ - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "073", - "074", - "075", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/event_trigger.metadata.json b/parser/testdata/parse/postgres_regress/event_trigger.metadata.json index 4bca649..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/event_trigger.metadata.json +++ b/parser/testdata/parse/postgres_regress/event_trigger.metadata.json @@ -1,224 +1,3 @@ { - "todo": [ - "001", - "002", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "086", - "088", - "090", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "129", - "130", - "131", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179", - "180", - "181", - "182", - "183", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "195", - "196", - "197", - "198", - "199", - "200", - "201", - "202", - "203", - "204", - "205", - "206", - "207", - "208", - "209", - "210", - "211", - "212", - "213", - "214", - "215", - "216", - "217", - "218", - "220", - "221", - "222", - "223", - "224", - "225", - "226", - "227", - "228", - "229", - "230" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/event_trigger_login.metadata.json b/parser/testdata/parse/postgres_regress/event_trigger_login.metadata.json index 8b00fe0..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/event_trigger_login.metadata.json +++ b/parser/testdata/parse/postgres_regress/event_trigger_login.metadata.json @@ -1,12 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "009", - "010", - "011" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/explain.metadata.json b/parser/testdata/parse/postgres_regress/explain.metadata.json index 83150dd..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/explain.metadata.json +++ b/parser/testdata/parse/postgres_regress/explain.metadata.json @@ -1,28 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "013", - "015", - "016", - "017", - "020", - "029", - "030", - "031", - "032", - "033", - "035", - "036", - "037", - "038", - "039", - "040", - "042", - "043", - "044", - "046" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/expressions.metadata.json b/parser/testdata/parse/postgres_regress/expressions.metadata.json index ded3915..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/expressions.metadata.json +++ b/parser/testdata/parse/postgres_regress/expressions.metadata.json @@ -1,36 +1,3 @@ { - "todo": [ - "015", - "017", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "031", - "032", - "033", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "071" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/fast_default.metadata.json b/parser/testdata/parse/postgres_regress/fast_default.metadata.json index 306dbf3..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/fast_default.metadata.json +++ b/parser/testdata/parse/postgres_regress/fast_default.metadata.json @@ -1,164 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "017", - "019", - "021", - "023", - "025", - "027", - "029", - "031", - "033", - "035", - "037", - "039", - "041", - "045", - "046", - "047", - "050", - "052", - "054", - "056", - "058", - "060", - "062", - "066", - "067", - "068", - "069", - "070", - "071", - "073", - "075", - "076", - "078", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "090", - "092", - "094", - "095", - "097", - "098", - "099", - "102", - "104", - "107", - "109", - "113", - "115", - "117", - "121", - "122", - "125", - "127", - "129", - "132", - "135", - "136", - "138", - "139", - "140", - "142", - "143", - "144", - "148", - "149", - "151", - "152", - "153", - "157", - "158", - "160", - "161", - "162", - "166", - "167", - "169", - "170", - "171", - "175", - "176", - "178", - "179", - "180", - "184", - "185", - "187", - "188", - "189", - "193", - "194", - "196", - "197", - "198", - "202", - "203", - "205", - "206", - "207", - "211", - "212", - "213", - "215", - "216", - "218", - "220", - "221", - "223", - "225", - "227", - "228", - "230", - "232", - "233", - "235", - "236", - "238", - "240", - "242", - "243", - "244", - "245", - "246", - "247", - "249", - "250", - "251", - "252", - "253", - "254", - "255", - "256", - "257", - "258", - "259", - "260", - "261", - "262", - "263", - "264", - "265", - "266", - "268" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/float4.metadata.json b/parser/testdata/parse/postgres_regress/float4.metadata.json index 2e39566..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/float4.metadata.json +++ b/parser/testdata/parse/postgres_regress/float4.metadata.json @@ -1,14 +1,3 @@ { - "todo": [ - "001", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "100" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/float8.metadata.json b/parser/testdata/parse/postgres_regress/float8.metadata.json index c2c1ff6..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/float8.metadata.json +++ b/parser/testdata/parse/postgres_regress/float8.metadata.json @@ -1,18 +1,3 @@ { - "todo": [ - "001", - "057", - "132", - "134", - "139", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "169" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/foreign_data.metadata.json b/parser/testdata/parse/postgres_regress/foreign_data.metadata.json index feded6b..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/foreign_data.metadata.json +++ b/parser/testdata/parse/postgres_regress/foreign_data.metadata.json @@ -1,497 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179", - "180", - "181", - "182", - "183", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "195", - "196", - "197", - "198", - "199", - "200", - "201", - "202", - "203", - "204", - "205", - "206", - "207", - "208", - "209", - "210", - "212", - "213", - "214", - "215", - "216", - "217", - "218", - "219", - "220", - "221", - "222", - "223", - "224", - "225", - "226", - "227", - "228", - "229", - "230", - "231", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "248", - "249", - "250", - "251", - "252", - "253", - "254", - "255", - "256", - "257", - "258", - "259", - "260", - "261", - "262", - "263", - "264", - "265", - "266", - "267", - "268", - "269", - "270", - "271", - "272", - "273", - "274", - "275", - "276", - "277", - "278", - "279", - "280", - "281", - "282", - "283", - "284", - "285", - "286", - "287", - "288", - "289", - "290", - "291", - "292", - "293", - "294", - "295", - "296", - "297", - "298", - "299", - "300", - "301", - "302", - "303", - "304", - "305", - "306", - "307", - "308", - "309", - "310", - "311", - "312", - "313", - "324", - "328", - "329", - "331", - "338", - "346", - "348", - "349", - "350", - "351", - "352", - "353", - "354", - "355", - "356", - "357", - "358", - "359", - "360", - "361", - "362", - "363", - "364", - "365", - "366", - "367", - "368", - "369", - "370", - "371", - "372", - "373", - "374", - "375", - "376", - "377", - "378", - "379", - "380", - "381", - "382", - "383", - "384", - "385", - "386", - "387", - "388", - "389", - "390", - "391", - "392", - "393", - "394", - "395", - "396", - "397", - "398", - "399", - "400", - "401", - "402", - "403", - "404", - "405", - "406", - "407", - "408", - "409", - "410", - "411", - "412", - "413", - "414", - "415", - "416", - "417", - "418", - "419", - "420", - "421", - "422", - "423", - "424", - "425", - "426", - "427", - "428", - "429", - "430", - "431", - "432", - "433", - "434", - "435", - "436", - "437", - "438", - "439", - "440", - "441", - "442", - "443", - "444", - "445", - "446", - "447", - "448", - "449", - "450", - "451", - "452", - "453", - "454", - "455", - "457", - "458", - "459", - "460", - "461", - "462", - "463", - "464", - "466", - "467", - "468", - "469", - "470", - "471", - "472", - "473", - "474", - "475", - "476", - "477", - "478", - "479", - "480", - "481", - "482", - "483", - "484", - "485", - "486", - "487", - "488", - "489", - "490", - "491", - "492", - "493", - "494", - "495", - "496", - "497", - "498", - "499", - "500", - "501", - "502", - "503", - "504", - "505", - "506", - "507", - "508", - "509", - "510", - "511", - "512", - "513", - "514", - "515", - "516", - "517", - "518", - "519", - "520", - "521", - "522", - "523", - "524", - "525", - "526", - "527" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/foreign_key.metadata.json b/parser/testdata/parse/postgres_regress/foreign_key.metadata.json index 2acf27c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/foreign_key.metadata.json +++ b/parser/testdata/parse/postgres_regress/foreign_key.metadata.json @@ -1,631 +1,3 @@ { - "todo": [ - "001", - "002", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "049", - "050", - "053", - "054", - "055", - "056", - "080", - "081", - "082", - "083", - "084", - "1000", - "1005", - "1006", - "1008", - "1009", - "1010", - "1011", - "1012", - "1013", - "1018", - "1019", - "1020", - "1021", - "1022", - "1023", - "1024", - "1026", - "1028", - "1029", - "103", - "1030", - "1031", - "1037", - "1038", - "104", - "1043", - "1047", - "1048", - "105", - "1052", - "1053", - "1058", - "1059", - "106", - "1064", - "1065", - "1067", - "1069", - "1072", - "1074", - "1075", - "1076", - "1077", - "1078", - "1079", - "1080", - "1081", - "109", - "1090", - "1092", - "1099", - "110", - "1100", - "1103", - "1104", - "1105", - "1106", - "1107", - "1108", - "1109", - "111", - "1110", - "1113", - "1114", - "1115", - "1116", - "1117", - "1118", - "112", - "1120", - "1121", - "1124", - "1125", - "1128", - "1129", - "113", - "1131", - "1132", - "1133", - "1134", - "1135", - "1136", - "1137", - "1138", - "1139", - "1140", - "1141", - "1142", - "1143", - "1144", - "1145", - "1153", - "1154", - "131", - "132", - "133", - "134", - "142", - "143", - "144", - "145", - "167", - "168", - "169", - "170", - "193", - "194", - "195", - "196", - "223", - "224", - "225", - "226", - "227", - "228", - "229", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "249", - "250", - "251", - "256", - "257", - "258", - "259", - "261", - "266", - "267", - "268", - "269", - "270", - "271", - "272", - "273", - "274", - "275", - "276", - "277", - "278", - "279", - "280", - "281", - "282", - "283", - "284", - "285", - "286", - "287", - "288", - "298", - "300", - "310", - "311", - "312", - "313", - "314", - "324", - "325", - "326", - "327", - "328", - "329", - "330", - "331", - "332", - "333", - "334", - "335", - "336", - "337", - "338", - "339", - "340", - "341", - "342", - "343", - "345", - "346", - "349", - "350", - "351", - "352", - "353", - "356", - "357", - "358", - "360", - "361", - "362", - "363", - "364", - "365", - "367", - "369", - "370", - "371", - "372", - "373", - "375", - "376", - "377", - "378", - "379", - "380", - "381", - "382", - "383", - "384", - "385", - "386", - "387", - "388", - "389", - "390", - "391", - "392", - "393", - "395", - "398", - "399", - "401", - "403", - "404", - "405", - "407", - "409", - "410", - "412", - "414", - "415", - "417", - "418", - "420", - "421", - "423", - "424", - "425", - "426", - "427", - "428", - "432", - "441", - "446", - "447", - "449", - "454", - "455", - "456", - "463", - "467", - "468", - "476", - "477", - "478", - "485", - "486", - "487", - "488", - "489", - "491", - "492", - "497", - "498", - "499", - "500", - "502", - "503", - "504", - "506", - "508", - "510", - "511", - "512", - "514", - "516", - "517", - "518", - "520", - "521", - "522", - "524", - "525", - "526", - "527", - "528", - "536", - "537", - "538", - "539", - "540", - "541", - "542", - "543", - "544", - "545", - "546", - "547", - "548", - "549", - "550", - "551", - "552", - "553", - "554", - "574", - "575", - "576", - "577", - "578", - "581", - "583", - "584", - "585", - "586", - "587", - "588", - "589", - "590", - "598", - "599", - "601", - "602", - "603", - "605", - "613", - "614", - "621", - "622", - "623", - "626", - "627", - "628", - "629", - "636", - "637", - "638", - "644", - "645", - "646", - "647", - "648", - "649", - "650", - "651", - "652", - "653", - "654", - "655", - "656", - "657", - "658", - "659", - "660", - "661", - "662", - "663", - "664", - "665", - "666", - "667", - "668", - "669", - "670", - "671", - "672", - "673", - "675", - "677", - "678", - "679", - "680", - "681", - "682", - "683", - "684", - "685", - "686", - "687", - "688", - "689", - "690", - "691", - "693", - "694", - "696", - "697", - "698", - "699", - "700", - "701", - "702", - "703", - "704", - "705", - "706", - "707", - "708", - "709", - "710", - "716", - "719", - "722", - "723", - "724", - "725", - "726", - "727", - "729", - "730", - "731", - "732", - "733", - "734", - "735", - "736", - "737", - "738", - "739", - "740", - "741", - "746", - "747", - "750", - "751", - "752", - "753", - "754", - "755", - "756", - "757", - "758", - "759", - "762", - "763", - "764", - "767", - "768", - "769", - "770", - "771", - "772", - "773", - "774", - "775", - "776", - "777", - "778", - "779", - "780", - "781", - "782", - "783", - "784", - "785", - "786", - "787", - "788", - "789", - "790", - "791", - "825", - "826", - "827", - "828", - "829", - "830", - "831", - "832", - "833", - "834", - "835", - "836", - "837", - "839", - "841", - "842", - "843", - "844", - "845", - "846", - "847", - "848", - "849", - "850", - "852", - "853", - "854", - "855", - "856", - "857", - "858", - "859", - "860", - "861", - "862", - "863", - "864", - "865", - "866", - "867", - "868", - "869", - "870", - "871", - "872", - "873", - "874", - "875", - "876", - "878", - "880", - "881", - "882", - "883", - "884", - "885", - "886", - "887", - "889", - "890", - "892", - "893", - "894", - "897", - "898", - "899", - "902", - "903", - "904", - "905", - "906", - "907", - "908", - "911", - "914", - "915", - "916", - "917", - "918", - "919", - "920", - "921", - "922", - "925", - "926", - "927", - "930", - "931", - "932", - "933", - "934", - "935", - "936", - "937", - "940", - "943", - "944", - "945", - "946", - "947", - "948", - "949", - "950", - "951", - "952", - "955", - "958", - "959", - "960", - "961", - "962", - "963", - "964", - "965", - "966", - "967", - "968", - "969", - "970", - "971", - "972", - "979", - "980", - "982", - "983", - "984", - "985", - "986", - "987", - "992", - "993", - "995", - "996", - "997", - "998", - "999" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/functional_deps.metadata.json b/parser/testdata/parse/postgres_regress/functional_deps.metadata.json index 641220a..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/functional_deps.metadata.json +++ b/parser/testdata/parse/postgres_regress/functional_deps.metadata.json @@ -1,26 +1,3 @@ { - "todo": [ - "001", - "002", - "013", - "014", - "017", - "019", - "020", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "039" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/generated.metadata.json b/parser/testdata/parse/postgres_regress/generated.metadata.json index 973316e..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/generated.metadata.json +++ b/parser/testdata/parse/postgres_regress/generated.metadata.json @@ -1,59 +1,3 @@ { - "todo": [ - "002", - "003", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "039", - "042", - "048", - "052", - "053", - "061", - "066", - "068", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "102", - "103", - "108", - "113" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/geometry.metadata.json b/parser/testdata/parse/postgres_regress/geometry.metadata.json index 8ab1b78..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/geometry.metadata.json +++ b/parser/testdata/parse/postgres_regress/geometry.metadata.json @@ -1,9 +1,3 @@ { - "todo": [ - "001", - "151", - "153", - "155", - "157" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/gin.metadata.json b/parser/testdata/parse/postgres_regress/gin.metadata.json index 73da878..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/gin.metadata.json +++ b/parser/testdata/parse/postgres_regress/gin.metadata.json @@ -1,37 +1,3 @@ { - "todo": [ - "001", - "002", - "007", - "010", - "011", - "015", - "016", - "018", - "019", - "021", - "022", - "023", - "025", - "026", - "029", - "031", - "032", - "033", - "035", - "036", - "039", - "040", - "041", - "042", - "044", - "046", - "049", - "053", - "054", - "055", - "056", - "057", - "059" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/gist.metadata.json b/parser/testdata/parse/postgres_regress/gist.metadata.json index c8772f4..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/gist.metadata.json +++ b/parser/testdata/parse/postgres_regress/gist.metadata.json @@ -1,48 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "014", - "015", - "016", - "017", - "019", - "020", - "021", - "022", - "023", - "024", - "026", - "028", - "030", - "032", - "033", - "034", - "036", - "038", - "040", - "041", - "042", - "044", - "045", - "046", - "048", - "050", - "052", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "062" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/groupingsets.metadata.json b/parser/testdata/parse/postgres_regress/groupingsets.metadata.json index e4385ee..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/groupingsets.metadata.json +++ b/parser/testdata/parse/postgres_regress/groupingsets.metadata.json @@ -1,74 +1,3 @@ { - "todo": [ - "001", - "002", - "004", - "006", - "007", - "009", - "010", - "011", - "037", - "043", - "045", - "047", - "051", - "052", - "065", - "071", - "073", - "084", - "088", - "090", - "091", - "094", - "096", - "098", - "101", - "103", - "105", - "107", - "109", - "111", - "113", - "115", - "116", - "117", - "118", - "120", - "121", - "123", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "137", - "138", - "139", - "142", - "143", - "145", - "146", - "147", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "163", - "164", - "169", - "171" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/guc.metadata.json b/parser/testdata/parse/postgres_regress/guc.metadata.json index 3370404..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/guc.metadata.json +++ b/parser/testdata/parse/postgres_regress/guc.metadata.json @@ -1,152 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "007", - "008", - "009", - "010", - "012", - "013", - "014", - "015", - "016", - "018", - "019", - "020", - "022", - "023", - "024", - "025", - "026", - "028", - "029", - "030", - "032", - "033", - "034", - "035", - "037", - "038", - "039", - "040", - "041", - "043", - "044", - "046", - "047", - "048", - "049", - "051", - "052", - "053", - "054", - "055", - "057", - "058", - "059", - "061", - "062", - "063", - "065", - "066", - "067", - "069", - "070", - "071", - "073", - "074", - "075", - "076", - "077", - "079", - "080", - "081", - "083", - "084", - "085", - "087", - "088", - "089", - "091", - "092", - "093", - "094", - "095", - "097", - "098", - "099", - "101", - "102", - "103", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "113", - "114", - "115", - "117", - "118", - "120", - "121", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "143", - "147", - "148", - "149", - "150", - "151", - "155", - "158", - "162", - "165", - "166", - "168", - "170", - "172", - "173", - "174", - "176", - "178", - "180", - "182", - "184", - "185", - "187", - "188", - "195", - "199", - "200", - "201", - "203", - "204", - "205", - "208", - "214" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/hash_func.metadata.json b/parser/testdata/parse/postgres_regress/hash_func.metadata.json index c1cac8f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/hash_func.metadata.json +++ b/parser/testdata/parse/postgres_regress/hash_func.metadata.json @@ -1,10 +1,3 @@ { - "todo": [ - "026", - "028", - "032", - "034", - "035", - "038" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/hash_index.metadata.json b/parser/testdata/parse/postgres_regress/hash_index.metadata.json index 76c5d2c2..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/hash_index.metadata.json +++ b/parser/testdata/parse/postgres_regress/hash_index.metadata.json @@ -1,54 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "044", - "046", - "048", - "049", - "050", - "056", - "059", - "060", - "061", - "062", - "063", - "064", - "066", - "068", - "069", - "070", - "071", - "073", - "075", - "077", - "078", - "079", - "081", - "083", - "085", - "086", - "087", - "088", - "090", - "091", - "092", - "094", - "095", - "096", - "097" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/hash_part.metadata.json b/parser/testdata/parse/postgres_regress/hash_part.metadata.json index f585d02..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/hash_part.metadata.json +++ b/parser/testdata/parse/postgres_regress/hash_part.metadata.json @@ -1,13 +1,3 @@ { - "todo": [ - "001", - "002", - "017", - "022", - "023", - "024", - "026", - "027", - "028" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/horology.metadata.json b/parser/testdata/parse/postgres_regress/horology.metadata.json index badbb72..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/horology.metadata.json +++ b/parser/testdata/parse/postgres_regress/horology.metadata.json @@ -1,38 +1,3 @@ { - "todo": [ - "001", - "002", - "018", - "020", - "033", - "036", - "076", - "147", - "152", - "193", - "201", - "209", - "215", - "216", - "218", - "220", - "222", - "224", - "225", - "227", - "229", - "230", - "232", - "233", - "237", - "238", - "240", - "241", - "243", - "378", - "379", - "380", - "386", - "388" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/identity.metadata.json b/parser/testdata/parse/postgres_regress/identity.metadata.json index 0ab7666..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/identity.metadata.json +++ b/parser/testdata/parse/postgres_regress/identity.metadata.json @@ -1,141 +1,3 @@ { - "todo": [ - "002", - "003", - "004", - "005", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "033", - "051", - "069", - "073", - "074", - "075", - "077", - "081", - "082", - "083", - "084", - "097", - "098", - "099", - "101", - "103", - "104", - "105", - "106", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "119", - "124", - "125", - "126", - "129", - "130", - "131", - "134", - "135", - "136", - "137", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "159", - "161", - "162", - "163", - "164", - "165", - "166", - "169", - "171", - "172", - "173", - "176", - "180", - "183", - "184", - "185", - "188", - "194", - "195", - "196", - "197", - "203", - "209", - "210", - "211", - "214", - "215", - "216", - "217", - "218", - "219", - "223", - "224", - "225", - "231", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "248", - "249", - "250", - "251", - "252", - "253", - "254", - "255", - "264", - "265", - "266", - "267", - "268", - "269" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/incremental_sort.metadata.json b/parser/testdata/parse/postgres_regress/incremental_sort.metadata.json index b6e4b5d..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/incremental_sort.metadata.json +++ b/parser/testdata/parse/postgres_regress/incremental_sort.metadata.json @@ -1,87 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "011", - "012", - "014", - "016", - "018", - "020", - "024", - "025", - "032", - "033", - "035", - "037", - "038", - "039", - "040", - "041", - "042", - "044", - "050", - "051", - "053", - "055", - "057", - "059", - "063", - "064", - "066", - "068", - "070", - "072", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/index_including.metadata.json b/parser/testdata/parse/postgres_regress/index_including.metadata.json index ed15e77..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/index_including.metadata.json +++ b/parser/testdata/parse/postgres_regress/index_including.metadata.json @@ -1,85 +1,3 @@ { - "todo": [ - "001", - "003", - "004", - "006", - "008", - "009", - "010", - "012", - "014", - "015", - "016", - "018", - "020", - "022", - "023", - "025", - "027", - "028", - "032", - "033", - "039", - "041", - "042", - "044", - "045", - "046", - "050", - "051", - "057", - "058", - "063", - "064", - "065", - "067", - "069", - "070", - "071", - "073", - "075", - "076", - "078", - "080", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "092", - "094", - "095", - "097", - "099", - "101", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "115", - "121", - "122", - "124", - "125", - "126", - "127", - "128", - "130", - "131", - "132", - "134", - "135" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/index_including_gist.metadata.json b/parser/testdata/parse/postgres_regress/index_including_gist.metadata.json index 4c3660c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/index_including_gist.metadata.json +++ b/parser/testdata/parse/postgres_regress/index_including_gist.metadata.json @@ -1,35 +1,3 @@ { - "todo": [ - "001", - "003", - "006", - "007", - "008", - "009", - "010", - "011", - "015", - "016", - "017", - "018", - "019", - "021", - "023", - "024", - "026", - "028", - "030", - "032", - "033", - "035", - "039", - "040", - "042", - "043", - "044", - "045", - "046", - "049", - "050" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/indexing.metadata.json b/parser/testdata/parse/postgres_regress/indexing.metadata.json index a081d9a..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/indexing.metadata.json +++ b/parser/testdata/parse/postgres_regress/indexing.metadata.json @@ -1,500 +1,3 @@ { - "todo": [ - "001", - "002", - "005", - "006", - "007", - "008", - "009", - "011", - "012", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "023", - "024", - "025", - "026", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "040", - "041", - "042", - "043", - "044", - "045", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "055", - "056", - "058", - "059", - "060", - "061", - "062", - "063", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "104", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "115", - "117", - "119", - "121", - "122", - "123", - "124", - "125", - "126", - "128", - "130", - "131", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "143", - "144", - "145", - "146", - "147", - "148", - "150", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "161", - "162", - "163", - "164", - "166", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179", - "180", - "181", - "182", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "195", - "197", - "198", - "199", - "200", - "201", - "202", - "203", - "204", - "205", - "206", - "208", - "209", - "210", - "211", - "212", - "213", - "214", - "215", - "216", - "217", - "218", - "219", - "220", - "221", - "222", - "223", - "224", - "225", - "226", - "227", - "228", - "230", - "231", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "248", - "249", - "250", - "251", - "252", - "254", - "255", - "256", - "257", - "258", - "259", - "260", - "261", - "262", - "263", - "264", - "266", - "267", - "268", - "269", - "270", - "271", - "272", - "273", - "274", - "276", - "277", - "278", - "279", - "280", - "281", - "282", - "283", - "284", - "286", - "287", - "288", - "289", - "290", - "291", - "292", - "293", - "294", - "295", - "296", - "297", - "298", - "299", - "300", - "301", - "302", - "303", - "304", - "305", - "306", - "307", - "308", - "309", - "310", - "311", - "312", - "313", - "314", - "315", - "316", - "317", - "318", - "319", - "320", - "321", - "322", - "323", - "324", - "325", - "326", - "327", - "328", - "329", - "330", - "331", - "332", - "333", - "334", - "335", - "336", - "337", - "338", - "339", - "340", - "341", - "342", - "343", - "344", - "345", - "346", - "347", - "348", - "349", - "350", - "351", - "352", - "353", - "355", - "356", - "357", - "358", - "359", - "360", - "361", - "362", - "363", - "364", - "365", - "367", - "368", - "369", - "370", - "371", - "372", - "374", - "375", - "376", - "377", - "378", - "380", - "381", - "382", - "383", - "384", - "385", - "386", - "387", - "388", - "389", - "390", - "391", - "392", - "393", - "394", - "395", - "396", - "398", - "400", - "401", - "402", - "403", - "404", - "405", - "406", - "407", - "408", - "409", - "410", - "411", - "412", - "413", - "414", - "415", - "417", - "418", - "419", - "420", - "421", - "422", - "423", - "424", - "425", - "426", - "427", - "429", - "430", - "431", - "440", - "441", - "442", - "443", - "444", - "445", - "446", - "447", - "448", - "449", - "450", - "451", - "452", - "453", - "454", - "455", - "456", - "457", - "458", - "459", - "460", - "461", - "462", - "463", - "464", - "465", - "466", - "467", - "468", - "469", - "470", - "471", - "472", - "473", - "474", - "475", - "476", - "477", - "478", - "479", - "480", - "481", - "482", - "483", - "484", - "485", - "486", - "487", - "488", - "489", - "490", - "493", - "494", - "495", - "498", - "499", - "500", - "501", - "504", - "505", - "506", - "507", - "508", - "509", - "510", - "511", - "512", - "513", - "514", - "515", - "516", - "517", - "518", - "519", - "520", - "521", - "522", - "523", - "524", - "525", - "526", - "527", - "528", - "529", - "530", - "531", - "532", - "534", - "535", - "536", - "537", - "538", - "539", - "541", - "542", - "544", - "545", - "546", - "547", - "548", - "549", - "550", - "551", - "552", - "554", - "556", - "557", - "558", - "560" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/indirect_toast.metadata.json b/parser/testdata/parse/postgres_regress/indirect_toast.metadata.json index 0eab3e4..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/indirect_toast.metadata.json +++ b/parser/testdata/parse/postgres_regress/indirect_toast.metadata.json @@ -1,14 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "014", - "016", - "017", - "024", - "026", - "027", - "028" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/inet.metadata.json b/parser/testdata/parse/postgres_regress/inet.metadata.json index 70342f0..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/inet.metadata.json +++ b/parser/testdata/parse/postgres_regress/inet.metadata.json @@ -1,24 +1,3 @@ { - "todo": [ - "001", - "002", - "036", - "037", - "038", - "040", - "042", - "044", - "046", - "047", - "048", - "049", - "061", - "063", - "064", - "065", - "066", - "078", - "080", - "081" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/infinite_recurse.metadata.json b/parser/testdata/parse/postgres_regress/infinite_recurse.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/infinite_recurse.metadata.json +++ b/parser/testdata/parse/postgres_regress/infinite_recurse.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/inherit.metadata.json b/parser/testdata/parse/postgres_regress/inherit.metadata.json index 3a1d18a..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/inherit.metadata.json +++ b/parser/testdata/parse/postgres_regress/inherit.metadata.json @@ -1,464 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "078", - "080", - "081", - "083", - "084", - "085", - "086", - "088", - "089", - "090", - "091", - "093", - "095", - "098", - "099", - "100", - "101", - "102", - "119", - "121", - "123", - "124", - "125", - "126", - "130", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "145", - "146", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "155", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "166", - "167", - "168", - "169", - "170", - "171", - "175", - "176", - "177", - "178", - "179", - "180", - "181", - "182", - "183", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "196", - "197", - "199", - "203", - "204", - "206", - "207", - "209", - "211", - "213", - "214", - "215", - "216", - "218", - "219", - "220", - "221", - "222", - "224", - "226", - "227", - "228", - "229", - "230", - "231", - "233", - "234", - "237", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "248", - "249", - "250", - "251", - "252", - "253", - "254", - "255", - "256", - "257", - "258", - "259", - "260", - "261", - "262", - "263", - "264", - "265", - "266", - "267", - "268", - "269", - "271", - "272", - "273", - "274", - "275", - "276", - "277", - "278", - "279", - "280", - "281", - "282", - "283", - "284", - "285", - "286", - "287", - "288", - "289", - "291", - "293", - "298", - "299", - "300", - "301", - "302", - "303", - "304", - "306", - "307", - "308", - "309", - "310", - "311", - "312", - "313", - "314", - "315", - "316", - "317", - "318", - "319", - "320", - "321", - "322", - "323", - "324", - "325", - "326", - "327", - "328", - "329", - "330", - "331", - "332", - "333", - "334", - "335", - "336", - "337", - "338", - "340", - "341", - "345", - "346", - "348", - "350", - "351", - "352", - "353", - "354", - "355", - "356", - "358", - "359", - "361", - "362", - "363", - "364", - "365", - "366", - "367", - "368", - "375", - "376", - "378", - "380", - "381", - "382", - "383", - "385", - "387", - "388", - "389", - "391", - "392", - "393", - "394", - "395", - "396", - "397", - "398", - "399", - "400", - "401", - "404", - "405", - "406", - "407", - "408", - "409", - "410", - "411", - "412", - "413", - "414", - "415", - "416", - "417", - "419", - "420", - "421", - "422", - "423", - "424", - "427", - "430", - "431", - "432", - "433", - "434", - "435", - "437", - "442", - "443", - "444", - "450", - "451", - "452", - "453", - "454", - "455", - "456", - "457", - "458", - "459", - "460", - "461", - "462", - "463", - "464", - "465", - "466", - "467", - "468", - "469", - "470", - "471", - "478", - "479", - "480", - "481", - "482", - "483", - "484", - "485", - "486", - "487", - "488", - "489", - "490", - "491", - "492", - "493", - "494", - "495", - "496", - "497", - "498", - "499", - "500", - "501", - "502", - "503", - "504", - "505", - "506", - "507", - "508", - "509", - "510", - "511", - "512", - "513", - "514", - "515", - "516", - "517", - "518", - "519", - "520", - "521", - "522", - "523", - "524", - "525", - "526", - "527", - "528", - "529", - "530", - "531", - "533", - "535", - "536", - "537", - "538", - "539", - "540", - "541", - "542", - "543", - "544", - "545", - "546", - "547", - "548", - "549", - "550", - "551", - "552", - "553", - "554", - "555", - "556", - "557", - "558", - "559", - "560", - "561", - "562", - "563", - "564", - "565", - "566", - "567", - "568", - "569", - "570", - "571", - "572", - "573", - "574", - "575", - "576", - "577", - "578", - "579", - "580", - "581", - "582", - "583", - "584", - "585", - "586", - "587", - "588", - "589", - "590", - "591", - "592", - "593", - "594", - "595", - "596", - "597", - "598", - "599", - "600", - "601", - "602", - "603", - "604", - "605", - "606", - "607", - "608", - "609", - "610", - "611", - "612", - "614", - "615", - "616", - "617", - "618", - "619", - "620", - "621", - "622", - "623", - "624", - "625", - "626", - "627", - "628", - "629", - "630", - "631", - "632", - "633", - "634", - "635", - "636", - "637", - "638", - "639", - "652", - "656", - "660", - "664", - "668", - "672", - "677" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/init_privs.metadata.json b/parser/testdata/parse/postgres_regress/init_privs.metadata.json index d151fe5..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/init_privs.metadata.json +++ b/parser/testdata/parse/postgres_regress/init_privs.metadata.json @@ -1,7 +1,3 @@ { - "todo": [ - "002", - "003", - "004" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/insert.metadata.json b/parser/testdata/parse/postgres_regress/insert.metadata.json index ff299cd..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/insert.metadata.json +++ b/parser/testdata/parse/postgres_regress/insert.metadata.json @@ -1,204 +1,3 @@ { - "todo": [ - "001", - "017", - "018", - "019", - "025", - "026", - "027", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "089", - "092", - "093", - "094", - "095", - "096", - "098", - "099", - "100", - "101", - "110", - "111", - "112", - "113", - "119", - "120", - "121", - "122", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "152", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "181", - "182", - "183", - "184", - "185", - "191", - "192", - "193", - "194", - "199", - "200", - "201", - "202", - "203", - "204", - "205", - "206", - "208", - "209", - "213", - "214", - "215", - "216", - "218", - "219", - "221", - "222", - "224", - "225", - "226", - "227", - "228", - "229", - "230", - "231", - "232", - "233", - "235", - "236", - "237", - "238", - "239", - "240", - "242", - "243", - "245", - "246", - "247", - "248", - "249", - "256", - "259", - "260", - "261", - "262", - "263", - "264", - "265", - "266", - "267", - "274", - "275", - "276", - "277", - "284", - "285", - "286", - "287", - "288", - "289", - "290", - "291", - "293", - "294", - "295", - "298", - "299", - "300", - "301", - "302", - "303", - "304", - "305", - "306", - "307", - "308", - "309", - "310", - "311", - "312", - "332", - "333", - "334", - "335", - "336", - "339", - "340", - "341", - "342", - "343", - "344", - "346", - "347", - "348", - "349", - "350", - "351", - "352", - "353", - "354", - "355", - "356", - "357", - "358", - "359", - "360", - "361", - "365", - "366", - "367", - "368", - "369", - "370", - "371", - "372", - "373", - "374", - "375", - "378", - "379", - "380", - "382", - "383", - "384", - "385", - "387" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/insert_conflict.metadata.json b/parser/testdata/parse/postgres_regress/insert_conflict.metadata.json index d8fef6e..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/insert_conflict.metadata.json +++ b/parser/testdata/parse/postgres_regress/insert_conflict.metadata.json @@ -1,134 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "048", - "049", - "056", - "057", - "058", - "065", - "066", - "067", - "072", - "073", - "074", - "077", - "081", - "082", - "083", - "084", - "088", - "089", - "090", - "097", - "098", - "103", - "104", - "105", - "106", - "107", - "108", - "111", - "112", - "113", - "114", - "118", - "119", - "120", - "125", - "126", - "127", - "128", - "129", - "130", - "148", - "149", - "150", - "156", - "157", - "161", - "164", - "165", - "172", - "173", - "174", - "176", - "177", - "179", - "180", - "182", - "183", - "185", - "186", - "188", - "189", - "191", - "193", - "194", - "195", - "204", - "205", - "206", - "210", - "211", - "212", - "216", - "217", - "218", - "222", - "226", - "227", - "228", - "229", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "251", - "252", - "253", - "256", - "257" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/interval.metadata.json b/parser/testdata/parse/postgres_regress/interval.metadata.json index de66215..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/interval.metadata.json +++ b/parser/testdata/parse/postgres_regress/interval.metadata.json @@ -1,32 +1,3 @@ { - "todo": [ - "001", - "002", - "013", - "049", - "057", - "058", - "059", - "061", - "063", - "064", - "070", - "071", - "072", - "096", - "097", - "163", - "165", - "168", - "172", - "174", - "176", - "186", - "339", - "341", - "343", - "345", - "376", - "379" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/join.metadata.json b/parser/testdata/parse/postgres_regress/join.metadata.json index 738ae66..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/join.metadata.json +++ b/parser/testdata/parse/postgres_regress/join.metadata.json @@ -1,388 +1,3 @@ { - "todo": [ - "001", - "002", - "023", - "025", - "067", - "068", - "069", - "070", - "090", - "096", - "114", - "115", - "116", - "118", - "119", - "121", - "124", - "126", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "144", - "146", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "176", - "185", - "188", - "191", - "192", - "195", - "196", - "197", - "199", - "200", - "201", - "202", - "203", - "205", - "206", - "207", - "208", - "209", - "210", - "212", - "213", - "214", - "215", - "217", - "218", - "220", - "221", - "222", - "224", - "225", - "226", - "227", - "228", - "229", - "230", - "231", - "232", - "233", - "240", - "241", - "249", - "250", - "251", - "255", - "261", - "262", - "263", - "264", - "265", - "266", - "268", - "269", - "270", - "271", - "272", - "273", - "274", - "275", - "276", - "277", - "282", - "283", - "284", - "285", - "294", - "297", - "299", - "300", - "301", - "311", - "313", - "315", - "319", - "320", - "321", - "322", - "323", - "324", - "325", - "326", - "329", - "331", - "333", - "335", - "337", - "338", - "339", - "340", - "341", - "342", - "343", - "344", - "345", - "346", - "347", - "348", - "349", - "350", - "351", - "352", - "353", - "354", - "356", - "358", - "359", - "360", - "361", - "362", - "363", - "364", - "365", - "366", - "367", - "368", - "370", - "372", - "374", - "376", - "378", - "380", - "382", - "384", - "386", - "388", - "390", - "392", - "394", - "396", - "397", - "398", - "400", - "402", - "404", - "406", - "407", - "408", - "409", - "410", - "412", - "414", - "415", - "416", - "417", - "418", - "420", - "421", - "422", - "424", - "426", - "428", - "430", - "432", - "433", - "434", - "435", - "436", - "441", - "442", - "443", - "444", - "445", - "446", - "447", - "448", - "449", - "450", - "451", - "452", - "453", - "454", - "455", - "456", - "457", - "458", - "459", - "460", - "461", - "462", - "463", - "464", - "465", - "466", - "467", - "468", - "469", - "473", - "475", - "477", - "479", - "480", - "481", - "482", - "487", - "488", - "489", - "492", - "493", - "494", - "495", - "496", - "497", - "498", - "499", - "501", - "502", - "503", - "505", - "507", - "508", - "509", - "511", - "512", - "514", - "515", - "517", - "518", - "520", - "530", - "532", - "534", - "535", - "537", - "541", - "542", - "543", - "544", - "546", - "548", - "550", - "565", - "567", - "569", - "571", - "573", - "575", - "577", - "578", - "580", - "581", - "582", - "583", - "584", - "587", - "589", - "599", - "607", - "608", - "609", - "610", - "612", - "614", - "616", - "617", - "618", - "619", - "621", - "622", - "623", - "624", - "625", - "626", - "627", - "628", - "629", - "632", - "633", - "634", - "635", - "636", - "637", - "638", - "639", - "643", - "644", - "645", - "646", - "647", - "648", - "649", - "650", - "651", - "652", - "653", - "654", - "655", - "656", - "657", - "658", - "659", - "660", - "661", - "665", - "666", - "667", - "668", - "669", - "670", - "671", - "672", - "673", - "674", - "675", - "676", - "677", - "678", - "679", - "681", - "682", - "684", - "686", - "688", - "689", - "690", - "691", - "692", - "693", - "694", - "695", - "696", - "697", - "698", - "699", - "700", - "702", - "703", - "704", - "705", - "706", - "708", - "709", - "710", - "712", - "713", - "714", - "715" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/join_hash.metadata.json b/parser/testdata/parse/postgres_regress/join_hash.metadata.json index 047832d..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/join_hash.metadata.json +++ b/parser/testdata/parse/postgres_regress/join_hash.metadata.json @@ -1,221 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "015", - "016", - "017", - "018", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "048", - "049", - "050", - "051", - "052", - "053", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "075", - "076", - "077", - "078", - "079", - "080", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "101", - "102", - "103", - "104", - "105", - "106", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "127", - "128", - "129", - "130", - "131", - "132", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179", - "180", - "183", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "195", - "198", - "199", - "200", - "201", - "203", - "204", - "205", - "206", - "207", - "209", - "210", - "211", - "212", - "214", - "215", - "216", - "217", - "219", - "220", - "221", - "222", - "223", - "225", - "226", - "227", - "228", - "230", - "231", - "232", - "233", - "234", - "235", - "236", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "251", - "252", - "254", - "255", - "256", - "257", - "258", - "259", - "260", - "270", - "272", - "274", - "275", - "276", - "277", - "279" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/json.metadata.json b/parser/testdata/parse/postgres_regress/json.metadata.json index 941a883..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/json.metadata.json +++ b/parser/testdata/parse/postgres_regress/json.metadata.json @@ -1,31 +1,3 @@ { - "todo": [ - "036", - "039", - "065", - "068", - "071", - "072", - "074", - "076", - "092", - "212", - "213", - "214", - "215", - "216", - "217", - "218", - "219", - "312", - "332", - "335", - "336", - "337", - "338", - "339", - "340", - "341", - "374" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/jsonb.metadata.json b/parser/testdata/parse/postgres_regress/jsonb.metadata.json index 56f4702..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/jsonb.metadata.json +++ b/parser/testdata/parse/postgres_regress/jsonb.metadata.json @@ -1,73 +1,3 @@ { - "todo": [ - "001", - "036", - "039", - "058", - "059", - "062", - "063", - "065", - "067", - "079", - "266", - "353", - "354", - "355", - "356", - "357", - "358", - "359", - "360", - "441", - "446", - "447", - "456", - "457", - "458", - "459", - "468", - "469", - "519", - "522", - "523", - "524", - "525", - "526", - "527", - "528", - "556", - "557", - "570", - "588", - "600", - "604", - "608", - "610", - "611", - "614", - "615", - "616", - "617", - "618", - "619", - "620", - "623", - "624", - "625", - "645", - "657", - "658", - "683", - "687", - "688", - "689", - "693", - "694", - "698", - "699", - "905", - "996", - "997" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/jsonb_jsonpath.metadata.json b/parser/testdata/parse/postgres_regress/jsonb_jsonpath.metadata.json index b848209..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/jsonb_jsonpath.metadata.json +++ b/parser/testdata/parse/postgres_regress/jsonb_jsonpath.metadata.json @@ -1,16 +1,3 @@ { - "todo": [ - "524", - "525", - "527", - "530", - "531", - "532", - "535", - "621", - "643", - "664", - "692", - "777" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/largeobject.metadata.json b/parser/testdata/parse/postgres_regress/largeobject.metadata.json index 41dc028..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/largeobject.metadata.json +++ b/parser/testdata/parse/postgres_regress/largeobject.metadata.json @@ -1,50 +1,3 @@ { - "todo": [ - "001", - "002", - "004", - "005", - "006", - "007", - "008", - "009", - "011", - "015", - "017", - "027", - "028", - "030", - "031", - "032", - "044", - "045", - "060", - "062", - "064", - "075", - "079", - "091", - "092", - "095", - "096", - "098", - "099", - "101", - "102", - "104", - "105", - "107", - "108", - "110", - "111", - "113", - "114", - "116", - "117", - "119", - "120", - "122", - "123", - "124" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/limit.metadata.json b/parser/testdata/parse/postgres_regress/limit.metadata.json index eda3faf..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/limit.metadata.json +++ b/parser/testdata/parse/postgres_regress/limit.metadata.json @@ -1,20 +1,3 @@ { - "todo": [ - "012", - "050", - "052", - "053", - "056", - "059", - "061", - "063", - "065", - "067", - "075", - "076", - "077", - "078", - "079", - "080" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/line.metadata.json b/parser/testdata/parse/postgres_regress/line.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/line.metadata.json +++ b/parser/testdata/parse/postgres_regress/line.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/lock.metadata.json b/parser/testdata/parse/postgres_regress/lock.metadata.json index ac56e94..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/lock.metadata.json +++ b/parser/testdata/parse/postgres_regress/lock.metadata.json @@ -1,126 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "037", - "038", - "039", - "041", - "042", - "043", - "045", - "046", - "047", - "049", - "050", - "051", - "053", - "054", - "055", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/lseg.metadata.json b/parser/testdata/parse/postgres_regress/lseg.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/lseg.metadata.json +++ b/parser/testdata/parse/postgres_regress/lseg.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/macaddr.metadata.json b/parser/testdata/parse/postgres_regress/macaddr.metadata.json index eddbb92..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/macaddr.metadata.json +++ b/parser/testdata/parse/postgres_regress/macaddr.metadata.json @@ -1,8 +1,3 @@ { - "todo": [ - "001", - "017", - "018", - "031" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/macaddr8.metadata.json b/parser/testdata/parse/postgres_regress/macaddr8.metadata.json index 985171f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/macaddr8.metadata.json +++ b/parser/testdata/parse/postgres_regress/macaddr8.metadata.json @@ -1,8 +1,3 @@ { - "todo": [ - "022", - "045", - "046", - "067" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/maintain_every.metadata.json b/parser/testdata/parse/postgres_regress/maintain_every.metadata.json index 51a26a2..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/maintain_every.metadata.json +++ b/parser/testdata/parse/postgres_regress/maintain_every.metadata.json @@ -1,18 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "009", - "010", - "011", - "012", - "014", - "015", - "016" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/matview.metadata.json b/parser/testdata/parse/postgres_regress/matview.metadata.json index 7dd6984..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/matview.metadata.json +++ b/parser/testdata/parse/postgres_regress/matview.metadata.json @@ -1,142 +1,3 @@ { - "todo": [ - "001", - "003", - "005", - "006", - "009", - "011", - "013", - "014", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "032", - "033", - "036", - "037", - "038", - "039", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "053", - "054", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "066", - "067", - "068", - "069", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "089", - "090", - "092", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "104", - "105", - "107", - "108", - "109", - "110", - "116", - "117", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/memoize.metadata.json b/parser/testdata/parse/postgres_regress/memoize.metadata.json index 760696c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/memoize.metadata.json +++ b/parser/testdata/parse/postgres_regress/memoize.metadata.json @@ -1,50 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "010", - "011", - "014", - "015", - "017", - "018", - "019", - "021", - "022", - "024", - "025", - "028", - "029", - "030", - "031", - "034", - "037", - "038", - "039", - "040", - "041", - "044", - "045", - "046", - "048", - "050", - "051", - "052", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "066", - "067", - "068", - "069" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/merge.metadata.json b/parser/testdata/parse/postgres_regress/merge.metadata.json index 84257a7..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/merge.metadata.json +++ b/parser/testdata/parse/postgres_regress/merge.metadata.json @@ -1,298 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "033", - "035", - "036", - "038", - "040", - "041", - "043", - "044", - "051", - "053", - "060", - "063", - "064", - "067", - "069", - "070", - "071", - "072", - "073", - "075", - "080", - "083", - "084", - "087", - "088", - "091", - "092", - "095", - "099", - "101", - "102", - "104", - "110", - "113", - "118", - "119", - "120", - "123", - "124", - "127", - "128", - "131", - "132", - "135", - "138", - "141", - "143", - "146", - "148", - "151", - "152", - "155", - "156", - "158", - "159", - "160", - "162", - "165", - "170", - "173", - "174", - "177", - "195", - "198", - "203", - "204", - "205", - "206", - "207", - "208", - "209", - "210", - "211", - "212", - "213", - "214", - "215", - "216", - "217", - "221", - "222", - "226", - "227", - "229", - "230", - "232", - "233", - "234", - "235", - "236", - "237", - "240", - "241", - "244", - "245", - "248", - "249", - "252", - "253", - "256", - "257", - "260", - "261", - "262", - "265", - "266", - "270", - "271", - "275", - "276", - "277", - "280", - "283", - "284", - "285", - "288", - "289", - "291", - "292", - "296", - "297", - "300", - "303", - "304", - "307", - "310", - "312", - "315", - "316", - "318", - "319", - "320", - "322", - "323", - "324", - "326", - "327", - "328", - "330", - "331", - "332", - "335", - "344", - "345", - "346", - "347", - "348", - "349", - "350", - "351", - "354", - "355", - "358", - "359", - "362", - "363", - "364", - "365", - "366", - "367", - "368", - "369", - "372", - "375", - "376", - "379", - "380", - "381", - "384", - "385", - "388", - "389", - "390", - "393", - "394", - "395", - "396", - "397", - "398", - "399", - "400", - "401", - "402", - "403", - "404", - "406", - "407", - "409", - "410", - "413", - "414", - "415", - "417", - "418", - "419", - "420", - "421", - "423", - "424", - "425", - "426", - "427", - "429", - "430", - "431", - "432", - "433", - "435", - "436", - "437", - "438", - "439", - "440", - "441", - "442", - "443", - "444", - "445", - "449", - "452", - "453", - "454", - "455", - "456", - "457", - "459", - "462", - "463", - "465", - "466", - "467", - "468", - "469", - "484", - "485", - "486", - "488", - "489", - "493", - "494", - "495", - "496", - "497", - "498", - "499", - "501", - "502", - "510", - "519", - "522", - "525", - "528", - "531", - "532", - "533", - "534", - "537", - "538", - "539", - "540", - "545", - "546", - "547", - "549", - "553", - "554", - "556", - "557", - "561", - "562", - "563", - "565", - "567", - "568", - "569", - "570", - "571", - "572" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/misc.metadata.json b/parser/testdata/parse/postgres_regress/misc.metadata.json index d360ac8..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/misc.metadata.json +++ b/parser/testdata/parse/postgres_regress/misc.metadata.json @@ -1,22 +1,3 @@ { - "todo": [ - "001", - "002", - "008", - "010", - "015", - "018", - "019", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/misc_functions.metadata.json b/parser/testdata/parse/postgres_regress/misc_functions.metadata.json index ce38c34..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/misc_functions.metadata.json +++ b/parser/testdata/parse/postgres_regress/misc_functions.metadata.json @@ -1,27 +1,3 @@ { - "todo": [ - "023", - "048", - "050", - "052", - "054", - "055", - "056", - "083", - "087", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "111", - "113", - "115", - "116", - "119" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/money.metadata.json b/parser/testdata/parse/postgres_regress/money.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/money.metadata.json +++ b/parser/testdata/parse/postgres_regress/money.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/multirangetypes.metadata.json b/parser/testdata/parse/postgres_regress/multirangetypes.metadata.json index 2010ea2..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/multirangetypes.metadata.json +++ b/parser/testdata/parse/postgres_regress/multirangetypes.metadata.json @@ -1,95 +1,3 @@ { - "todo": [ - "068", - "069", - "104", - "366", - "372", - "373", - "374", - "375", - "376", - "414", - "415", - "416", - "455", - "456", - "480", - "481", - "490", - "491", - "492", - "494", - "495", - "496", - "498", - "499", - "500", - "502", - "503", - "504", - "505", - "507", - "510", - "511", - "512", - "514", - "515", - "518", - "519", - "521", - "522", - "523", - "524", - "525", - "526", - "527", - "528", - "529", - "530", - "535", - "536", - "537", - "538", - "539", - "540", - "541", - "542", - "543", - "544", - "545", - "546", - "547", - "548", - "549", - "550", - "551", - "554", - "555", - "556", - "557", - "560", - "563", - "567", - "568", - "571", - "572", - "574", - "577", - "582", - "583", - "585", - "586", - "588", - "589", - "591", - "593", - "595", - "597", - "599", - "601", - "603", - "604", - "605" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/mvcc.metadata.json b/parser/testdata/parse/postgres_regress/mvcc.metadata.json index e17e032..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/mvcc.metadata.json +++ b/parser/testdata/parse/postgres_regress/mvcc.metadata.json @@ -1,12 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "009", - "011" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/name.metadata.json b/parser/testdata/parse/postgres_regress/name.metadata.json index a7ac0dd..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/name.metadata.json +++ b/parser/testdata/parse/postgres_regress/name.metadata.json @@ -1,7 +1,3 @@ { - "todo": [ - "003", - "022", - "023" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/namespace.metadata.json b/parser/testdata/parse/postgres_regress/namespace.metadata.json index f0b87e1..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/namespace.metadata.json +++ b/parser/testdata/parse/postgres_regress/namespace.metadata.json @@ -1,36 +1,3 @@ { - "todo": [ - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "022", - "024", - "025", - "026", - "027", - "029", - "030", - "031", - "032", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/numeric.metadata.json b/parser/testdata/parse/postgres_regress/numeric.metadata.json index 2a1b104..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/numeric.metadata.json +++ b/parser/testdata/parse/postgres_regress/numeric.metadata.json @@ -1,64 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "1000", - "1001", - "1003", - "1004", - "412", - "413", - "424", - "425", - "436", - "437", - "448", - "449", - "460", - "461", - "472", - "473", - "474", - "475", - "476", - "477", - "478", - "479", - "480", - "481", - "482", - "483", - "484", - "485", - "486", - "487", - "488", - "582", - "595", - "630", - "639", - "668", - "678", - "729", - "752", - "753", - "814", - "982", - "989", - "990", - "991", - "992", - "994", - "998", - "999" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/numeric_big.metadata.json b/parser/testdata/parse/postgres_regress/numeric_big.metadata.json index 14f9ec0..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/numeric_big.metadata.json +++ b/parser/testdata/parse/postgres_regress/numeric_big.metadata.json @@ -1,52 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "422", - "423", - "434", - "435", - "446", - "447", - "458", - "459", - "470", - "471", - "482", - "483", - "484", - "485", - "486", - "487", - "488", - "489", - "490", - "491", - "492", - "493", - "494", - "495", - "496", - "497", - "498" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/object_address.metadata.json b/parser/testdata/parse/postgres_regress/object_address.metadata.json index 77c7007..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/object_address.metadata.json +++ b/parser/testdata/parse/postgres_regress/object_address.metadata.json @@ -1,49 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "040", - "045", - "074", - "075", - "076", - "077", - "078", - "079", - "080" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/oid.metadata.json b/parser/testdata/parse/postgres_regress/oid.metadata.json index 6120e61..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/oid.metadata.json +++ b/parser/testdata/parse/postgres_regress/oid.metadata.json @@ -1,6 +1,3 @@ { - "todo": [ - "001", - "037" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/oidjoins.metadata.json b/parser/testdata/parse/postgres_regress/oidjoins.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/oidjoins.metadata.json +++ b/parser/testdata/parse/postgres_regress/oidjoins.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/partition_aggregate.metadata.json b/parser/testdata/parse/postgres_regress/partition_aggregate.metadata.json index 17198fe..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/partition_aggregate.metadata.json +++ b/parser/testdata/parse/postgres_regress/partition_aggregate.metadata.json @@ -1,101 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "010", - "011", - "013", - "015", - "016", - "017", - "018", - "020", - "022", - "023", - "025", - "027", - "029", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "045", - "046", - "047", - "049", - "051", - "052", - "053", - "055", - "056", - "058", - "060", - "062", - "064", - "066", - "068", - "069", - "070", - "071", - "073", - "074", - "076", - "078", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "091", - "092", - "093", - "094", - "096", - "097", - "098", - "100", - "102", - "104", - "105", - "106", - "108", - "110", - "112", - "113", - "114", - "115", - "116", - "118", - "119", - "121", - "123", - "124", - "125", - "126", - "128", - "129", - "130", - "132", - "133", - "134" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/partition_info.metadata.json b/parser/testdata/parse/postgres_regress/partition_info.metadata.json index 6cd26b2..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/partition_info.metadata.json +++ b/parser/testdata/parse/postgres_regress/partition_info.metadata.json @@ -1,34 +1,3 @@ { - "todo": [ - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "049", - "050", - "054", - "055", - "056", - "057", - "058", - "071", - "072", - "073" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/partition_join.metadata.json b/parser/testdata/parse/postgres_regress/partition_join.metadata.json index c1d1356..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/partition_join.metadata.json +++ b/parser/testdata/parse/postgres_regress/partition_join.metadata.json @@ -1,460 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "016", - "017", - "018", - "019", - "020", - "022", - "024", - "026", - "028", - "030", - "032", - "034", - "036", - "038", - "040", - "042", - "044", - "045", - "047", - "049", - "050", - "051", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "070", - "071", - "073", - "075", - "077", - "079", - "081", - "083", - "085", - "087", - "089", - "090", - "091", - "093", - "095", - "097", - "099", - "100", - "101", - "102", - "103", - "104", - "106", - "107", - "108", - "109", - "110", - "112", - "113", - "115", - "116", - "117", - "118", - "120", - "121", - "122", - "123", - "124", - "126", - "127", - "128", - "129", - "130", - "132", - "133", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "144", - "145", - "146", - "147", - "148", - "150", - "151", - "152", - "153", - "154", - "156", - "157", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179", - "180", - "182", - "183", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "192", - "193", - "195", - "197", - "199", - "201", - "203", - "204", - "206", - "207", - "208", - "209", - "210", - "212", - "213", - "214", - "215", - "217", - "218", - "219", - "220", - "221", - "223", - "224", - "225", - "226", - "227", - "229", - "230", - "231", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "249", - "250", - "251", - "252", - "253", - "255", - "257", - "258", - "259", - "260", - "261", - "263", - "264", - "265", - "266", - "267", - "268", - "272", - "273", - "275", - "277", - "279", - "281", - "283", - "285", - "286", - "288", - "290", - "292", - "293", - "295", - "296", - "297", - "299", - "300", - "301", - "302", - "304", - "305", - "306", - "307", - "308", - "309", - "310", - "311", - "312", - "313", - "314", - "315", - "316", - "317", - "319", - "320", - "321", - "322", - "323", - "324", - "325", - "326", - "327", - "328", - "329", - "330", - "331", - "332", - "333", - "334", - "335", - "337", - "338", - "340", - "341", - "342", - "343", - "344", - "345", - "346", - "347", - "349", - "350", - "351", - "352", - "353", - "355", - "356", - "358", - "359", - "360", - "361", - "362", - "363", - "365", - "366", - "367", - "368", - "369", - "370", - "372", - "373", - "374", - "375", - "376", - "378", - "379", - "381", - "383", - "385", - "387", - "389", - "391", - "392", - "394", - "396", - "398", - "399", - "401", - "402", - "403", - "404", - "405", - "406", - "408", - "409", - "410", - "411", - "412", - "413", - "414", - "415", - "416", - "417", - "418", - "421", - "422", - "423", - "426", - "427", - "429", - "431", - "433", - "435", - "437", - "438", - "439", - "441", - "442", - "443", - "444", - "445", - "447", - "448", - "449", - "451", - "452", - "454", - "456", - "458", - "460", - "461", - "462", - "463", - "464", - "465", - "466", - "467", - "468", - "470", - "471", - "473", - "474", - "475", - "476", - "477", - "478", - "479", - "480", - "481", - "482", - "483", - "484", - "486", - "487", - "489", - "490", - "493", - "494", - "496", - "497", - "499", - "500", - "502", - "503", - "504", - "505", - "506", - "507", - "508", - "509", - "512", - "513", - "514", - "515", - "516", - "517", - "520", - "521", - "523", - "525", - "526", - "527", - "528", - "529", - "531", - "533", - "534", - "535", - "536", - "537", - "539", - "540", - "541", - "542", - "544", - "545", - "546", - "547", - "549", - "550", - "552", - "553", - "554", - "555", - "556", - "557", - "558", - "559", - "560", - "561", - "562", - "563", - "566", - "567", - "568", - "569", - "570", - "571", - "572", - "573", - "574", - "575", - "582", - "583", - "585", - "587", - "589", - "590", - "591", - "593", - "594", - "595", - "596", - "597", - "598", - "599", - "600" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/partition_prune.metadata.json b/parser/testdata/parse/postgres_regress/partition_prune.metadata.json index 401e2f4..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/partition_prune.metadata.json +++ b/parser/testdata/parse/postgres_regress/partition_prune.metadata.json @@ -1,580 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "150", - "152", - "153", - "154", - "155", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "185", - "190", - "191", - "192", - "193", - "194", - "195", - "196", - "197", - "198", - "199", - "200", - "201", - "202", - "203", - "204", - "205", - "206", - "207", - "208", - "209", - "210", - "211", - "212", - "213", - "214", - "215", - "216", - "217", - "218", - "219", - "220", - "221", - "222", - "223", - "225", - "226", - "227", - "228", - "229", - "230", - "231", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "248", - "249", - "250", - "251", - "252", - "253", - "254", - "255", - "256", - "257", - "258", - "259", - "260", - "261", - "262", - "263", - "264", - "265", - "266", - "267", - "268", - "269", - "270", - "271", - "279", - "280", - "281", - "282", - "283", - "284", - "285", - "286", - "287", - "288", - "289", - "290", - "291", - "292", - "293", - "294", - "295", - "296", - "297", - "298", - "299", - "300", - "301", - "302", - "303", - "304", - "305", - "306", - "307", - "308", - "309", - "310", - "311", - "312", - "314", - "315", - "318", - "319", - "321", - "323", - "324", - "325", - "326", - "328", - "330", - "331", - "332", - "333", - "334", - "335", - "337", - "341", - "342", - "343", - "344", - "345", - "346", - "347", - "348", - "349", - "351", - "352", - "353", - "354", - "361", - "364", - "365", - "366", - "367", - "368", - "369", - "370", - "371", - "372", - "373", - "374", - "375", - "376", - "384", - "385", - "386", - "387", - "388", - "389", - "390", - "391", - "392", - "393", - "394", - "396", - "397", - "399", - "401", - "402", - "410", - "412", - "414", - "416", - "417", - "419", - "420", - "421", - "422", - "423", - "424", - "425", - "426", - "427", - "428", - "429", - "430", - "431", - "433", - "434", - "435", - "436", - "440", - "441", - "446", - "450", - "452", - "453", - "454", - "455", - "456", - "457", - "458", - "459", - "461", - "463", - "464", - "465", - "466", - "467", - "468", - "471", - "472", - "473", - "476", - "477", - "478", - "479", - "480", - "481", - "482", - "483", - "484", - "485", - "486", - "487", - "488", - "489", - "490", - "491", - "492", - "493", - "494", - "495", - "496", - "498", - "500", - "503", - "505", - "506", - "508", - "509", - "510", - "511", - "512", - "513", - "514", - "515", - "516", - "517", - "518", - "519", - "521", - "522", - "524", - "526", - "528", - "532", - "534", - "535", - "536", - "537", - "538", - "539", - "540", - "541", - "542", - "543", - "544", - "545", - "546", - "547", - "548", - "549", - "550", - "553", - "554", - "555", - "556", - "557", - "558", - "559", - "560", - "561", - "562", - "563", - "564", - "565", - "566", - "567", - "568", - "569", - "570", - "571", - "572", - "573", - "574", - "575", - "576", - "577", - "578", - "579", - "580", - "581", - "582", - "583", - "584", - "585", - "586", - "587", - "588", - "589", - "590", - "591", - "592", - "593", - "594", - "595", - "596", - "597", - "598", - "599", - "600", - "601", - "602", - "603", - "604", - "605", - "606", - "607", - "608", - "609", - "610", - "611", - "612", - "613", - "614", - "615", - "616", - "617", - "618", - "619", - "620", - "621", - "623", - "626", - "628", - "629", - "630", - "631", - "632", - "633", - "634", - "635", - "636", - "637", - "638", - "639", - "640", - "641", - "642", - "643", - "644", - "645", - "646", - "647", - "648", - "649", - "650", - "653", - "654", - "655", - "656", - "657", - "658", - "659", - "660", - "661", - "662", - "663", - "664", - "665", - "666", - "667", - "668", - "669", - "670", - "671", - "672", - "673", - "674", - "675", - "676", - "677", - "678", - "679", - "680", - "681", - "682", - "683", - "688", - "689", - "690", - "691", - "692", - "693", - "694", - "695", - "696", - "697", - "698" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/password.metadata.json b/parser/testdata/parse/postgres_regress/password.metadata.json index 97df595..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/password.metadata.json +++ b/parser/testdata/parse/postgres_regress/password.metadata.json @@ -1,49 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "014", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "030", - "031", - "032", - "034", - "035", - "036", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/path.metadata.json b/parser/testdata/parse/postgres_regress/path.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/path.metadata.json +++ b/parser/testdata/parse/postgres_regress/path.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/pg_lsn.metadata.json b/parser/testdata/parse/postgres_regress/pg_lsn.metadata.json index 32a21c3..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/pg_lsn.metadata.json +++ b/parser/testdata/parse/postgres_regress/pg_lsn.metadata.json @@ -1,7 +1,3 @@ { - "todo": [ - "001", - "012", - "030" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/plancache.metadata.json b/parser/testdata/parse/postgres_regress/plancache.metadata.json index e526209..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/plancache.metadata.json +++ b/parser/testdata/parse/postgres_regress/plancache.metadata.json @@ -1,48 +1,3 @@ { - "todo": [ - "001", - "006", - "009", - "012", - "015", - "018", - "021", - "023", - "027", - "028", - "030", - "032", - "034", - "035", - "038", - "041", - "044", - "046", - "047", - "048", - "049", - "052", - "053", - "055", - "058", - "059", - "060", - "061", - "065", - "067", - "069", - "071", - "073", - "075", - "076", - "079", - "080", - "082", - "083", - "085", - "093", - "094", - "095", - "097" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/plpgsql.metadata.json b/parser/testdata/parse/postgres_regress/plpgsql.metadata.json index df3caff..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/plpgsql.metadata.json +++ b/parser/testdata/parse/postgres_regress/plpgsql.metadata.json @@ -1,500 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "283", - "285", - "286", - "289", - "291", - "293", - "295", - "298", - "301", - "304", - "305", - "307", - "308", - "311", - "312", - "315", - "316", - "317", - "319", - "320", - "322", - "323", - "326", - "327", - "328", - "330", - "331", - "336", - "337", - "338", - "341", - "344", - "345", - "347", - "348", - "351", - "352", - "354", - "355", - "358", - "359", - "362", - "363", - "364", - "365", - "368", - "369", - "370", - "374", - "380", - "381", - "382", - "384", - "385", - "387", - "388", - "389", - "394", - "396", - "398", - "400", - "402", - "404", - "406", - "407", - "408", - "409", - "410", - "412", - "414", - "416", - "417", - "418", - "420", - "422", - "423", - "424", - "425", - "426", - "428", - "430", - "431", - "432", - "433", - "434", - "436", - "437", - "438", - "440", - "442", - "444", - "446", - "447", - "448", - "449", - "450", - "452", - "453", - "455", - "457", - "459", - "461", - "463", - "466", - "468", - "470", - "472", - "474", - "476", - "478", - "479", - "480", - "482", - "484", - "486", - "488", - "490", - "492", - "494", - "496", - "497", - "499", - "500", - "501", - "502", - "503", - "504", - "506", - "508", - "510", - "511", - "512", - "513", - "514", - "515", - "516", - "517", - "518", - "520", - "521", - "522", - "524", - "525", - "526", - "527", - "528", - "529", - "530", - "531", - "532", - "533", - "534", - "535", - "537", - "538", - "539", - "540", - "541", - "542", - "543", - "545", - "547", - "549", - "551", - "553", - "555", - "557", - "558", - "560", - "561", - "563", - "564", - "566", - "568", - "569", - "571", - "572", - "574", - "575", - "578", - "581", - "582", - "583", - "584", - "586", - "587", - "589", - "591", - "593", - "595", - "597", - "598", - "599", - "600", - "602", - "604", - "606", - "608", - "610", - "611", - "613", - "615", - "616", - "618", - "619", - "621", - "623", - "624", - "626", - "628", - "629", - "630", - "632", - "634", - "636", - "638", - "640", - "642", - "644", - "646", - "648", - "650", - "652", - "654", - "655", - "656", - "658", - "660", - "662", - "663", - "664", - "665", - "667", - "668", - "669", - "670", - "672", - "673", - "675", - "676", - "680", - "681", - "686", - "688", - "689", - "690", - "692", - "694", - "695", - "697", - "699", - "702", - "703", - "704", - "707", - "708", - "709", - "711", - "712", - "714", - "715", - "716", - "718", - "719", - "720", - "721", - "722", - "724", - "726", - "727", - "728", - "729", - "730", - "731", - "734", - "737", - "740", - "743", - "744", - "745", - "746", - "747", - "748", - "749", - "750", - "753", - "754", - "755", - "757", - "759", - "760", - "762", - "764", - "765", - "766", - "767", - "768", - "769", - "770", - "771", - "772", - "773", - "774", - "776", - "778", - "780", - "781", - "783", - "785", - "788", - "789", - "792", - "795", - "798", - "802", - "803", - "806", - "809", - "812", - "813", - "814", - "815", - "818", - "821", - "826", - "827", - "828", - "829", - "831", - "833", - "835", - "837", - "838", - "839", - "840", - "843", - "844", - "845", - "846", - "847", - "848", - "851", - "852", - "853", - "854", - "856", - "857", - "858", - "859", - "860", - "861", - "862", - "863", - "864", - "865", - "866", - "867", - "868", - "869", - "870", - "871", - "872", - "873", - "874", - "875", - "876", - "877", - "880", - "881", - "883", - "884", - "885", - "886", - "887", - "888", - "889", - "890", - "891", - "892", - "894", - "896", - "899", - "901", - "902", - "903", - "905", - "915", - "916", - "917", - "918", - "921", - "923", - "925", - "927", - "928", - "930", - "931", - "932", - "933", - "934", - "937", - "939", - "941" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/point.metadata.json b/parser/testdata/parse/postgres_regress/point.metadata.json index 601ff32..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/point.metadata.json +++ b/parser/testdata/parse/postgres_regress/point.metadata.json @@ -1,16 +1,3 @@ { - "todo": [ - "001", - "023", - "025", - "027", - "028", - "029", - "033", - "034", - "035", - "039", - "040", - "041" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/polygon.metadata.json b/parser/testdata/parse/postgres_regress/polygon.metadata.json index 2a0e491..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/polygon.metadata.json +++ b/parser/testdata/parse/postgres_regress/polygon.metadata.json @@ -1,33 +1,3 @@ { - "todo": [ - "001", - "015", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "029", - "031", - "033", - "035", - "037", - "039", - "041", - "043", - "045", - "047", - "049", - "051", - "052", - "053", - "054", - "056", - "057", - "058" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/polymorphism.metadata.json b/parser/testdata/parse/postgres_regress/polymorphism.metadata.json index 33e17fc..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/polymorphism.metadata.json +++ b/parser/testdata/parse/postgres_regress/polymorphism.metadata.json @@ -1,199 +1,3 @@ { - "todo": [ - "001", - "004", - "005", - "007", - "008", - "011", - "012", - "015", - "016", - "017", - "019", - "020", - "022", - "023", - "026", - "027", - "030", - "031", - "032", - "034", - "035", - "036", - "038", - "039", - "044", - "045", - "048", - "049", - "052", - "053", - "056", - "057", - "060", - "061", - "064", - "065", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "172", - "173", - "176", - "179", - "180", - "182", - "183", - "184", - "185", - "186", - "187", - "197", - "205", - "210", - "211", - "217", - "227", - "232", - "233", - "234", - "235", - "236", - "238", - "239", - "241", - "247", - "248", - "249", - "250", - "256", - "257", - "258", - "259", - "264", - "265", - "269", - "273", - "274", - "275", - "276", - "277", - "280", - "281", - "282", - "283", - "297", - "298", - "305", - "306", - "315", - "316", - "317", - "318", - "319", - "320", - "321", - "322", - "324", - "325", - "327", - "328", - "357", - "358", - "360", - "361", - "362", - "367", - "368", - "372", - "373", - "380", - "381", - "387", - "388", - "391", - "392", - "393", - "399", - "400", - "403", - "404", - "405", - "409", - "410", - "415", - "416", - "423" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/portals.metadata.json b/parser/testdata/parse/postgres_regress/portals.metadata.json index c9de67f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/portals.metadata.json +++ b/parser/testdata/parse/postgres_regress/portals.metadata.json @@ -1,98 +1,3 @@ { - "todo": [ - "001", - "084", - "086", - "090", - "091", - "096", - "098", - "102", - "108", - "112", - "118", - "120", - "122", - "123", - "126", - "127", - "128", - "129", - "130", - "135", - "136", - "140", - "143", - "144", - "145", - "149", - "155", - "161", - "162", - "165", - "173", - "175", - "180", - "182", - "197", - "199", - "213", - "215", - "221", - "224", - "227", - "236", - "238", - "242", - "243", - "247", - "248", - "253", - "257", - "260", - "261", - "264", - "265", - "268", - "269", - "272", - "273", - "276", - "277", - "279", - "280", - "281", - "282", - "286", - "287", - "288", - "293", - "294", - "295", - "296", - "297", - "308", - "309", - "310", - "311", - "316", - "317", - "318", - "319", - "324", - "325", - "326", - "327", - "331", - "332", - "333", - "334", - "338", - "339", - "340", - "341", - "346", - "347", - "349" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/portals_p2.metadata.json b/parser/testdata/parse/postgres_regress/portals_p2.metadata.json index a9dd67f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/portals_p2.metadata.json +++ b/parser/testdata/parse/postgres_regress/portals_p2.metadata.json @@ -1,6 +1,3 @@ { - "todo": [ - "001", - "041" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/predicate.metadata.json b/parser/testdata/parse/postgres_regress/predicate.metadata.json index 7ea3a46..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/predicate.metadata.json +++ b/parser/testdata/parse/postgres_regress/predicate.metadata.json @@ -1,40 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "035", - "036", - "037", - "039", - "041", - "042" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/prepare.metadata.json b/parser/testdata/parse/postgres_regress/prepare.metadata.json index 27febf1..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/prepare.metadata.json +++ b/parser/testdata/parse/postgres_regress/prepare.metadata.json @@ -1,6 +1,3 @@ { - "todo": [ - "024", - "026" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/prepared_xacts.metadata.json b/parser/testdata/parse/postgres_regress/prepared_xacts.metadata.json index 2d12b82..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/prepared_xacts.metadata.json +++ b/parser/testdata/parse/postgres_regress/prepared_xacts.metadata.json @@ -1,46 +1,3 @@ { - "todo": [ - "001", - "003", - "006", - "009", - "012", - "015", - "017", - "019", - "022", - "024", - "026", - "028", - "030", - "033", - "035", - "038", - "040", - "042", - "043", - "046", - "047", - "048", - "050", - "052", - "053", - "055", - "056", - "057", - "058", - "059", - "064", - "068", - "069", - "070", - "072", - "073", - "074", - "075", - "078", - "081", - "082", - "083" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/privileges.metadata.json b/parser/testdata/parse/postgres_regress/privileges.metadata.json index 2fc3d78..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/privileges.metadata.json +++ b/parser/testdata/parse/postgres_regress/privileges.metadata.json @@ -1,233 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "031", - "032", - "034", - "035", - "037", - "038", - "039", - "040", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "097", - "099", - "100", - "101", - "103", - "105", - "106", - "108", - "110", - "111", - "113", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "147", - "152", - "153", - "154", - "155", - "156", - "158", - "159", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "179", - "180", - "181", - "182", - "184", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "195", - "196", - "197", - "198", - "199", - "200", - "201", - "202", - "203", - "204", - "205", - "206", - "207", - "208", - "209", - "210", - "211", - "212", - "213", - "214", - "215", - "216", - "217", - "218", - "219", - "220", - "221", - "222", - "223", - "224", - "227", - "228", - "229", - "230", - "231", - "233", - "234", - "235", - "236", - "238", - "239", - "240", - "241", - "243", - "244", - "245", - "246", - "247", - "248", - "251", - "252", - "253", - "259", - "261", - "262", - "264", - "265", - "270", - "271", - "272", - "273", - "274", - "276", - "315", - "316", - "317", - "319", - "320", - "321" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/psql.metadata.json b/parser/testdata/parse/postgres_regress/psql.metadata.json index 6cd28c5..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/psql.metadata.json +++ b/parser/testdata/parse/postgres_regress/psql.metadata.json @@ -1,27 +1,3 @@ { - "todo": [ - "026", - "029", - "032", - "033", - "034", - "035", - "121", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "193" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/psql_crosstab.metadata.json b/parser/testdata/parse/postgres_regress/psql_crosstab.metadata.json index 088c33a..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/psql_crosstab.metadata.json +++ b/parser/testdata/parse/postgres_regress/psql_crosstab.metadata.json @@ -1,7 +1,3 @@ { - "todo": [ - "001", - "002", - "005" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/publication.metadata.json b/parser/testdata/parse/postgres_regress/publication.metadata.json index 263dab1..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/publication.metadata.json +++ b/parser/testdata/parse/postgres_regress/publication.metadata.json @@ -1,566 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "071", - "074", - "076", - "078", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "180", - "182", - "184", - "186", - "188", - "189", - "190", - "192", - "194", - "195", - "196", - "198", - "200", - "202", - "203", - "204", - "205", - "206", - "207", - "208", - "210", - "212", - "214", - "216", - "217", - "218", - "220", - "221", - "223", - "224", - "225", - "226", - "227", - "229", - "230", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "248", - "249", - "250", - "251", - "252", - "253", - "254", - "255", - "256", - "258", - "259", - "260", - "262", - "263", - "264", - "265", - "266", - "267", - "269", - "271", - "272", - "273", - "274", - "276", - "277", - "279", - "280", - "281", - "282", - "283", - "284", - "285", - "286", - "287", - "288", - "289", - "290", - "291", - "292", - "293", - "294", - "296", - "297", - "299", - "300", - "301", - "303", - "304", - "305", - "306", - "308", - "309", - "310", - "312", - "313", - "314", - "315", - "316", - "317", - "318", - "319", - "320", - "321", - "322", - "324", - "326", - "327", - "328", - "329", - "330", - "331", - "332", - "333", - "334", - "335", - "336", - "337", - "338", - "339", - "340", - "341", - "342", - "343", - "344", - "345", - "346", - "347", - "348", - "349", - "350", - "351", - "352", - "353", - "355", - "357", - "359", - "361", - "363", - "364", - "365", - "367", - "369", - "370", - "371", - "373", - "375", - "377", - "378", - "379", - "380", - "381", - "382", - "383", - "385", - "387", - "389", - "391", - "392", - "393", - "395", - "396", - "398", - "399", - "400", - "401", - "402", - "404", - "405", - "407", - "408", - "409", - "410", - "411", - "412", - "415", - "416", - "418", - "420", - "421", - "422", - "423", - "424", - "425", - "426", - "427", - "428", - "429", - "430", - "431", - "432", - "433", - "434", - "435", - "436", - "437", - "438", - "439", - "440", - "441", - "442", - "444", - "446", - "448", - "449", - "450", - "451", - "452", - "453", - "454", - "455", - "456", - "457", - "458", - "459", - "460", - "461", - "462", - "463", - "464", - "465", - "466", - "467", - "468", - "469", - "470", - "471", - "472", - "473", - "474", - "475", - "476", - "477", - "478", - "479", - "480", - "481", - "482", - "483", - "484", - "485", - "486", - "487", - "488", - "489", - "490", - "491", - "492", - "493", - "494", - "495", - "496", - "497", - "498", - "499", - "500", - "501", - "502", - "503", - "504", - "505", - "506", - "507", - "508", - "509", - "510", - "511", - "512", - "513", - "514", - "515", - "516", - "517", - "518", - "519", - "520", - "521", - "522", - "523", - "524", - "525", - "526", - "527", - "528", - "529", - "530", - "531", - "534", - "536", - "538", - "539", - "540", - "541", - "544", - "545", - "546", - "549", - "550", - "551", - "554", - "555", - "556", - "560", - "561", - "562", - "563", - "564", - "565", - "566", - "567", - "568", - "569", - "570", - "571", - "572", - "573", - "574", - "575", - "576", - "577", - "578", - "579", - "580", - "581", - "582", - "583", - "584", - "585", - "586", - "587", - "588", - "589", - "591", - "592", - "594", - "596", - "597", - "599", - "600", - "602", - "604", - "605", - "606", - "607", - "608", - "609", - "610", - "611", - "612", - "614", - "615", - "616", - "617", - "618", - "619", - "620", - "621", - "622", - "623", - "624", - "629", - "630", - "631", - "632", - "633", - "634", - "635", - "636", - "641", - "642", - "643", - "644", - "645", - "646", - "647", - "648", - "649", - "650", - "651", - "652", - "653", - "654", - "655" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/random.metadata.json b/parser/testdata/parse/postgres_regress/random.metadata.json index 0f371cb..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/random.metadata.json +++ b/parser/testdata/parse/postgres_regress/random.metadata.json @@ -1,10 +1,3 @@ { - "todo": [ - "003", - "008", - "031", - "033", - "035", - "039" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/rangefuncs.metadata.json b/parser/testdata/parse/postgres_regress/rangefuncs.metadata.json index ab455db..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/rangefuncs.metadata.json +++ b/parser/testdata/parse/postgres_regress/rangefuncs.metadata.json @@ -1,187 +1,3 @@ { - "todo": [ - "001", - "005", - "014", - "017", - "019", - "022", - "027", - "030", - "031", - "034", - "035", - "038", - "039", - "054", - "061", - "065", - "068", - "070", - "071", - "073", - "074", - "077", - "079", - "080", - "082", - "083", - "086", - "088", - "089", - "091", - "092", - "095", - "097", - "098", - "100", - "101", - "104", - "106", - "107", - "109", - "110", - "113", - "115", - "116", - "118", - "119", - "122", - "124", - "125", - "127", - "128", - "131", - "133", - "134", - "136", - "137", - "140", - "142", - "143", - "145", - "148", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "224", - "225", - "226", - "227", - "228", - "232", - "233", - "234", - "235", - "236", - "240", - "244", - "245", - "246", - "247", - "252", - "253", - "254", - "256", - "257", - "258", - "263", - "264", - "268", - "269", - "270", - "272", - "273", - "275", - "276", - "278", - "279", - "280", - "284", - "287", - "293", - "294", - "297", - "298", - "302", - "303", - "305", - "307", - "308", - "314", - "315", - "320", - "321", - "322", - "326", - "327", - "331", - "332", - "333", - "334", - "336", - "338", - "339", - "341", - "343", - "344", - "345", - "347", - "349", - "350", - "352", - "354", - "355", - "357", - "362", - "363", - "366", - "367", - "370", - "376", - "378", - "380", - "381", - "383", - "385", - "386", - "387", - "389", - "391", - "392", - "393", - "394", - "395", - "396", - "399", - "400", - "401", - "403", - "405", - "407", - "408", - "409", - "411", - "412", - "414", - "415", - "417", - "422", - "423" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/rangetypes.metadata.json b/parser/testdata/parse/postgres_regress/rangetypes.metadata.json index dce7b76..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/rangetypes.metadata.json +++ b/parser/testdata/parse/postgres_regress/rangetypes.metadata.json @@ -1,117 +1,3 @@ { - "todo": [ - "042", - "043", - "103", - "104", - "105", - "114", - "115", - "116", - "118", - "119", - "120", - "122", - "123", - "124", - "126", - "127", - "128", - "129", - "130", - "131", - "163", - "164", - "172", - "173", - "174", - "175", - "196", - "197", - "198", - "219", - "220", - "241", - "242", - "250", - "251", - "252", - "264", - "265", - "266", - "278", - "279", - "291", - "293", - "294", - "295", - "296", - "297", - "299", - "301", - "302", - "304", - "305", - "306", - "313", - "316", - "317", - "319", - "322", - "323", - "324", - "326", - "327", - "328", - "331", - "332", - "333", - "336", - "337", - "338", - "341", - "342", - "343", - "344", - "347", - "350", - "354", - "355", - "357", - "360", - "361", - "366", - "367", - "369", - "370", - "371", - "372", - "374", - "375", - "377", - "379", - "381", - "383", - "385", - "386", - "387", - "388", - "389", - "390", - "391", - "392", - "393", - "394", - "395", - "396", - "397", - "398", - "399", - "400", - "401", - "402", - "404", - "406", - "407" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/regex.metadata.json b/parser/testdata/parse/postgres_regress/regex.metadata.json index 7727796..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/regex.metadata.json +++ b/parser/testdata/parse/postgres_regress/regex.metadata.json @@ -1,14 +1,3 @@ { - "todo": [ - "001", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/regproc.metadata.json b/parser/testdata/parse/postgres_regress/regproc.metadata.json index 6120e61..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/regproc.metadata.json +++ b/parser/testdata/parse/postgres_regress/regproc.metadata.json @@ -1,6 +1,3 @@ { - "todo": [ - "001", - "037" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/reindex_catalog.metadata.json b/parser/testdata/parse/postgres_regress/reindex_catalog.metadata.json index 229dde4..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/reindex_catalog.metadata.json +++ b/parser/testdata/parse/postgres_regress/reindex_catalog.metadata.json @@ -1,24 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/reloptions.metadata.json b/parser/testdata/parse/postgres_regress/reloptions.metadata.json index 6b8d7c4..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/reloptions.metadata.json +++ b/parser/testdata/parse/postgres_regress/reloptions.metadata.json @@ -1,47 +1,3 @@ { - "todo": [ - "001", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "021", - "023", - "025", - "027", - "029", - "031", - "032", - "035", - "038", - "041", - "043", - "044", - "047", - "049", - "051", - "052", - "053", - "056", - "058", - "059", - "060", - "061", - "062", - "064", - "065" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/replica_identity.metadata.json b/parser/testdata/parse/postgres_regress/replica_identity.metadata.json index 1a54433..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/replica_identity.metadata.json +++ b/parser/testdata/parse/postgres_regress/replica_identity.metadata.json @@ -1,49 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "022", - "024", - "025", - "026", - "029", - "032", - "034", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/returning.metadata.json b/parser/testdata/parse/postgres_regress/returning.metadata.json index 8a183ee..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/returning.metadata.json +++ b/parser/testdata/parse/postgres_regress/returning.metadata.json @@ -1,24 +1,3 @@ { - "todo": [ - "001", - "015", - "017", - "029", - "030", - "031", - "034", - "035", - "040", - "045", - "050", - "053", - "056", - "057", - "058", - "061", - "062", - "063", - "067", - "069" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/roleattributes.metadata.json b/parser/testdata/parse/postgres_regress/roleattributes.metadata.json index 9e54757..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/roleattributes.metadata.json +++ b/parser/testdata/parse/postgres_regress/roleattributes.metadata.json @@ -1,52 +1,3 @@ { - "todo": [ - "001", - "003", - "005", - "007", - "009", - "011", - "013", - "015", - "017", - "019", - "021", - "023", - "025", - "027", - "029", - "031", - "033", - "035", - "037", - "039", - "041", - "043", - "045", - "047", - "049", - "051", - "053", - "055", - "057", - "059", - "061", - "063", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/rowsecurity.metadata.json b/parser/testdata/parse/postgres_regress/rowsecurity.metadata.json index de7bd30..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/rowsecurity.metadata.json +++ b/parser/testdata/parse/postgres_regress/rowsecurity.metadata.json @@ -1,531 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "029", - "030", - "032", - "033", - "035", - "036", - "037", - "038", - "039", - "041", - "042", - "046", - "050", - "051", - "052", - "055", - "056", - "059", - "060", - "061", - "062", - "063", - "066", - "069", - "070", - "071", - "072", - "073", - "074", - "077", - "080", - "085", - "086", - "089", - "090", - "093", - "094", - "097", - "098", - "101", - "102", - "105", - "106", - "107", - "108", - "109", - "111", - "112", - "114", - "115", - "116", - "118", - "119", - "120", - "121", - "122", - "124", - "126", - "128", - "130", - "132", - "134", - "136", - "137", - "138", - "140", - "141", - "142", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "155", - "156", - "157", - "159", - "160", - "162", - "163", - "165", - "166", - "168", - "175", - "176", - "177", - "178", - "182", - "183", - "185", - "186", - "187", - "188", - "189", - "190", - "192", - "194", - "195", - "196", - "199", - "200", - "203", - "204", - "207", - "208", - "211", - "212", - "213", - "214", - "216", - "217", - "218", - "219", - "220", - "221", - "222", - "223", - "224", - "225", - "226", - "227", - "228", - "230", - "231", - "232", - "233", - "234", - "235", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "245", - "246", - "247", - "248", - "249", - "250", - "251", - "252", - "254", - "255", - "257", - "259", - "260", - "261", - "262", - "263", - "264", - "265", - "266", - "269", - "270", - "271", - "272", - "274", - "275", - "276", - "277", - "279", - "281", - "282", - "283", - "284", - "288", - "289", - "290", - "292", - "294", - "297", - "298", - "299", - "301", - "302", - "303", - "305", - "310", - "312", - "314", - "316", - "318", - "320", - "321", - "323", - "324", - "325", - "326", - "329", - "330", - "332", - "333", - "334", - "335", - "336", - "337", - "338", - "339", - "344", - "346", - "348", - "350", - "351", - "352", - "353", - "354", - "355", - "356", - "367", - "368", - "369", - "370", - "371", - "372", - "375", - "376", - "377", - "378", - "382", - "383", - "384", - "385", - "386", - "387", - "388", - "390", - "400", - "401", - "403", - "404", - "408", - "409", - "410", - "411", - "419", - "420", - "422", - "423", - "424", - "425", - "427", - "428", - "429", - "430", - "432", - "434", - "436", - "438", - "439", - "441", - "442", - "443", - "444", - "445", - "447", - "448", - "449", - "450", - "451", - "453", - "454", - "455", - "456", - "457", - "458", - "459", - "460", - "462", - "463", - "465", - "466", - "467", - "468", - "469", - "470", - "472", - "473", - "475", - "476", - "478", - "479", - "480", - "481", - "483", - "484", - "485", - "487", - "488", - "490", - "491", - "493", - "494", - "495", - "496", - "498", - "499", - "501", - "502", - "503", - "504", - "505", - "506", - "507", - "508", - "509", - "510", - "512", - "513", - "515", - "516", - "518", - "519", - "520", - "521", - "522", - "523", - "524", - "525", - "527", - "528", - "530", - "531", - "533", - "534", - "535", - "536", - "538", - "539", - "541", - "542", - "543", - "544", - "546", - "547", - "549", - "550", - "551", - "552", - "554", - "555", - "556", - "557", - "558", - "559", - "561", - "562", - "563", - "564", - "565", - "566", - "567", - "570", - "574", - "575", - "576", - "577", - "578", - "579", - "580", - "581", - "582", - "583", - "584", - "585", - "586", - "587", - "588", - "589", - "590", - "591", - "592", - "594", - "595", - "596", - "598", - "600", - "601", - "604", - "606", - "607", - "608", - "609", - "610", - "611", - "612", - "613", - "614", - "615", - "617", - "618", - "619", - "620", - "621", - "622", - "623", - "624", - "625", - "626", - "627", - "629", - "631", - "636", - "637", - "639", - "641", - "642", - "644", - "646", - "647", - "651", - "652", - "653", - "654", - "655", - "656", - "659", - "662", - "663", - "664", - "665", - "668", - "669", - "670", - "671", - "672", - "673", - "675", - "676", - "678", - "679", - "680", - "682", - "683", - "685", - "686", - "687", - "688", - "689", - "690", - "691", - "693", - "694", - "696", - "698", - "699", - "701", - "703", - "704", - "706", - "708", - "709", - "711", - "713", - "714", - "715", - "716", - "717", - "718", - "720", - "721", - "723", - "725", - "726", - "728", - "730", - "731", - "733", - "735", - "736", - "738", - "740", - "741", - "742", - "744", - "745", - "747", - "749", - "750", - "752", - "754", - "755", - "757", - "759", - "760", - "762", - "764", - "765", - "768", - "769", - "771", - "772", - "773", - "775" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/rowtypes.metadata.json b/parser/testdata/parse/postgres_regress/rowtypes.metadata.json index b995227..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/rowtypes.metadata.json +++ b/parser/testdata/parse/postgres_regress/rowtypes.metadata.json @@ -1,65 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "020", - "026", - "029", - "030", - "038", - "061", - "063", - "065", - "067", - "069", - "073", - "074", - "075", - "077", - "079", - "094", - "095", - "099", - "113", - "116", - "119", - "122", - "123", - "137", - "142", - "147", - "152", - "155", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "170", - "171", - "172", - "173", - "174", - "175", - "191", - "194", - "205", - "209", - "210", - "213", - "216", - "218", - "220", - "222", - "224", - "225", - "226", - "227", - "228", - "229", - "237" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/rules.metadata.json b/parser/testdata/parse/postgres_regress/rules.metadata.json index 8645f17..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/rules.metadata.json +++ b/parser/testdata/parse/postgres_regress/rules.metadata.json @@ -1,241 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "229", - "230", - "231", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "275", - "276", - "277", - "289", - "290", - "291", - "292", - "293", - "294", - "312", - "313", - "316", - "317", - "318", - "319", - "320", - "321", - "329", - "330", - "340", - "341", - "342", - "346", - "347", - "348", - "353", - "354", - "355", - "356", - "359", - "361", - "362", - "371", - "372", - "373", - "374", - "377", - "378", - "379", - "381", - "384", - "385", - "386", - "404", - "407", - "408", - "409", - "410", - "411", - "412", - "413", - "414", - "415", - "416", - "417", - "418", - "419", - "420", - "421", - "428", - "429", - "435", - "436", - "437", - "438", - "439", - "440", - "441", - "442", - "443", - "449", - "450", - "452", - "454", - "456", - "457", - "461", - "462", - "464", - "469", - "471", - "475", - "476", - "477", - "478", - "479", - "480", - "481", - "482", - "483", - "484", - "485", - "486", - "490", - "491", - "492", - "493", - "494", - "497", - "498", - "499", - "500", - "501", - "502", - "503", - "504", - "505", - "506", - "507", - "508", - "509", - "510", - "511", - "512", - "513", - "514", - "519", - "520", - "522", - "524", - "533", - "535", - "537", - "538", - "539", - "540", - "555", - "556", - "557", - "558", - "559", - "560", - "561", - "562", - "563", - "564", - "567", - "568", - "569", - "571", - "572", - "573", - "574", - "575", - "576", - "577", - "578", - "579", - "580", - "581", - "583", - "585", - "586", - "588", - "590", - "594", - "595", - "596", - "597", - "598", - "599", - "600", - "601", - "602", - "604", - "605", - "606", - "607", - "608", - "609", - "610", - "612", - "615", - "616", - "617", - "618", - "619", - "620" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/sanity_check.metadata.json b/parser/testdata/parse/postgres_regress/sanity_check.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/sanity_check.metadata.json +++ b/parser/testdata/parse/postgres_regress/sanity_check.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/security_label.metadata.json b/parser/testdata/parse/postgres_regress/security_label.metadata.json index d49a93c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/security_label.metadata.json +++ b/parser/testdata/parse/postgres_regress/security_label.metadata.json @@ -1,32 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/select.metadata.json b/parser/testdata/parse/postgres_regress/select.metadata.json index 28aa1ac..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/select.metadata.json +++ b/parser/testdata/parse/postgres_regress/select.metadata.json @@ -1,37 +1,3 @@ { - "todo": [ - "008", - "009", - "010", - "011", - "015", - "016", - "017", - "028", - "031", - "038", - "039", - "044", - "045", - "050", - "051", - "056", - "058", - "059", - "061", - "063", - "065", - "067", - "069", - "070", - "072", - "073", - "075", - "078", - "081", - "084", - "085", - "086", - "087" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/select_distinct.metadata.json b/parser/testdata/parse/postgres_regress/select_distinct.metadata.json index 4a190f6..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/select_distinct.metadata.json +++ b/parser/testdata/parse/postgres_regress/select_distinct.metadata.json @@ -1,52 +1,3 @@ { - "todo": [ - "006", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "049", - "051", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/select_distinct_on.metadata.json b/parser/testdata/parse/postgres_regress/select_distinct_on.metadata.json index da6f0cc..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/select_distinct_on.metadata.json +++ b/parser/testdata/parse/postgres_regress/select_distinct_on.metadata.json @@ -1,7 +1,3 @@ { - "todo": [ - "005", - "007", - "008" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/select_having.metadata.json b/parser/testdata/parse/postgres_regress/select_having.metadata.json index 36b740f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/select_having.metadata.json +++ b/parser/testdata/parse/postgres_regress/select_having.metadata.json @@ -1,6 +1,3 @@ { - "todo": [ - "001", - "023" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/select_implicit.metadata.json b/parser/testdata/parse/postgres_regress/select_implicit.metadata.json index b9415e3..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/select_implicit.metadata.json +++ b/parser/testdata/parse/postgres_regress/select_implicit.metadata.json @@ -1,10 +1,3 @@ { - "todo": [ - "001", - "028", - "040", - "042", - "043", - "044" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/select_into.metadata.json b/parser/testdata/parse/postgres_regress/select_into.metadata.json index aef44e9..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/select_into.metadata.json +++ b/parser/testdata/parse/postgres_regress/select_into.metadata.json @@ -1,54 +1,3 @@ { - "todo": [ - "002", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "012", - "013", - "014", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "025", - "026", - "027", - "029", - "030", - "031", - "032", - "033", - "034", - "039", - "040", - "041", - "042", - "043", - "044", - "047", - "048", - "049", - "053", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "065", - "066", - "067" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/select_parallel.metadata.json b/parser/testdata/parse/postgres_regress/select_parallel.metadata.json index a737edd..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/select_parallel.metadata.json +++ b/parser/testdata/parse/postgres_regress/select_parallel.metadata.json @@ -1,193 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "009", - "010", - "011", - "013", - "014", - "015", - "016", - "017", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "028", - "029", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "039", - "040", - "042", - "043", - "044", - "045", - "046", - "048", - "049", - "051", - "054", - "055", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "074", - "076", - "078", - "079", - "081", - "083", - "084", - "085", - "086", - "087", - "088", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "105", - "107", - "109", - "110", - "111", - "112", - "113", - "114", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "127", - "128", - "129", - "130", - "132", - "133", - "134", - "135", - "137", - "138", - "140", - "141", - "142", - "144", - "145", - "146", - "148", - "150", - "151", - "153", - "154", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "175", - "176", - "177", - "178", - "179", - "180", - "181", - "182", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "195", - "196", - "197", - "198", - "199", - "200", - "202", - "203", - "204", - "205", - "208", - "211", - "212", - "213", - "214", - "215", - "216", - "217", - "220", - "223", - "224", - "225", - "226", - "227", - "228", - "229", - "231", - "232", - "233", - "235" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/select_views.metadata.json b/parser/testdata/parse/postgres_regress/select_views.metadata.json index 27a506f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/select_views.metadata.json +++ b/parser/testdata/parse/postgres_regress/select_views.metadata.json @@ -1,36 +1,3 @@ { - "todo": [ - "004", - "005", - "006", - "007", - "008", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "026", - "028", - "030", - "032", - "034", - "036", - "038", - "040", - "045", - "046", - "047", - "048", - "051", - "052" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/sequence.metadata.json b/parser/testdata/parse/postgres_regress/sequence.metadata.json index c8125d5..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/sequence.metadata.json +++ b/parser/testdata/parse/postgres_regress/sequence.metadata.json @@ -1,160 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "044", - "061", - "062", - "075", - "077", - "078", - "079", - "084", - "085", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "103", - "105", - "106", - "107", - "113", - "119", - "125", - "131", - "135", - "139", - "140", - "141", - "142", - "147", - "149", - "152", - "154", - "155", - "156", - "157", - "158", - "159", - "162", - "163", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "174", - "175", - "176", - "177", - "178", - "179", - "181", - "182", - "183", - "184", - "185", - "186", - "188", - "189", - "190", - "191", - "193", - "194", - "196", - "197", - "198", - "199", - "201", - "202", - "204", - "205", - "206", - "207", - "209", - "210", - "212", - "213", - "214", - "215", - "217", - "218", - "220", - "221", - "222", - "223", - "225", - "226", - "228", - "229", - "230", - "231", - "233", - "234", - "236", - "237", - "238", - "239", - "240", - "241", - "243", - "244", - "247", - "248", - "249", - "250", - "251", - "252", - "254", - "255", - "256", - "260" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/spgist.metadata.json b/parser/testdata/parse/postgres_regress/spgist.metadata.json index bd3d21f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/spgist.metadata.json +++ b/parser/testdata/parse/postgres_regress/spgist.metadata.json @@ -1,22 +1,3 @@ { - "todo": [ - "001", - "002", - "005", - "010", - "011", - "013", - "015", - "016", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "027", - "029", - "030" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/sqljson.metadata.json b/parser/testdata/parse/postgres_regress/sqljson.metadata.json index 26aba7f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/sqljson.metadata.json +++ b/parser/testdata/parse/postgres_regress/sqljson.metadata.json @@ -1,49 +1,3 @@ { - "todo": [ - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "036", - "037", - "048", - "049", - "103", - "104", - "105", - "107", - "108", - "109", - "163", - "164", - "165", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179", - "180", - "181", - "182", - "183", - "184", - "194", - "200", - "201", - "202", - "208", - "211", - "212", - "213", - "215", - "217", - "219" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/sqljson_jsontable.metadata.json b/parser/testdata/parse/postgres_regress/sqljson_jsontable.metadata.json index 86f93ab..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/sqljson_jsontable.metadata.json +++ b/parser/testdata/parse/postgres_regress/sqljson_jsontable.metadata.json @@ -1,42 +1,3 @@ { - "todo": [ - "010", - "012", - "016", - "017", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "066", - "067", - "073", - "091", - "095", - "096", - "097", - "104", - "105", - "106", - "112", - "113", - "114", - "115", - "116", - "117" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/sqljson_queryfuncs.metadata.json b/parser/testdata/parse/postgres_regress/sqljson_queryfuncs.metadata.json index d905161..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/sqljson_queryfuncs.metadata.json +++ b/parser/testdata/parse/postgres_regress/sqljson_queryfuncs.metadata.json @@ -1,70 +1,3 @@ { - "todo": [ - "055", - "061", - "062", - "131", - "132", - "135", - "176", - "180", - "181", - "182", - "200", - "209", - "210", - "211", - "212", - "213", - "214", - "215", - "216", - "217", - "218", - "219", - "220", - "221", - "222", - "223", - "224", - "225", - "226", - "227", - "228", - "229", - "230", - "231", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "248", - "249", - "250", - "255", - "256", - "257", - "267", - "268", - "270", - "271", - "280", - "291", - "292", - "301", - "302", - "310" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/stats.metadata.json b/parser/testdata/parse/postgres_regress/stats.metadata.json index cab46d0..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/stats.metadata.json +++ b/parser/testdata/parse/postgres_regress/stats.metadata.json @@ -1,193 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "019", - "025", - "027", - "029", - "030", - "033", - "035", - "037", - "038", - "039", - "042", - "045", - "047", - "048", - "049", - "052", - "054", - "056", - "058", - "060", - "061", - "066", - "067", - "069", - "071", - "072", - "080", - "081", - "083", - "085", - "088", - "089", - "091", - "095", - "097", - "100", - "103", - "104", - "105", - "108", - "110", - "112", - "113", - "114", - "117", - "120", - "123", - "128", - "134", - "137", - "139", - "145", - "148", - "150", - "155", - "157", - "160", - "161", - "162", - "164", - "168", - "169", - "170", - "171", - "172", - "173", - "176", - "177", - "178", - "179", - "180", - "181", - "183", - "184", - "185", - "186", - "190", - "193", - "194", - "195", - "196", - "197", - "199", - "200", - "203", - "206", - "207", - "208", - "209", - "210", - "213", - "217", - "218", - "219", - "220", - "221", - "224", - "228", - "229", - "230", - "231", - "232", - "235", - "238", - "240", - "242", - "246", - "247", - "253", - "254", - "255", - "256", - "291", - "292", - "298", - "299", - "300", - "303", - "307", - "311", - "316", - "317", - "319", - "323", - "325", - "326", - "330", - "332", - "336", - "340", - "342", - "343", - "345", - "350", - "355", - "356", - "361", - "362", - "364", - "369", - "370", - "371", - "372", - "373", - "374", - "376", - "380", - "381", - "382", - "391", - "395", - "396", - "398", - "400", - "401", - "406", - "408", - "417", - "419", - "420", - "424", - "425", - "426", - "428", - "430", - "432", - "433", - "435", - "436", - "438", - "440", - "442", - "443", - "444", - "447" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/stats_ext.metadata.json b/parser/testdata/parse/postgres_regress/stats_ext.metadata.json index 726a504..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/stats_ext.metadata.json +++ b/parser/testdata/parse/postgres_regress/stats_ext.metadata.json @@ -1,365 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "039", - "040", - "041", - "042", - "043", - "044", - "046", - "047", - "048", - "049", - "050", - "052", - "054", - "055", - "057", - "058", - "059", - "060", - "061", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "072", - "073", - "074", - "075", - "076", - "077", - "081", - "084", - "085", - "090", - "091", - "092", - "094", - "095", - "099", - "100", - "101", - "102", - "104", - "106", - "107", - "108", - "110", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "139", - "149", - "150", - "162", - "164", - "175", - "189", - "190", - "195", - "199", - "200", - "205", - "206", - "208", - "216", - "217", - "218", - "226", - "227", - "228", - "236", - "237", - "238", - "246", - "247", - "248", - "256", - "257", - "258", - "259", - "260", - "268", - "269", - "270", - "271", - "272", - "274", - "277", - "278", - "281", - "282", - "284", - "287", - "288", - "291", - "292", - "294", - "320", - "321", - "348", - "350", - "352", - "378", - "379", - "406", - "408", - "414", - "415", - "416", - "422", - "423", - "425", - "428", - "429", - "432", - "433", - "435", - "438", - "439", - "442", - "443", - "445", - "470", - "471", - "497", - "499", - "501", - "503", - "504", - "506", - "517", - "518", - "519", - "520", - "531", - "532", - "533", - "534", - "535", - "547", - "548", - "550", - "556", - "557", - "563", - "565", - "567", - "568", - "570", - "574", - "575", - "580", - "582", - "585", - "586", - "589", - "590", - "592", - "593", - "594", - "596", - "601", - "602", - "607", - "611", - "620", - "621", - "630", - "631", - "633", - "641", - "642", - "643", - "651", - "652", - "654", - "657", - "658", - "661", - "662", - "663", - "665", - "669", - "670", - "674", - "675", - "677", - "679", - "680", - "682", - "683", - "684", - "686", - "688", - "689", - "690", - "692", - "693", - "694", - "695", - "696", - "697", - "698", - "699", - "700", - "701", - "702", - "703", - "704", - "705", - "707", - "708", - "709", - "710", - "711", - "712", - "713", - "714", - "715", - "716", - "717", - "718", - "719", - "720", - "721", - "722", - "723", - "724", - "725", - "728", - "729", - "730", - "731", - "735", - "736", - "737", - "738", - "742", - "743", - "744", - "745", - "746", - "750", - "751", - "752", - "753", - "757", - "758", - "759", - "760", - "761", - "765", - "766", - "768", - "769", - "770", - "771", - "774", - "775", - "776", - "779", - "780", - "781", - "782", - "783", - "784", - "785", - "786", - "787", - "788", - "789", - "790", - "791", - "792", - "793", - "794", - "795", - "796", - "797", - "798", - "799", - "800", - "801", - "802", - "803", - "804", - "805", - "806", - "807", - "808", - "809", - "810", - "811", - "812", - "813", - "814", - "815", - "816" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/subscription.metadata.json b/parser/testdata/parse/postgres_regress/subscription.metadata.json index 546b760..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/subscription.metadata.json +++ b/parser/testdata/parse/postgres_regress/subscription.metadata.json @@ -1,155 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "032", - "033", - "034", - "035", - "036", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "105", - "106", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "119", - "120", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/subselect.metadata.json b/parser/testdata/parse/postgres_regress/subselect.metadata.json index a9d0cea..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/subselect.metadata.json +++ b/parser/testdata/parse/postgres_regress/subselect.metadata.json @@ -1,115 +1,3 @@ { - "todo": [ - "014", - "032", - "034", - "040", - "042", - "043", - "044", - "048", - "049", - "050", - "052", - "053", - "054", - "059", - "060", - "071", - "083", - "085", - "086", - "087", - "088", - "089", - "093", - "099", - "101", - "105", - "108", - "113", - "117", - "119", - "121", - "126", - "130", - "132", - "134", - "139", - "144", - "147", - "152", - "156", - "158", - "162", - "163", - "164", - "165", - "167", - "168", - "170", - "171", - "173", - "174", - "176", - "178", - "179", - "180", - "182", - "183", - "186", - "187", - "188", - "189", - "190", - "192", - "194", - "196", - "197", - "200", - "203", - "205", - "207", - "210", - "212", - "215", - "216", - "218", - "219", - "221", - "223", - "224", - "226", - "229", - "230", - "231", - "235", - "236", - "237", - "239", - "241", - "242", - "244", - "246", - "248", - "249", - "250", - "251", - "252", - "253", - "254", - "255", - "257", - "259", - "260", - "261", - "262", - "263", - "264", - "265", - "266", - "267", - "268", - "269" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/sysviews.metadata.json b/parser/testdata/parse/postgres_regress/sysviews.metadata.json index 84504bc..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/sysviews.metadata.json +++ b/parser/testdata/parse/postgres_regress/sysviews.metadata.json @@ -1,8 +1,3 @@ { - "todo": [ - "004", - "008", - "024", - "026" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/tablesample.metadata.json b/parser/testdata/parse/postgres_regress/tablesample.metadata.json index 9805f86..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/tablesample.metadata.json +++ b/parser/testdata/parse/postgres_regress/tablesample.metadata.json @@ -1,18 +1,3 @@ { - "todo": [ - "001", - "011", - "012", - "013", - "029", - "030", - "031", - "032", - "038", - "052", - "053", - "054", - "055", - "056" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/tablespace.metadata.json b/parser/testdata/parse/postgres_regress/tablespace.metadata.json index 0fc6a12..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/tablespace.metadata.json +++ b/parser/testdata/parse/postgres_regress/tablespace.metadata.json @@ -1,173 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "007", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "025", - "026", - "027", - "028", - "029", - "030", - "031", - "035", - "037", - "038", - "040", - "042", - "046", - "047", - "048", - "049", - "050", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "062", - "063", - "065", - "066", - "067", - "071", - "074", - "076", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "095", - "097", - "098", - "099", - "100", - "101", - "102", - "104", - "105", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "115", - "116", - "117", - "118", - "119", - "120", - "122", - "124", - "125", - "126", - "127", - "128", - "129", - "131", - "132", - "133", - "134", - "135", - "136", - "138", - "140", - "141", - "142", - "143", - "144", - "146", - "147", - "148", - "149", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "170", - "171", - "172", - "174", - "175", - "176", - "177", - "178", - "179", - "180", - "181", - "182", - "183", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "195", - "196", - "197", - "198", - "199", - "200", - "201", - "202", - "203", - "204" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/temp.metadata.json b/parser/testdata/parse/postgres_regress/temp.metadata.json index f0a7ea2..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/temp.metadata.json +++ b/parser/testdata/parse/postgres_regress/temp.metadata.json @@ -1,113 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "006", - "007", - "009", - "010", - "011", - "013", - "016", - "018", - "019", - "021", - "022", - "023", - "027", - "029", - "030", - "031", - "033", - "035", - "036", - "037", - "041", - "043", - "044", - "046", - "048", - "049", - "051", - "053", - "054", - "055", - "056", - "057", - "060", - "063", - "064", - "065", - "066", - "067", - "069", - "071", - "072", - "075", - "078", - "082", - "083", - "084", - "088", - "089", - "090", - "091", - "093", - "095", - "096", - "097", - "098", - "099", - "101", - "103", - "104", - "105", - "106", - "108", - "111", - "112", - "113", - "114", - "116", - "118", - "119", - "120", - "123", - "126", - "127", - "128", - "129", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "149", - "150", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "162" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/test_setup.metadata.json b/parser/testdata/parse/postgres_regress/test_setup.metadata.json index 10ce81c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/test_setup.metadata.json +++ b/parser/testdata/parse/postgres_regress/test_setup.metadata.json @@ -1,56 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "007", - "008", - "010", - "011", - "013", - "014", - "016", - "017", - "019", - "020", - "022", - "024", - "025", - "027", - "028", - "030", - "031", - "032", - "033", - "035", - "036", - "037", - "038", - "040", - "041", - "043", - "044", - "046", - "047", - "049", - "050", - "052", - "053", - "055", - "056", - "058", - "059", - "060", - "061", - "062", - "063", - "064", - "065", - "066", - "067", - "068", - "069" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/tid.metadata.json b/parser/testdata/parse/postgres_regress/tid.metadata.json index 9b7b7f5..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/tid.metadata.json +++ b/parser/testdata/parse/postgres_regress/tid.metadata.json @@ -1,24 +1,3 @@ { - "todo": [ - "008", - "012", - "013", - "016", - "018", - "019", - "020", - "022", - "023", - "025", - "026", - "028", - "029", - "031", - "032", - "036", - "037", - "038", - "040", - "041" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/tidrangescan.metadata.json b/parser/testdata/parse/postgres_regress/tidrangescan.metadata.json index e467198..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/tidrangescan.metadata.json +++ b/parser/testdata/parse/postgres_regress/tidrangescan.metadata.json @@ -1,24 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "005", - "009", - "010", - "012", - "014", - "016", - "018", - "020", - "022", - "024", - "026", - "033", - "035", - "036", - "043", - "044", - "045" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/tidscan.metadata.json b/parser/testdata/parse/postgres_regress/tidscan.metadata.json index 96b2f81..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/tidscan.metadata.json +++ b/parser/testdata/parse/postgres_regress/tidscan.metadata.json @@ -1,29 +1,3 @@ { - "todo": [ - "001", - "004", - "006", - "008", - "010", - "012", - "014", - "016", - "017", - "019", - "021", - "022", - "027", - "028", - "032", - "034", - "037", - "038", - "039", - "041", - "042", - "044", - "045", - "048", - "049" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/time.metadata.json b/parser/testdata/parse/postgres_regress/time.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/time.metadata.json +++ b/parser/testdata/parse/postgres_regress/time.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/timestamp.metadata.json b/parser/testdata/parse/postgres_regress/timestamp.metadata.json index 72b72dd..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/timestamp.metadata.json +++ b/parser/testdata/parse/postgres_regress/timestamp.metadata.json @@ -1,12 +1,3 @@ { - "todo": [ - "001", - "002", - "011", - "015", - "022", - "023", - "055", - "058" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/timestamptz.metadata.json b/parser/testdata/parse/postgres_regress/timestamptz.metadata.json index 40d874f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/timestamptz.metadata.json +++ b/parser/testdata/parse/postgres_regress/timestamptz.metadata.json @@ -1,50 +1,3 @@ { - "todo": [ - "001", - "002", - "013", - "017", - "024", - "025", - "057", - "060", - "171", - "173", - "175", - "177", - "179", - "181", - "183", - "185", - "187", - "189", - "190", - "192", - "194", - "196", - "198", - "200", - "202", - "204", - "206", - "208", - "209", - "217", - "218", - "237", - "243", - "249", - "250", - "316", - "329", - "354", - "355", - "358", - "361", - "362", - "365", - "366", - "367", - "369" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/timetz.metadata.json b/parser/testdata/parse/postgres_regress/timetz.metadata.json index b35a27a..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/timetz.metadata.json +++ b/parser/testdata/parse/postgres_regress/timetz.metadata.json @@ -1,9 +1,3 @@ { - "todo": [ - "001", - "051", - "052", - "053", - "057" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/transactions.metadata.json b/parser/testdata/parse/postgres_regress/transactions.metadata.json index 8df280b..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/transactions.metadata.json +++ b/parser/testdata/parse/postgres_regress/transactions.metadata.json @@ -1,323 +1,3 @@ { - "todo": [ - "001", - "002", - "005", - "007", - "008", - "011", - "014", - "016", - "017", - "018", - "020", - "021", - "022", - "024", - "025", - "026", - "027", - "028", - "029", - "030", - "032", - "033", - "034", - "035", - "036", - "037", - "039", - "040", - "042", - "043", - "044", - "045", - "046", - "047", - "048", - "049", - "051", - "052", - "053", - "054", - "055", - "056", - "057", - "059", - "060", - "061", - "062", - "064", - "065", - "066", - "067", - "068", - "076", - "077", - "078", - "079", - "080", - "081", - "082", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "090", - "091", - "092", - "093", - "094", - "099", - "101", - "103", - "104", - "105", - "107", - "108", - "109", - "111", - "112", - "113", - "115", - "118", - "119", - "121", - "122", - "123", - "124", - "125", - "127", - "129", - "131", - "132", - "133", - "135", - "136", - "138", - "139", - "141", - "143", - "144", - "146", - "148", - "151", - "153", - "155", - "157", - "159", - "162", - "164", - "166", - "168", - "171", - "173", - "175", - "177", - "179", - "181", - "183", - "185", - "187", - "189", - "191", - "193", - "195", - "197", - "198", - "199", - "200", - "201", - "202", - "204", - "205", - "206", - "208", - "210", - "212", - "214", - "216", - "220", - "222", - "224", - "225", - "227", - "229", - "230", - "233", - "234", - "235", - "238", - "239", - "240", - "243", - "244", - "245", - "248", - "249", - "250", - "251", - "254", - "255", - "258", - "259", - "260", - "261", - "262", - "263", - "266", - "267", - "268", - "269", - "270", - "275", - "277", - "278", - "279", - "285", - "287", - "289", - "290", - "291", - "292", - "296", - "299", - "302", - "303", - "304", - "305", - "306", - "307", - "308", - "309", - "310", - "313", - "314", - "315", - "316", - "319", - "320", - "321", - "322", - "324", - "325", - "326", - "327", - "328", - "329", - "331", - "332", - "333", - "334", - "336", - "337", - "338", - "339", - "340", - "341", - "342", - "343", - "344", - "345", - "346", - "347", - "348", - "349", - "350", - "351", - "352", - "353", - "354", - "355", - "356", - "357", - "358", - "359", - "360", - "362", - "363", - "364", - "365", - "367", - "368", - "369", - "370", - "371", - "372", - "373", - "375", - "376", - "377", - "387", - "388", - "390", - "391", - "392", - "394", - "395", - "397", - "399", - "401", - "403", - "405", - "409", - "412", - "414", - "416", - "417", - "419", - "421", - "422", - "423", - "426", - "429", - "430", - "431", - "432", - "433", - "434", - "435", - "436", - "437", - "438", - "439", - "441", - "443", - "445", - "447", - "449", - "451", - "453", - "455", - "456", - "458", - "459", - "460", - "461", - "463", - "464", - "465", - "466", - "467", - "469", - "471", - "472", - "473", - "475", - "477", - "478", - "479", - "481", - "482", - "483", - "484", - "485", - "486", - "487", - "488", - "490" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/triggers.metadata.json b/parser/testdata/parse/postgres_regress/triggers.metadata.json index 6ce3339..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/triggers.metadata.json +++ b/parser/testdata/parse/postgres_regress/triggers.metadata.json @@ -1,692 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "043", - "044", - "045", - "046", - "047", - "054", - "055", - "062", - "069", - "076", - "077", - "078", - "081", - "085", - "089", - "090", - "091", - "092", - "093", - "1000", - "1001", - "1002", - "1007", - "1008", - "1009", - "1011", - "1012", - "1014", - "1016", - "1017", - "1018", - "1019", - "1020", - "1021", - "1022", - "1023", - "1024", - "1026", - "1027", - "1029", - "1030", - "1031", - "1032", - "1033", - "1034", - "1035", - "1036", - "1037", - "1038", - "1039", - "1041", - "1042", - "1043", - "1044", - "1045", - "1046", - "1047", - "1049", - "1050", - "1051", - "1052", - "1053", - "1054", - "1055", - "1056", - "117", - "118", - "119", - "120", - "122", - "123", - "124", - "125", - "127", - "131", - "134", - "135", - "136", - "137", - "138", - "139", - "149", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "160", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "172", - "173", - "174", - "175", - "176", - "181", - "182", - "183", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "195", - "196", - "197", - "198", - "199", - "200", - "201", - "202", - "204", - "206", - "208", - "210", - "212", - "214", - "219", - "224", - "225", - "226", - "227", - "228", - "232", - "233", - "234", - "235", - "236", - "237", - "243", - "247", - "248", - "249", - "250", - "251", - "253", - "254", - "256", - "258", - "259", - "261", - "266", - "267", - "268", - "269", - "270", - "271", - "272", - "273", - "274", - "275", - "276", - "277", - "278", - "279", - "280", - "281", - "282", - "283", - "284", - "285", - "286", - "287", - "288", - "289", - "290", - "291", - "296", - "302", - "303", - "304", - "305", - "307", - "308", - "309", - "310", - "311", - "312", - "313", - "314", - "329", - "331", - "332", - "336", - "337", - "338", - "347", - "348", - "349", - "350", - "351", - "352", - "353", - "354", - "355", - "356", - "357", - "363", - "364", - "365", - "366", - "367", - "368", - "369", - "370", - "371", - "372", - "373", - "374", - "375", - "376", - "389", - "393", - "394", - "395", - "396", - "397", - "398", - "399", - "400", - "401", - "402", - "412", - "413", - "414", - "415", - "416", - "417", - "418", - "419", - "422", - "423", - "424", - "425", - "426", - "428", - "430", - "431", - "432", - "433", - "434", - "435", - "436", - "446", - "447", - "448", - "449", - "450", - "451", - "452", - "453", - "454", - "455", - "456", - "457", - "458", - "459", - "460", - "461", - "462", - "463", - "464", - "465", - "466", - "467", - "468", - "469", - "470", - "472", - "473", - "474", - "475", - "477", - "479", - "480", - "481", - "482", - "483", - "484", - "485", - "486", - "487", - "488", - "490", - "491", - "492", - "493", - "494", - "495", - "496", - "497", - "498", - "499", - "500", - "501", - "502", - "503", - "504", - "505", - "506", - "507", - "508", - "509", - "510", - "511", - "512", - "513", - "514", - "515", - "516", - "517", - "518", - "519", - "520", - "521", - "522", - "523", - "524", - "525", - "531", - "533", - "535", - "536", - "537", - "538", - "539", - "540", - "541", - "542", - "543", - "544", - "546", - "547", - "548", - "549", - "551", - "552", - "553", - "554", - "555", - "558", - "559", - "560", - "561", - "562", - "563", - "564", - "565", - "567", - "568", - "569", - "570", - "571", - "572", - "573", - "574", - "575", - "576", - "577", - "578", - "579", - "583", - "584", - "585", - "586", - "587", - "589", - "592", - "595", - "599", - "600", - "604", - "605", - "606", - "608", - "613", - "614", - "615", - "616", - "617", - "618", - "623", - "624", - "625", - "626", - "627", - "628", - "629", - "630", - "631", - "632", - "636", - "637", - "638", - "641", - "642", - "643", - "644", - "645", - "646", - "647", - "648", - "649", - "650", - "651", - "652", - "653", - "656", - "657", - "658", - "659", - "660", - "661", - "662", - "663", - "664", - "665", - "666", - "667", - "668", - "669", - "671", - "672", - "673", - "674", - "675", - "676", - "677", - "678", - "679", - "680", - "681", - "685", - "686", - "687", - "688", - "689", - "690", - "691", - "692", - "694", - "695", - "696", - "697", - "698", - "699", - "700", - "702", - "704", - "705", - "706", - "707", - "708", - "710", - "711", - "713", - "715", - "717", - "718", - "719", - "721", - "723", - "724", - "725", - "726", - "727", - "729", - "731", - "733", - "734", - "736", - "737", - "739", - "740", - "741", - "744", - "750", - "751", - "752", - "753", - "754", - "755", - "756", - "757", - "758", - "759", - "760", - "761", - "762", - "763", - "764", - "765", - "766", - "767", - "768", - "769", - "770", - "771", - "772", - "773", - "787", - "788", - "789", - "790", - "791", - "792", - "793", - "794", - "795", - "796", - "797", - "800", - "801", - "804", - "805", - "806", - "807", - "808", - "809", - "810", - "811", - "812", - "813", - "814", - "815", - "816", - "817", - "818", - "819", - "820", - "821", - "822", - "825", - "826", - "829", - "830", - "831", - "832", - "833", - "834", - "835", - "836", - "837", - "838", - "839", - "840", - "841", - "842", - "843", - "844", - "845", - "846", - "847", - "860", - "862", - "863", - "864", - "865", - "866", - "867", - "868", - "869", - "870", - "871", - "872", - "874", - "875", - "876", - "877", - "878", - "879", - "880", - "881", - "882", - "883", - "884", - "885", - "886", - "887", - "892", - "893", - "894", - "895", - "896", - "900", - "901", - "902", - "903", - "904", - "905", - "906", - "910", - "911", - "912", - "913", - "914", - "915", - "916", - "917", - "918", - "919", - "926", - "927", - "928", - "929", - "931", - "932", - "933", - "934", - "935", - "936", - "937", - "940", - "943", - "944", - "945", - "946", - "947", - "948", - "953", - "954", - "955", - "956", - "957", - "958", - "959", - "960", - "961", - "963", - "966", - "967", - "968", - "969", - "970", - "971", - "972", - "974", - "976", - "978", - "980", - "982", - "984", - "986", - "988", - "989", - "990", - "991", - "992", - "993", - "994", - "995", - "996", - "997", - "998", - "999" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/truncate.metadata.json b/parser/testdata/parse/postgres_regress/truncate.metadata.json index fa4974f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/truncate.metadata.json +++ b/parser/testdata/parse/postgres_regress/truncate.metadata.json @@ -1,110 +1,3 @@ { - "todo": [ - "001", - "005", - "006", - "007", - "009", - "010", - "011", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "025", - "026", - "027", - "028", - "034", - "035", - "036", - "037", - "038", - "046", - "049", - "050", - "053", - "055", - "057", - "059", - "061", - "063", - "064", - "066", - "068", - "069", - "073", - "077", - "078", - "082", - "086", - "087", - "088", - "089", - "090", - "092", - "095", - "098", - "099", - "101", - "104", - "107", - "108", - "109", - "110", - "111", - "112", - "116", - "120", - "124", - "128", - "132", - "136", - "137", - "140", - "144", - "146", - "147", - "148", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "161", - "163", - "166", - "169", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179", - "181", - "183", - "185", - "186", - "187", - "188", - "190", - "193" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/tsdicts.metadata.json b/parser/testdata/parse/postgres_regress/tsdicts.metadata.json index 0a1d992..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/tsdicts.metadata.json +++ b/parser/testdata/parse/postgres_regress/tsdicts.metadata.json @@ -1,40 +1,3 @@ { - "todo": [ - "001", - "017", - "033", - "052", - "070", - "071", - "072", - "073", - "074", - "075", - "076", - "081", - "084", - "085", - "088", - "090", - "091", - "095", - "096", - "102", - "106", - "110", - "111", - "116", - "117", - "121", - "122", - "123", - "124", - "125", - "126", - "127", - "128", - "129", - "130", - "131" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/tsearch.metadata.json b/parser/testdata/parse/postgres_regress/tsearch.metadata.json index 7ee8f41..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/tsearch.metadata.json +++ b/parser/testdata/parse/postgres_regress/tsearch.metadata.json @@ -1,54 +1,3 @@ { - "todo": [ - "007", - "009", - "034", - "035", - "036", - "037", - "038", - "063", - "064", - "065", - "090", - "091", - "092", - "093", - "094", - "095", - "096", - "097", - "122", - "123", - "124", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "180", - "182", - "184", - "282", - "285", - "292", - "293", - "299", - "324", - "325", - "339", - "340", - "344", - "348", - "356", - "357", - "358", - "359", - "367", - "370", - "371", - "373" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/tsrf.metadata.json b/parser/testdata/parse/postgres_regress/tsrf.metadata.json index 5981a79..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/tsrf.metadata.json +++ b/parser/testdata/parse/postgres_regress/tsrf.metadata.json @@ -1,20 +1,3 @@ { - "todo": [ - "007", - "009", - "011", - "013", - "019", - "023", - "037", - "044", - "045", - "047", - "065", - "067", - "069", - "071", - "073", - "074" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/tstypes.metadata.json b/parser/testdata/parse/postgres_regress/tstypes.metadata.json index f23fe5c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/tstypes.metadata.json +++ b/parser/testdata/parse/postgres_regress/tstypes.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "001" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/tuplesort.metadata.json b/parser/testdata/parse/postgres_regress/tuplesort.metadata.json index f16dedc..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/tuplesort.metadata.json +++ b/parser/testdata/parse/postgres_regress/tuplesort.metadata.json @@ -1,52 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "015", - "016", - "017", - "019", - "021", - "022", - "023", - "025", - "027", - "028", - "029", - "032", - "033", - "034", - "035", - "038", - "039", - "040", - "041", - "044", - "045", - "046", - "047", - "050", - "052", - "053", - "054", - "070", - "071", - "072", - "073", - "074", - "090", - "092", - "093", - "095", - "096", - "098", - "099", - "100", - "101", - "103", - "104", - "105", - "106" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/txid.metadata.json b/parser/testdata/parse/postgres_regress/txid.metadata.json index 5445416..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/txid.metadata.json +++ b/parser/testdata/parse/postgres_regress/txid.metadata.json @@ -1,16 +1,3 @@ { - "todo": [ - "008", - "024", - "028", - "029", - "031", - "032", - "034", - "035", - "043", - "044", - "045", - "047" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/type_sanity.metadata.json b/parser/testdata/parse/postgres_regress/type_sanity.metadata.json index 5b604f4..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/type_sanity.metadata.json +++ b/parser/testdata/parse/postgres_regress/type_sanity.metadata.json @@ -1,5 +1,3 @@ { - "todo": [ - "060" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/typed_table.metadata.json b/parser/testdata/parse/postgres_regress/typed_table.metadata.json index 6043573..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/typed_table.metadata.json +++ b/parser/testdata/parse/postgres_regress/typed_table.metadata.json @@ -1,28 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "006", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "025", - "027", - "028" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/union.metadata.json b/parser/testdata/parse/postgres_regress/union.metadata.json index 50696b4..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/union.metadata.json +++ b/parser/testdata/parse/postgres_regress/union.metadata.json @@ -1,93 +1,3 @@ { - "todo": [ - "040", - "041", - "043", - "045", - "047", - "048", - "050", - "052", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "063", - "065", - "067", - "069", - "070", - "072", - "074", - "076", - "077", - "078", - "080", - "082", - "084", - "086", - "087", - "089", - "090", - "091", - "093", - "095", - "097", - "098", - "114", - "115", - "116", - "122", - "123", - "124", - "125", - "134", - "135", - "138", - "139", - "140", - "143", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "151", - "154", - "155", - "156", - "157", - "159", - "160", - "161", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "172", - "174", - "176", - "178", - "180", - "181", - "182", - "183", - "184", - "186", - "187", - "188", - "190", - "191" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/updatable_views.metadata.json b/parser/testdata/parse/postgres_regress/updatable_views.metadata.json index 4a87b2f..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/updatable_views.metadata.json +++ b/parser/testdata/parse/postgres_regress/updatable_views.metadata.json @@ -1,457 +1,3 @@ { - "todo": [ - "001", - "002", - "004", - "005", - "006", - "007", - "008", - "009", - "010", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "018", - "019", - "020", - "021", - "022", - "023", - "024", - "068", - "086", - "087", - "088", - "093", - "094", - "095", - "096", - "098", - "1004", - "1006", - "1007", - "1008", - "1009", - "1010", - "1011", - "1013", - "1015", - "1017", - "1018", - "1020", - "1022", - "1024", - "1025", - "1026", - "1027", - "1028", - "1029", - "1030", - "1031", - "1032", - "1033", - "1034", - "1035", - "1046", - "1047", - "1048", - "1059", - "1060", - "1061", - "1062", - "1073", - "1074", - "1075", - "1086", - "1087", - "1088", - "1092", - "1093", - "1094", - "1095", - "1096", - "1099", - "1100", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "118", - "122", - "123", - "124", - "126", - "127", - "141", - "142", - "143", - "144", - "146", - "147", - "151", - "155", - "159", - "169", - "170", - "171", - "172", - "174", - "175", - "179", - "180", - "184", - "188", - "201", - "202", - "203", - "204", - "207", - "210", - "214", - "215", - "216", - "218", - "219", - "222", - "223", - "224", - "225", - "226", - "227", - "228", - "230", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "260", - "261", - "262", - "263", - "264", - "274", - "275", - "276", - "277", - "278", - "279", - "289", - "290", - "291", - "293", - "294", - "299", - "300", - "305", - "306", - "307", - "312", - "317", - "318", - "319", - "324", - "325", - "326", - "331", - "336", - "337", - "338", - "343", - "344", - "345", - "350", - "355", - "356", - "357", - "358", - "360", - "361", - "363", - "364", - "365", - "376", - "377", - "378", - "379", - "390", - "391", - "392", - "398", - "399", - "400", - "401", - "405", - "406", - "407", - "412", - "413", - "414", - "416", - "417", - "418", - "422", - "423", - "424", - "428", - "429", - "430", - "431", - "437", - "441", - "445", - "446", - "447", - "448", - "452", - "456", - "457", - "458", - "459", - "467", - "475", - "476", - "477", - "478", - "486", - "487", - "488", - "492", - "500", - "508", - "509", - "510", - "518", - "526", - "527", - "528", - "529", - "530", - "531", - "535", - "536", - "541", - "542", - "545", - "546", - "547", - "550", - "551", - "552", - "553", - "554", - "556", - "560", - "563", - "564", - "566", - "569", - "570", - "572", - "580", - "588", - "598", - "599", - "600", - "611", - "612", - "613", - "616", - "617", - "639", - "640", - "643", - "647", - "648", - "649", - "651", - "666", - "667", - "668", - "669", - "677", - "682", - "683", - "686", - "690", - "691", - "692", - "693", - "694", - "702", - "703", - "704", - "713", - "714", - "715", - "717", - "722", - "723", - "724", - "725", - "726", - "727", - "728", - "732", - "733", - "734", - "735", - "736", - "737", - "738", - "748", - "752", - "753", - "754", - "762", - "763", - "764", - "765", - "766", - "767", - "769", - "770", - "772", - "773", - "774", - "778", - "786", - "787", - "788", - "789", - "790", - "798", - "799", - "800", - "801", - "802", - "803", - "805", - "806", - "807", - "809", - "811", - "814", - "815", - "816", - "818", - "819", - "820", - "822", - "823", - "824", - "826", - "827", - "828", - "830", - "831", - "834", - "838", - "843", - "844", - "845", - "846", - "847", - "848", - "849", - "853", - "854", - "855", - "856", - "857", - "858", - "859", - "860", - "865", - "866", - "867", - "868", - "869", - "870", - "871", - "872", - "873", - "874", - "875", - "880", - "881", - "882", - "883", - "884", - "886", - "888", - "889", - "898", - "899", - "900", - "901", - "902", - "903", - "904", - "905", - "906", - "907", - "908", - "909", - "910", - "911", - "912", - "915", - "916", - "917", - "918", - "919", - "920", - "921", - "922", - "923", - "924", - "925", - "926", - "934", - "940", - "941", - "942", - "943", - "944", - "946", - "947", - "948", - "949", - "950", - "952", - "954", - "955", - "956", - "958", - "965", - "968", - "969", - "970", - "971", - "973", - "980", - "983", - "987", - "988", - "989", - "990", - "991", - "992", - "994", - "995", - "996", - "997", - "998" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/update.metadata.json b/parser/testdata/parse/postgres_regress/update.metadata.json index fef1acb..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/update.metadata.json +++ b/parser/testdata/parse/postgres_regress/update.metadata.json @@ -1,147 +1,3 @@ { - "todo": [ - "001", - "002", - "035", - "044", - "045", - "046", - "047", - "048", - "049", - "053", - "054", - "055", - "056", - "057", - "058", - "059", - "060", - "061", - "063", - "064", - "065", - "066", - "067", - "068", - "069", - "070", - "071", - "072", - "073", - "082", - "084", - "089", - "091", - "092", - "094", - "095", - "097", - "098", - "099", - "100", - "101", - "102", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "118", - "119", - "120", - "121", - "123", - "124", - "126", - "127", - "128", - "129", - "130", - "131", - "134", - "135", - "136", - "138", - "139", - "141", - "142", - "143", - "144", - "145", - "146", - "147", - "148", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "157", - "158", - "159", - "160", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "183", - "184", - "185", - "186", - "191", - "192", - "193", - "194", - "195", - "196", - "197", - "205", - "206", - "207", - "208", - "209", - "210", - "211", - "212", - "213", - "222", - "223", - "227", - "228", - "229", - "232", - "235", - "236", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "248", - "255", - "256", - "257" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/uuid.metadata.json b/parser/testdata/parse/postgres_regress/uuid.metadata.json index 38e45f6..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/uuid.metadata.json +++ b/parser/testdata/parse/postgres_regress/uuid.metadata.json @@ -1,11 +1,3 @@ { - "todo": [ - "001", - "002", - "023", - "024", - "025", - "034", - "044" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/vacuum.metadata.json b/parser/testdata/parse/postgres_regress/vacuum.metadata.json index 84b7984..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/vacuum.metadata.json +++ b/parser/testdata/parse/postgres_regress/vacuum.metadata.json @@ -1,230 +1,3 @@ { - "todo": [ - "001", - "018", - "034", - "037", - "038", - "039", - "040", - "041", - "042", - "043", - "044", - "046", - "049", - "052", - "053", - "054", - "055", - "056", - "059", - "061", - "062", - "064", - "065", - "066", - "067", - "069", - "070", - "072", - "074", - "075", - "076", - "077", - "078", - "079", - "080", - "081", - "083", - "084", - "085", - "086", - "087", - "088", - "089", - "091", - "092", - "093", - "094", - "096", - "098", - "099", - "100", - "101", - "102", - "103", - "104", - "106", - "107", - "108", - "109", - "110", - "111", - "112", - "113", - "114", - "115", - "116", - "117", - "119", - "120", - "121", - "123", - "124", - "125", - "126", - "127", - "130", - "131", - "132", - "133", - "134", - "135", - "136", - "137", - "139", - "141", - "143", - "144", - "145", - "146", - "149", - "150", - "151", - "152", - "153", - "154", - "155", - "156", - "158", - "159", - "160", - "162", - "163", - "164", - "165", - "166", - "167", - "168", - "169", - "170", - "171", - "172", - "173", - "174", - "175", - "176", - "177", - "178", - "179", - "180", - "181", - "182", - "183", - "184", - "185", - "186", - "187", - "188", - "189", - "190", - "191", - "192", - "193", - "194", - "195", - "196", - "198", - "199", - "200", - "202", - "204", - "205", - "207", - "211", - "214", - "215", - "216", - "217", - "218", - "219", - "220", - "221", - "222", - "223", - "224", - "225", - "226", - "227", - "228", - "229", - "230", - "231", - "232", - "233", - "234", - "235", - "236", - "237", - "238", - "239", - "240", - "241", - "242", - "243", - "244", - "245", - "246", - "247", - "248", - "249", - "250", - "251", - "252", - "253", - "254", - "255", - "256", - "257", - "258", - "259", - "260", - "261", - "262", - "263", - "264", - "265", - "266", - "267", - "268", - "269", - "270", - "271", - "272", - "273", - "274", - "275", - "276", - "277", - "278", - "279", - "280", - "281", - "282", - "283", - "284", - "285", - "286", - "287", - "288", - "289", - "290", - "291", - "292", - "293", - "294", - "295", - "296" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/vacuum_parallel.metadata.json b/parser/testdata/parse/postgres_regress/vacuum_parallel.metadata.json index 17cbadd..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/vacuum_parallel.metadata.json +++ b/parser/testdata/parse/postgres_regress/vacuum_parallel.metadata.json @@ -1,13 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "005", - "006", - "007", - "011", - "013", - "014" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/varchar.metadata.json b/parser/testdata/parse/postgres_regress/varchar.metadata.json index 69a5a4c..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/varchar.metadata.json +++ b/parser/testdata/parse/postgres_regress/varchar.metadata.json @@ -1,6 +1,3 @@ { - "todo": [ - "001", - "017" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/window.metadata.json b/parser/testdata/parse/postgres_regress/window.metadata.json index b3026b2..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/window.metadata.json +++ b/parser/testdata/parse/postgres_regress/window.metadata.json @@ -1,82 +1,3 @@ { - "todo": [ - "001", - "045", - "074", - "077", - "080", - "083", - "086", - "089", - "092", - "093", - "123", - "124", - "125", - "128", - "129", - "130", - "133", - "134", - "136", - "137", - "138", - "145", - "166", - "238", - "241", - "246", - "265", - "266", - "268", - "269", - "270", - "274", - "276", - "278", - "280", - "282", - "283", - "284", - "285", - "287", - "288", - "290", - "292", - "294", - "295", - "296", - "297", - "298", - "299", - "300", - "301", - "302", - "303", - "304", - "305", - "306", - "307", - "308", - "310", - "311", - "314", - "315", - "316", - "317", - "318", - "319", - "320", - "321", - "322", - "323", - "329", - "330", - "379", - "380", - "381", - "382", - "384", - "385" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/with.metadata.json b/parser/testdata/parse/postgres_regress/with.metadata.json index 4a322fd..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/with.metadata.json +++ b/parser/testdata/parse/postgres_regress/with.metadata.json @@ -1,79 +1,3 @@ { - "todo": [ - "006", - "008", - "018", - "033", - "037", - "041", - "046", - "049", - "050", - "051", - "052", - "054", - "057", - "060", - "062", - "070", - "073", - "078", - "081", - "097", - "098", - "109", - "117", - "130", - "149", - "150", - "155", - "173", - "176", - "177", - "181", - "182", - "186", - "188", - "189", - "190", - "191", - "193", - "195", - "197", - "205", - "206", - "216", - "217", - "218", - "222", - "225", - "228", - "229", - "230", - "232", - "239", - "241", - "242", - "245", - "246", - "249", - "250", - "251", - "254", - "255", - "256", - "257", - "258", - "270", - "275", - "277", - "279", - "281", - "283", - "285", - "286", - "287", - "290", - "293" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/write_parallel.metadata.json b/parser/testdata/parse/postgres_regress/write_parallel.metadata.json index 48bdd37..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/write_parallel.metadata.json +++ b/parser/testdata/parse/postgres_regress/write_parallel.metadata.json @@ -1,24 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008", - "009", - "011", - "012", - "013", - "014", - "015", - "016", - "017", - "019", - "020", - "021", - "022" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/xid.metadata.json b/parser/testdata/parse/postgres_regress/xid.metadata.json index 8cbb110..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/xid.metadata.json +++ b/parser/testdata/parse/postgres_regress/xid.metadata.json @@ -1,20 +1,3 @@ { - "todo": [ - "027", - "030", - "031", - "032", - "045", - "061", - "065", - "066", - "068", - "069", - "071", - "072", - "080", - "081", - "082", - "084" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/xml.metadata.json b/parser/testdata/parse/postgres_regress/xml.metadata.json index b150a01..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/xml.metadata.json +++ b/parser/testdata/parse/postgres_regress/xml.metadata.json @@ -1,34 +1,3 @@ { - "todo": [ - "001", - "035", - "037", - "121", - "125", - "134", - "135", - "136", - "137", - "138", - "139", - "140", - "141", - "142", - "143", - "144", - "163", - "184", - "191", - "206", - "214", - "217", - "219", - "220", - "224", - "242", - "244", - "245", - "250", - "254" - ] + "todo": [] } diff --git a/parser/testdata/parse/postgres_regress/xmlmap.metadata.json b/parser/testdata/parse/postgres_regress/xmlmap.metadata.json index c07ab38..737fd31 100644 --- a/parser/testdata/parse/postgres_regress/xmlmap.metadata.json +++ b/parser/testdata/parse/postgres_regress/xmlmap.metadata.json @@ -1,12 +1,3 @@ { - "todo": [ - "001", - "002", - "004", - "005", - "006", - "036", - "037", - "038" - ] + "todo": [] } diff --git a/parser/testdata/split_parser/libpg_query.metadata.json b/parser/testdata/split_parser/libpg_query.metadata.json index 5e6664a..737fd31 100644 --- a/parser/testdata/split_parser/libpg_query.metadata.json +++ b/parser/testdata/split_parser/libpg_query.metadata.json @@ -1,12 +1,3 @@ { - "todo": [ - "001", - "002", - "003", - "004", - "005", - "006", - "007", - "008" - ] + "todo": [] }