From e5912ad8a686db0f997df82c05848ee373693503 Mon Sep 17 00:00:00 2001 From: Thomas Jackson Date: Sat, 25 Feb 2023 20:45:14 -0800 Subject: [PATCH] Fix bug in subqueryexpr If the subeval statement was in the past the start time would have been incorrect --- pkg/proxystorage/proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/proxystorage/proxy.go b/pkg/proxystorage/proxy.go index 5977bb84e..fc08f142e 100644 --- a/pkg/proxystorage/proxy.go +++ b/pkg/proxystorage/proxy.go @@ -598,7 +598,7 @@ func (p *ProxyStorage) NodeReplacer(ctx context.Context, s *parser.EvalStmt, nod subEvalStmt.Start = s.Start.Add(-n.Offset).Add(-n.Range).Truncate(subEvalStmt.Interval) if subEvalStmt.Start.Before(s.Start.Add(-n.Offset).Add(-n.Range)) { - subEvalStmt.Start.Add(subEvalStmt.Interval) + subEvalStmt.Start = subEvalStmt.Start.Add(subEvalStmt.Interval) } newN, err := parser.Inspect(ctx, &subEvalStmt, func(parser.Node, []parser.Node) error { return nil }, p.NodeReplacer)