Skip to content

Commit e7b7839

Browse files
PS-10910 fix: Bucket name is missing in search_* outputs (#108)
https://perconadev.atlassian.net/browse/PS-10910 Fixed an issue with forming URLs in search results for 'search_by_timestamp' / 'search_by_gtid_set' operations when for S3 storage backends with custom endpoint URLs the name of the bucket was omitted.
1 parent d185f1d commit e7b7839

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/binsrv/s3_storage_backend.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,11 @@ s3_storage_backend::do_get_object_uri(std::string_view name) const {
738738
if (impl_->has_endpoint()) {
739739
result.set_scheme(impl_->get_scheme_label());
740740
result.set_encoded_authority(impl_->get_endpoint());
741-
std::filesystem::path result_path{result.path()};
742-
result_path /= get_object_path(name);
741+
std::filesystem::path result_path{"/"};
742+
result_path /= get_bucket();
743+
// according to the standard if the rhs of the operator /= is an
744+
// absolute path, it must overwrite parts of the lhs
745+
result_path /= get_object_path(name).relative_path();
743746
result.set_path(result_path.generic_string());
744747
} else {
745748
result.set_scheme(original_uri_schema);

0 commit comments

Comments
 (0)