(ctx *EvalContext, op ComparisonOperator, left, right Datum)
| 4525 | } |
| 4526 | |
| 4527 | func 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 |
no test coverage detected
searching dependent graphs…