MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / normalize

Method normalize

pkg/sql/sem/tree/normalize.go:647–665  ·  view source on GitHub ↗
(v *NormalizeVisitor)

Source from the content-addressed store, hash-verified

645}
646
647func (expr *Tuple) normalize(v *NormalizeVisitor) TypedExpr {
648 // A Tuple should be directly evaluated into a DTuple if it's either fully
649 // constant or contains only constants and top-level Placeholders.
650 isConst := true
651 for _, subExpr := range expr.Exprs {
652 if !v.isConst(subExpr) {
653 isConst = false
654 break
655 }
656 }
657 if !isConst {
658 return expr
659 }
660 e, err := expr.Eval(v.ctx)
661 if err != nil {
662 v.err = err
663 }
664 return e
665}
666
667// NormalizeExpr normalizes a typed expression, simplifying where possible,
668// but guaranteeing that the result of evaluating the expression is

Callers

nothing calls this directly

Calls 2

EvalMethod · 0.95
isConstMethod · 0.45

Tested by

no test coverage detected