diff --git a/satellite/metainfo/metabase/delete.go b/satellite/metainfo/metabase/delete.go index 275659736..27d37350d 100644 --- a/satellite/metainfo/metabase/delete.go +++ b/satellite/metainfo/metabase/delete.go @@ -262,7 +262,7 @@ func (db *DB) DeleteObjectLatestVersion(ctx context.Context, opts DeleteObjectLa project_id = $1 AND bucket_name = $2 AND object_key = $3 AND - version = (SELECT version FROM objects WHERE + version IN (SELECT version FROM objects WHERE project_id = $1 AND bucket_name = $2 AND object_key = $3 AND diff --git a/satellite/metainfo/metabase/get.go b/satellite/metainfo/metabase/get.go index 8b2f8474e..3b4594f17 100644 --- a/satellite/metainfo/metabase/get.go +++ b/satellite/metainfo/metabase/get.go @@ -229,7 +229,7 @@ func (db *DB) GetLatestObjectLastSegment(ctx context.Context, opts GetLatestObje inline_data, remote_pieces FROM segments WHERE - stream_id = (SELECT stream_id FROM objects WHERE + stream_id IN (SELECT stream_id FROM objects WHERE project_id = $1 AND bucket_name = $2 AND object_key = $3 AND @@ -284,7 +284,7 @@ func (db *DB) GetSegmentByOffset(ctx context.Context, opts GetSegmentByOffset) ( inline_data, remote_pieces FROM segments WHERE - stream_id = (SELECT stream_id FROM objects WHERE + stream_id IN (SELECT stream_id FROM objects WHERE project_id = $1 AND bucket_name = $2 AND object_key = $3 AND