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

Method Compare

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

Compare implements the Datum interface.

(ctx *EvalContext, other Datum)

Source from the content-addressed store, hash-verified

1299
1300// Compare implements the Datum interface.
1301func (d *DCollatedString) Compare(ctx *EvalContext, other Datum) int {
1302 if other == DNull {
1303 // NULL is less than any non-NULL value.
1304 return 1
1305 }
1306 v, ok := UnwrapDatum(ctx, other).(*DCollatedString)
1307 if !ok || d.Locale != v.Locale {
1308 panic(makeUnsupportedComparisonMessage(d, other))
1309 }
1310 return bytes.Compare(d.Key, v.Key)
1311}
1312
1313// Prev implements the Datum interface.
1314func (d *DCollatedString) Prev(_ *EvalContext) (Datum, bool) {

Callers

nothing calls this directly

Calls 3

UnwrapDatumFunction · 0.85
CompareMethod · 0.65

Tested by

no test coverage detected