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

Method Compare

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

Compare implements the Datum interface.

(ctx *EvalContext, other Datum)

Source from the content-addressed store, hash-verified

1386
1387// Compare implements the Datum interface.
1388func (d *DBytes) Compare(ctx *EvalContext, other Datum) int {
1389 if other == DNull {
1390 // NULL is less than any non-NULL value.
1391 return 1
1392 }
1393 v, ok := UnwrapDatum(ctx, other).(*DBytes)
1394 if !ok {
1395 panic(makeUnsupportedComparisonMessage(d, other))
1396 }
1397 if *d < *v {
1398 return -1
1399 }
1400 if *d > *v {
1401 return 1
1402 }
1403 return 0
1404}
1405
1406// Prev implements the Datum interface.
1407func (d *DBytes) Prev(_ *EvalContext) (Datum, bool) {

Callers

nothing calls this directly

Calls 2

UnwrapDatumFunction · 0.85

Tested by

no test coverage detected