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

Method Compare

pkg/sql/sem/tree/datum.go:377–387  ·  view source on GitHub ↗

Compare implements the Datum interface.

(ctx *EvalContext, other Datum)

Source from the content-addressed store, hash-verified

375
376// Compare implements the Datum interface.
377func (d *DBool) Compare(ctx *EvalContext, other Datum) int {
378 if other == DNull {
379 // NULL is less than any non-NULL value.
380 return 1
381 }
382 v, ok := UnwrapDatum(ctx, other).(*DBool)
383 if !ok {
384 panic(makeUnsupportedComparisonMessage(d, other))
385 }
386 return CompareBools(bool(*d), bool(*v))
387}
388
389// CompareBools compares the input bools according to the SQL comparison rules.
390func CompareBools(d, v bool) int {

Callers

nothing calls this directly

Calls 3

UnwrapDatumFunction · 0.85
CompareBoolsFunction · 0.85

Tested by

no test coverage detected