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

Method Compare

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

Compare implements the Datum interface.

(ctx *EvalContext, other Datum)

Source from the content-addressed store, hash-verified

1607
1608// Compare implements the Datum interface.
1609func (d *DIPAddr) Compare(ctx *EvalContext, other Datum) int {
1610 if other == DNull {
1611 // NULL is less than any non-NULL value.
1612 return 1
1613 }
1614 v, ok := UnwrapDatum(ctx, other).(*DIPAddr)
1615 if !ok {
1616 panic(makeUnsupportedComparisonMessage(d, other))
1617 }
1618
1619 return d.IPAddr.Compare(&v.IPAddr)
1620}
1621
1622func (d DIPAddr) equal(other *DIPAddr) bool {
1623 return d.IPAddr.Equal(&other.IPAddr)

Callers

nothing calls this directly

Calls 3

UnwrapDatumFunction · 0.85
CompareMethod · 0.65

Tested by

no test coverage detected