diff --git a/executor.go b/executor.go index e6c719eb5..b361d9672 100644 --- a/executor.go +++ b/executor.go @@ -1157,7 +1157,6 @@ func (e *executor) executeMin(ctx context.Context, qcx *Qcx, index string, c *pq if other.Count == 0 { return ValCount{}, nil } - return other, nil } diff --git a/executor_internal_test.go b/executor_internal_test.go index ce860c46c..8337bb296 100644 --- a/executor_internal_test.go +++ b/executor_internal_test.go @@ -21,6 +21,7 @@ import ( "reflect" "strconv" "testing" + "time" "github.com/molecula/featurebase/v2/pql" "github.com/molecula/featurebase/v2/testhook" @@ -301,6 +302,20 @@ func TestValCountComparisons(t *testing.T) { expLarger: ValCount{FloatVal: 10.7, Count: 3}, expSmaller: ValCount{FloatVal: 10.7, Count: 3}, }, + { + name: "timestampEquality", + vc: ValCount{Val: -17782800, TimestampVal: time.Unix(0, -17782800*int64(time.Second)), Count: 1}, + other: ValCount{Val: -17782800, TimestampVal: time.Unix(0, -17782800*int64(time.Second)), Count: 1}, + expLarger: ValCount{Val: -17782800, TimestampVal: time.Unix(0, -17782800*int64(time.Second)), Count: 2}, + expSmaller: ValCount{Val: -17782800, TimestampVal: time.Unix(0, -17782800*int64(time.Second)), Count: 2}, + }, + { + name: "timestamp", + vc: ValCount{Val: -17782800, TimestampVal: time.Unix(0, -17782800*int64(time.Second)), Count: 1}, + other: ValCount{Val: 1587399600, TimestampVal: time.Unix(0, 1587399600*int64(time.Second)), Count: 1}, + expLarger: ValCount{Val: 1587399600, TimestampVal: time.Unix(0, 1587399600*int64(time.Second)), Count: 1}, + expSmaller: ValCount{Val: -17782800, TimestampVal: time.Unix(0, -17782800*int64(time.Second)), Count: 1}, + }, } for i, test := range tests {