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

Method Compare

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

Compare implements the Datum interface.

(ctx *EvalContext, other Datum)

Source from the content-addressed store, hash-verified

2598
2599// Compare implements the Datum interface.
2600func (d *DInterval) Compare(ctx *EvalContext, other Datum) int {
2601 if other == DNull {
2602 // NULL is less than any non-NULL value.
2603 return 1
2604 }
2605 v, ok := UnwrapDatum(ctx, other).(*DInterval)
2606 if !ok {
2607 panic(makeUnsupportedComparisonMessage(d, other))
2608 }
2609 return d.Duration.Compare(v.Duration)
2610}
2611
2612// Prev implements the Datum interface.
2613func (d *DInterval) Prev(_ *EvalContext) (Datum, bool) {

Callers

nothing calls this directly

Calls 3

UnwrapDatumFunction · 0.85
CompareMethod · 0.65

Tested by

no test coverage detected