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

Method IsDistinctFrom

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

IsDistinctFrom checks to see if two datums are distinct from each other. Any change in value is considered distinct, however, a NULL value is NOT considered disctinct from another NULL value.

(evalCtx *EvalContext, other Datums)

Source from the content-addressed store, hash-verified

183// change in value is considered distinct, however, a NULL value is NOT
184// considered disctinct from another NULL value.
185func (d Datums) IsDistinctFrom(evalCtx *EvalContext, other Datums) bool {
186 if len(d) != len(other) {
187 return true
188 }
189 for i, val := range d {
190 if val == DNull {
191 if other[i] != DNull {
192 return true
193 }
194 } else {
195 if val.Compare(evalCtx, other[i]) != 0 {
196 return true
197 }
198 }
199 }
200 return false
201}
202
203// CompositeDatum is a Datum that may require composite encoding in
204// indexes. Any Datum implementing this interface must also add itself to

Callers

nothing calls this directly

Calls 1

CompareMethod · 0.65

Tested by

no test coverage detected