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

Method Compare

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

Compare implements the Datum interface.

(ctx *EvalContext, other Datum)

Source from the content-addressed store, hash-verified

1109
1110// Compare implements the Datum interface.
1111func (d *DString) Compare(ctx *EvalContext, other Datum) int {
1112 if other == DNull {
1113 // NULL is less than any non-NULL value.
1114 return 1
1115 }
1116 v, ok := UnwrapDatum(ctx, other).(*DString)
1117 if !ok {
1118 panic(makeUnsupportedComparisonMessage(d, other))
1119 }
1120 if *d < *v {
1121 return -1
1122 }
1123 if *d > *v {
1124 return 1
1125 }
1126 return 0
1127}
1128
1129// Prev implements the Datum interface.
1130func (d *DString) Prev(_ *EvalContext) (Datum, bool) {

Callers

nothing calls this directly

Calls 2

UnwrapDatumFunction · 0.85

Tested by

no test coverage detected