Compare implements the Datum interface.
(ctx *EvalContext, other Datum)
| 1109 | |
| 1110 | // Compare implements the Datum interface. |
| 1111 | func (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. |
| 1130 | func (d *DString) Prev(_ *EvalContext) (Datum, bool) { |
nothing calls this directly
no test coverage detected