Skip to content

Commit

Permalink
Fix bug in subqueryexpr
Browse files Browse the repository at this point in the history
If the subeval statement was in the past the start time would have been
incorrect
  • Loading branch information
jacksontj committed Feb 26, 2023
1 parent 33cfab4 commit e5912ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/proxystorage/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e5912ad

Please sign in to comment.