fix(tsdb): Fix panic, don't add nil iterator to slice

fixes #10171
pull/10188/head
Stuart Carnie 2018-08-08 12:14:50 -07:00
parent f70fb7a631
commit 990824ceca
1 changed files with 8 additions and 4 deletions

View File

@ -2179,10 +2179,11 @@ func (is IndexSet) matchTagValueEqualEmptySeriesIDIterator(name, key []byte, val
itr, err := is.tagValueSeriesIDIterator(name, key, e)
if err != nil {
return err
}
} else if itr != nil {
itrs = append(itrs, itr)
}
}
}
return nil
}(); err != nil {
SeriesIDIterators(itrs).Close()
@ -2222,10 +2223,11 @@ func (is IndexSet) matchTagValueEqualNotEmptySeriesIDIterator(name, key []byte,
if err != nil {
SeriesIDIterators(itrs).Close()
return nil, err
}
} else if itr != nil {
itrs = append(itrs, itr)
}
}
}
return MergeSeriesIDIterators(itrs...), nil
}
@ -2253,10 +2255,11 @@ func (is IndexSet) matchTagValueNotEqualEmptySeriesIDIterator(name, key []byte,
if err != nil {
SeriesIDIterators(itrs).Close()
return nil, err
}
} else if itr != nil {
itrs = append(itrs, itr)
}
}
}
return MergeSeriesIDIterators(itrs...), nil
}
@ -2283,10 +2286,11 @@ func (is IndexSet) matchTagValueNotEqualNotEmptySeriesIDIterator(name, key []byt
if err != nil {
SeriesIDIterators(itrs).Close()
return nil, err
}
} else if itr != nil {
itrs = append(itrs, itr)
}
}
}
mitr, err := is.measurementSeriesIDIterator(name)
if err != nil {