From 2db9c50440566ed357eecb6942af3ce89821ad70 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Mon, 19 Jan 2026 19:09:36 +0300 Subject: [PATCH] refactor(ast): Removed redundant type ast.Const (no parsers which produce instance of this type) --- internal/sql/ast/const.go | 17 ----------------- internal/sql/astutils/rewrite.go | 3 --- internal/sql/astutils/walk.go | 5 ----- 3 files changed, 25 deletions(-) delete mode 100644 internal/sql/ast/const.go diff --git a/internal/sql/ast/const.go b/internal/sql/ast/const.go deleted file mode 100644 index d33f0e84ed..0000000000 --- a/internal/sql/ast/const.go +++ /dev/null @@ -1,17 +0,0 @@ -package ast - -type Const struct { - Xpr Node - Consttype Oid - Consttypmod int32 - Constcollid Oid - Constlen int - Constvalue Datum - Constisnull bool - Constbyval bool - Location int -} - -func (n *Const) Pos() int { - return n.Location -} diff --git a/internal/sql/astutils/rewrite.go b/internal/sql/astutils/rewrite.go index fc7996b5f5..bb3010b560 100644 --- a/internal/sql/astutils/rewrite.go +++ b/internal/sql/astutils/rewrite.go @@ -496,9 +496,6 @@ func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast. case *ast.CompositeTypeStmt: a.apply(n, "TypeName", nil, n.TypeName) - case *ast.Const: - a.apply(n, "Xpr", nil, n.Xpr) - case *ast.Constraint: a.apply(n, "RawExpr", nil, n.RawExpr) a.apply(n, "Keys", nil, n.Keys) diff --git a/internal/sql/astutils/walk.go b/internal/sql/astutils/walk.go index 6d5e80bdc3..f208e6631d 100644 --- a/internal/sql/astutils/walk.go +++ b/internal/sql/astutils/walk.go @@ -665,11 +665,6 @@ func Walk(f Visitor, node ast.Node) { Walk(f, n.Ctecolcollations) } - case *ast.Const: - if n.Xpr != nil { - Walk(f, n.Xpr) - } - case *ast.Constraint: if n.RawExpr != nil { Walk(f, n.RawExpr)