Skip to content

Commit

Permalink
fix: Store.validateArgs wrongfully overwriting start, end unix time (#…
Browse files Browse the repository at this point in the history
…25146) (#25165)

When querying data before 1970-01-01 (UNIX time 0)
validateArgs would set start to -in64 max and end to int64 max.

closes #24669

Co-authored-by: Paul Hegenberg <paul.hegenberg@gmail.com>

closes #25149
  • Loading branch information
davidby-influx authored Jul 16, 2024
1 parent 176fca2 commit c4bfaa8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/storage/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ func (s *Store) validateArgs(database, rp string, start, end int64) (string, str
return "", "", 0, 0, errors.New("invalid retention policy")
}

if start <= 0 {
if start <= models.MinNanoTime {
start = models.MinNanoTime
}
if end <= 0 {
if end >= models.MaxNanoTime {
end = models.MaxNanoTime
}
return database, rp, start, end, nil
Expand Down

0 comments on commit c4bfaa8

Please sign in to comment.