diff --git a/internal/db/collection_index.go b/internal/db/collection_index.go index 7ded8fff0e..c2f02bf3bf 100644 --- a/internal/db/collection_index.go +++ b/internal/db/collection_index.go @@ -496,7 +496,7 @@ func (c *collection) GetIndexes(ctx context.Context) ([]client.IndexDescription, // checkExistingFieldsAndAdjustRelFieldNames checks if the fields in the index description // exist in the collection schema. -// If a field is a relation, it will be adjusted to relation id field name, a.k.a. `field_name + _id`. +// If a field is a relation, it will be adjusted to relation id field name, a.k.a. `field_name + _id`. func (c *collection) checkExistingFieldsAndAdjustRelFieldNames( fields []client.IndexedFieldDescription, ) error { diff --git a/internal/planner/type_join.go b/internal/planner/type_join.go index 8c64ed7eb2..b6ce65dbdd 100644 --- a/internal/planner/type_join.go +++ b/internal/planner/type_join.go @@ -592,15 +592,17 @@ func (j *primaryObjectsFetcher) fetchPrimaryDocs() ([]core.Doc, error) { j.primaryScan.initFetcher(immutable.None[string](), indexOnRelation) docs, err := j.collectDocs(0) + if err != nil { + return nil, err + } - j.primaryScan.fetcher.Close() - - j.primaryScan.fetcher = oldFetcher - + err = j.primaryScan.fetcher.Close() if err != nil { return nil, err } + j.primaryScan.fetcher = oldFetcher + return docs, nil }