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

Method Eval

pkg/sql/sem/tree/eval.go:4170–4183  ·  view source on GitHub ↗

Eval implements the TypedExpr interface.

(ctx *EvalContext)

Source from the content-addressed store, hash-verified

4168
4169// Eval implements the TypedExpr interface.
4170func (expr *IsOfTypeExpr) Eval(ctx *EvalContext) (Datum, error) {
4171 d, err := expr.Expr.(TypedExpr).Eval(ctx)
4172 if err != nil {
4173 return nil, err
4174 }
4175 datumTyp := d.ResolvedType()
4176
4177 for _, t := range expr.Types {
4178 if datumTyp.Equivalent(t) {
4179 return MakeDBool(DBool(!expr.Not)), nil
4180 }
4181 }
4182 return MakeDBool(DBool(expr.Not)), nil
4183}
4184
4185// Eval implements the TypedExpr interface.
4186func (expr *NotExpr) Eval(ctx *EvalContext) (Datum, error) {

Callers

nothing calls this directly

Calls 5

MakeDBoolFunction · 0.85
DBoolTypeAlias · 0.85
EquivalentMethod · 0.80
EvalMethod · 0.65
ResolvedTypeMethod · 0.65

Tested by

no test coverage detected