From 3bbf1d6a60efbf6d6ef7b2a30ef07c4cd44f3a3c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 2 Nov 2020 11:07:53 +0300 Subject: [PATCH] [#137] metabase: Do not select objects if there is no filterable attribute In previous metabase implementation the absence of an attribute presented in the search filter did not exclude the object from the result. Change this behavior to exclude the object from the result. Signed-off-by: Leonard Lyubich --- pkg/local_object_storage/metabase/select.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/local_object_storage/metabase/select.go b/pkg/local_object_storage/metabase/select.go index aef3d7815a..33097e60b3 100644 --- a/pkg/local_object_storage/metabase/select.go +++ b/pkg/local_object_storage/metabase/select.go @@ -32,7 +32,8 @@ func (db *DB) Select(fs object.SearchFilters) ([]*object.Address, error) { // get bucket with values keyBucket := indexBucket.Bucket([]byte(key)) if keyBucket == nil { - continue + // no object has this attribute => empty result + return nil } fVal := f.Value()