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

Method Eval

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

Eval implements the TypedExpr interface.

(ctx *EvalContext)

Source from the content-addressed store, hash-verified

3279
3280// Eval implements the TypedExpr interface.
3281func (expr *CastExpr) Eval(ctx *EvalContext) (Datum, error) {
3282 d, err := expr.Expr.(TypedExpr).Eval(ctx)
3283 if err != nil {
3284 return nil, err
3285 }
3286
3287 // NULL cast to anything is NULL.
3288 if d == DNull {
3289 return d, nil
3290 }
3291 d = UnwrapDatum(ctx, d)
3292 return PerformCast(ctx, d, expr.Type)
3293}
3294
3295// PerformCast performs a cast from the provided Datum to the specified
3296// types.T.

Callers 1

EvalMethod · 0.95

Calls 3

UnwrapDatumFunction · 0.85
PerformCastFunction · 0.85
EvalMethod · 0.65

Tested by

no test coverage detected