lib/storage: fix broken BenchmarkHeadPostingForMatchers for {i=~".*"} after f4dead529f

The commit f4dead529f makes such query to return nothing instead of all the time series.
This aligns more with Prometheus behaviour.
This commit is contained in:
Aliaksandr Valialkin 2022-02-12 00:27:08 +02:00
parent 791cad8c2e
commit 21a42e990f
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
2 changed files with 2 additions and 2 deletions

View file

@ -206,7 +206,7 @@ func BenchmarkHeadPostingForMatchers(b *testing.B) {
b.Run(`i=~".*"`, func(b *testing.B) {
tfs := NewTagFilters(accountID, projectID)
addTagFilter(tfs, "i", ".*", false, true)
benchSearch(b, tfs, 5e6)
benchSearch(b, tfs, 0)
})
b.Run(`i=~".+"`, func(b *testing.B) {
tfs := NewTagFilters(accountID, projectID)

View file

@ -168,7 +168,7 @@ func (tfs *TagFilters) Add(key, value []byte, isNegative, isRegexp bool) error {
}
if isRegexp && string(value) == ".*" {
if !isNegative {
// Skip tag filter matching anything, since it equal to no filter.
// Skip tag filter matching anything, since it equals to no filter.
return nil
}