diff --git a/pkg/local_object_storage/metabase/select.go b/pkg/local_object_storage/metabase/select.go index 0f53a8f3..998ce9b9 100644 --- a/pkg/local_object_storage/metabase/select.go +++ b/pkg/local_object_storage/metabase/select.go @@ -84,7 +84,7 @@ func (db *DB) Select(ctx context.Context, prm SelectPrm) (res SelectRes, err err return res, ErrDegradedMode } - if blindlyProcess(prm.filters) { + if checkNonEmpty(prm.filters) { success = true return res, nil } @@ -556,15 +556,12 @@ func markAddressInCache(cache map[string]int, fNum int, addr string) { } } -// returns true if query leads to a deliberately empty result. -func blindlyProcess(fs object.SearchFilters) bool { +// Returns true if at least 1 object can satisfy fs. +func checkNonEmpty(fs object.SearchFilters) bool { for i := range fs { if fs[i].Operation() == object.MatchNotPresent && isSystemKey(fs[i].Header()) { return true } - - // TODO: #1148 check other cases - // e.g. (a == b) && (a != b) } return false