Skip to content

Commit

Permalink
Implemented WalkableSQLNode for InjectedExpr
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmu committed Jan 29, 2025
1 parent 3b45b8c commit aede188
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions go/vt/sqlparser/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -8133,6 +8133,7 @@ type InjectedExpr struct {

var _ Expr = InjectedExpr{}
var _ AuthNode = InjectedExpr{}
var _ WalkableSQLNode = InjectedExpr{}

// iExpr implements the Expr interface.
func (d InjectedExpr) iExpr() {}
Expand Down Expand Up @@ -8176,6 +8177,17 @@ func (d InjectedExpr) SetExtra(extra any) {
d.Auth.Extra = extra
}

func (d InjectedExpr) walkSubtree(visit Visit) error {
for _, child := range d.Children {
err := Walk(visit, child)
if err != nil {
return err
}
}

return nil
}

// InjectedStatement allows bypassing AST analysis. This is used by projects that rely on Vitess, but may not implement
// MySQL's dialect.
type InjectedStatement struct {
Expand Down

0 comments on commit aede188

Please sign in to comment.