Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/duckdb/src/common/file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,16 @@ string FileSystem::GetWorkingDirectory() {
#endif

string FileSystem::JoinPath(const string &a, const string &b) {
// A remote URL may carry a "?query" suffix (object version, requester-pays, an SSE-C key, ...).
// Appending a path segment after it would bury the query mid-path and corrupt both the query and
// the object path, so join onto the path without the query and keep the query at the very end.
auto scheme = a.find("://");
if (scheme != string::npos) {
auto query = a.find('?', scheme + 3);
if (query != string::npos) {
return Path::FromString(a.substr(0, query)).Join(b).ToString() + a.substr(query);
}
}
return Path::FromString(a).Join(b).ToString();
}

Expand Down
Loading
Loading