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

Method Compare

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

Compare implements the Datum interface.

(ctx *EvalContext, other Datum)

Source from the content-addressed store, hash-verified

1488
1489// Compare implements the Datum interface.
1490func (d *DUuid) Compare(ctx *EvalContext, other Datum) int {
1491 if other == DNull {
1492 // NULL is less than any non-NULL value.
1493 return 1
1494 }
1495 v, ok := UnwrapDatum(ctx, other).(*DUuid)
1496 if !ok {
1497 panic(makeUnsupportedComparisonMessage(d, other))
1498 }
1499 return bytes.Compare(d.GetBytes(), v.GetBytes())
1500}
1501
1502func (d *DUuid) equal(other *DUuid) bool {
1503 return bytes.Equal(d.GetBytes(), other.GetBytes())

Callers

nothing calls this directly

Calls 4

UnwrapDatumFunction · 0.85
CompareMethod · 0.65
GetBytesMethod · 0.45

Tested by

no test coverage detected