From 3c7e42f453f14b2cfd06c3998b0b400eaea12099 Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Mon, 4 Mar 2024 10:31:29 +0100 Subject: [PATCH] stores: fix TestS3MultipartUploads --- stores/multipart.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stores/multipart.go b/stores/multipart.go index 2983f86d1..d180ea97b 100644 --- a/stores/multipart.go +++ b/stores/multipart.go @@ -275,10 +275,10 @@ func (s *SQLStore) MultipartUploadParts(ctx context.Context, bucket, object stri func (s *SQLStore) AbortMultipartUpload(ctx context.Context, bucket, path string, uploadID string) error { return s.retryTransaction(func(tx *gorm.DB) error { // delete multipart upload optimistically - res := tx.Where("upload_id", uploadID). + res := tx. + Where("upload_id", uploadID). Where("object_id", path). - Where("DBBucket.name", bucket). - Joins("DBBucket"). + Where("db_bucket_id = (SELECT id FROM buckets WHERE buckets.name = ?)", bucket). Delete(&dbMultipartUpload{}) if res.Error != nil { return fmt.Errorf("failed to fetch multipart upload: %w", res.Error)