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

Function evalComparison

pkg/sql/sem/tree/eval.go:4527–4538  ·  view source on GitHub ↗
(ctx *EvalContext, op ComparisonOperator, left, right Datum)

Source from the content-addressed store, hash-verified

4525}
4526
4527func evalComparison(ctx *EvalContext, op ComparisonOperator, left, right Datum) (Datum, error) {
4528 if left == DNull || right == DNull {
4529 return DNull, nil
4530 }
4531 ltype := left.ResolvedType()
4532 rtype := right.ResolvedType()
4533 if fn, ok := CmpOps[op].LookupImpl(ltype, rtype); ok {
4534 return fn.Fn(ctx, left, right)
4535 }
4536 return nil, pgerror.Newf(
4537 pgcode.UndefinedFunction, "unsupported comparison operator: <%s> %s <%s>", ltype, op, rtype)
4538}
4539
4540// foldComparisonExpr folds a given comparison operation and its expressions
4541// into an equivalent operation that will hit in the CmpOps map, returning

Callers 3

EvalMethod · 0.85
EvalMethod · 0.85
PickFromTupleFunction · 0.85

Calls 3

NewfFunction · 0.92
ResolvedTypeMethod · 0.65
LookupImplMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…