Compare implements the Datum interface.
( ctx context.Context, cmpCtx CompareContext, other Datum, )
| 1409 | |
| 1410 | // Compare implements the Datum interface. |
| 1411 | func (d *DCollatedString) Compare( |
| 1412 | ctx context.Context, cmpCtx CompareContext, other Datum, |
| 1413 | ) (int, error) { |
| 1414 | if other == DNull { |
| 1415 | // NULL is less than any non-NULL value. |
| 1416 | return 1, nil |
| 1417 | } |
| 1418 | v, ok := cmpCtx.UnwrapDatum(ctx, other).(*DCollatedString) |
| 1419 | if !ok || !lex.LocaleNamesAreEqual(d.Locale, v.Locale) { |
| 1420 | return 0, makeUnsupportedComparisonMessage(d, other) |
| 1421 | } |
| 1422 | res := bytes.Compare(d.Key, v.Key) |
| 1423 | return res, nil |
| 1424 | } |
| 1425 | |
| 1426 | // Prev implements the Datum interface. |
| 1427 | func (d *DCollatedString) Prev(ctx context.Context, cmpCtx CompareContext) (Datum, bool) { |
nothing calls this directly
no test coverage detected