From 8f85a9e88d7fac080244f6a0946b2db42f7a33cb Mon Sep 17 00:00:00 2001 From: reesporte Date: Thu, 18 Nov 2021 17:27:13 -0600 Subject: [PATCH] fix bug where timestamp val is wrong in Min/Max --- executor.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/executor.go b/executor.go index 74e565aed..e6c719eb5 100644 --- a/executor.go +++ b/executor.go @@ -1157,6 +1157,7 @@ func (e *executor) executeMin(ctx context.Context, qcx *Qcx, index string, c *pq if other.Count == 0 { return ValCount{}, nil } + return other, nil } @@ -7575,8 +7576,11 @@ func (vc *ValCount) smaller(other ValCount) ValCount { extra += other.Count } return ValCount{ - Val: vc.Val, - Count: vc.Count + extra, + Val: vc.Val, + Count: vc.Count + extra, + DecimalVal: vc.DecimalVal, + FloatVal: vc.FloatVal, + TimestampVal: vc.TimestampVal, } } @@ -7626,9 +7630,13 @@ func (vc *ValCount) larger(other ValCount) ValCount { extra += other.Count } return ValCount{ - Val: vc.Val, - Count: vc.Count + extra, + Val: vc.Val, + Count: vc.Count + extra, + DecimalVal: vc.DecimalVal, + FloatVal: vc.FloatVal, + TimestampVal: vc.TimestampVal, } + } func (vc *ValCount) decimalLarger(other ValCount) ValCount {