diff --git a/domain/objectstore/errors.go b/domain/objectstore/errors.go index a89048c6063..24de528629d 100644 --- a/domain/objectstore/errors.go +++ b/domain/objectstore/errors.go @@ -8,4 +8,4 @@ import "github.com/juju/errors" // ErrHashAndSizeAlreadyExists is returned when a hash already exists, but // the associated size is different. This should never happen, it means that // there is a collision in the hash function. -const ErrHashAndSizeAlreadyExists = errors.ConstError("hash and size already exists") +const ErrHashAndSizeAlreadyExists = errors.ConstError("hash exists for different file size") diff --git a/domain/objectstore/state/state.go b/domain/objectstore/state/state.go index 97fc038d3c8..ff0080c89a2 100644 --- a/domain/objectstore/state/state.go +++ b/domain/objectstore/state/state.go @@ -34,9 +34,9 @@ func (s *State) GetMetadata(ctx context.Context, path string) (objectstore.Metad } query := ` -SELECT path, metadata_uuid, object_store_metadata.size, object_store_metadata.hash -FROM object_store_metadata_path -LEFT JOIN object_store_metadata ON object_store_metadata_path.metadata_uuid = object_store_metadata.uuid +SELECT p.path, p.metadata_uuid, m.size, m.hash +FROM object_store_metadata_path p +LEFT JOIN object_store_metadata m ON p.metadata_uuid = m.uuid WHERE path = ?` var metadata objectstore.Metadata