Compare implements the Datum interface.
(ctx *EvalContext, other Datum)
| 1806 | |
| 1807 | // Compare implements the Datum interface. |
| 1808 | func (d *DDate) Compare(ctx *EvalContext, other Datum) int { |
| 1809 | if other == DNull { |
| 1810 | // NULL is less than any non-NULL value. |
| 1811 | return 1 |
| 1812 | } |
| 1813 | var v DDate |
| 1814 | switch t := UnwrapDatum(ctx, other).(type) { |
| 1815 | case *DDate: |
| 1816 | v = *t |
| 1817 | case *DTimestamp, *DTimestampTZ: |
| 1818 | return compareTimestamps(ctx, d, other) |
| 1819 | default: |
| 1820 | panic(makeUnsupportedComparisonMessage(d, other)) |
| 1821 | } |
| 1822 | return d.Date.Compare(v.Date) |
| 1823 | } |
| 1824 | |
| 1825 | var ( |
| 1826 | epochDate, _ = pgdate.MakeDateFromPGEpoch(0) |
nothing calls this directly
no test coverage detected