Compare implements the Datum interface.
(ctx *EvalContext, other Datum)
| 2598 | |
| 2599 | // Compare implements the Datum interface. |
| 2600 | func (d *DInterval) Compare(ctx *EvalContext, other Datum) int { |
| 2601 | if other == DNull { |
| 2602 | // NULL is less than any non-NULL value. |
| 2603 | return 1 |
| 2604 | } |
| 2605 | v, ok := UnwrapDatum(ctx, other).(*DInterval) |
| 2606 | if !ok { |
| 2607 | panic(makeUnsupportedComparisonMessage(d, other)) |
| 2608 | } |
| 2609 | return d.Duration.Compare(v.Duration) |
| 2610 | } |
| 2611 | |
| 2612 | // Prev implements the Datum interface. |
| 2613 | func (d *DInterval) Prev(_ *EvalContext) (Datum, bool) { |
nothing calls this directly
no test coverage detected