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

Function boolFromCmp

pkg/sql/sem/tree/eval.go:2269–2280  ·  view source on GitHub ↗
(cmp int, op ComparisonOperator)

Source from the content-addressed store, hash-verified

2267}
2268
2269func boolFromCmp(cmp int, op ComparisonOperator) *DBool {
2270 switch op {
2271 case EQ, IsNotDistinctFrom:
2272 return MakeDBool(cmp == 0)
2273 case LT:
2274 return MakeDBool(cmp < 0)
2275 case LE:
2276 return MakeDBool(cmp <= 0)
2277 default:
2278 panic(errors.AssertionFailedf("unexpected ComparisonOperator in boolFromCmp: %v", errors.Safe(op)))
2279 }
2280}
2281
2282func cmpOpScalarFn(ctx *EvalContext, left, right Datum, op ComparisonOperator) Datum {
2283 // Before deferring to the Datum.Compare method, check for values that should

Callers 2

cmpOpScalarFnFunction · 0.85
cmpOpTupleFnFunction · 0.85

Calls 1

MakeDBoolFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…