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

Method evalArgs

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

EvalArgsAndGetGenerator evaluates the arguments and instanciates a ValueGenerator for use by set projections. func (expr *FuncExpr) EvalArgsAndGetGenerator(ctx *EvalContext) (ValueGenerator, error) { if expr.fn == nil || expr.fnProps.Class != GeneratorClass { return nil, errors.AssertionFailedf("

(ctx *EvalContext)

Source from the content-addressed store, hash-verified

4064// evalArgs evaluates just the function application's arguments.
4065// The returned bool indicates that the NULL should be propagated.
4066func (expr *FuncExpr) evalArgs(ctx *EvalContext) (bool, Datums, error) {
4067 args := make(Datums, len(expr.Exprs))
4068 for i, e := range expr.Exprs {
4069 arg, err := e.(TypedExpr).Eval(ctx)
4070 if err != nil {
4071 return false, nil, err
4072 }
4073 if arg == DNull && !expr.fnProps.NullableArgs {
4074 return true, nil, nil
4075 }
4076 args[i] = arg
4077 }
4078 return false, args, nil
4079}
4080
4081// Eval implements the TypedExpr interface.
4082func (expr *FuncExpr) Eval(ctx *EvalContext) (Datum, error) {

Callers 1

EvalMethod · 0.95

Calls 1

EvalMethod · 0.65

Tested by

no test coverage detected