Repository navigation
Revert "Fix polaris catalog with azure" - #102247
Conversation
|
Workflow [PR], commit [53cc50a] AI ReviewSummaryThis PR reverts prior Azure/Polaris handling in PR Metadata
Findings❌ Blockers
Tests
ClickHouse Rules
Performance & Safety
Final Verdict
|
| if (metadata_location.starts_with(data_location)) | ||
| { | ||
| size_t remove_slash = (metadata_location.size() > data_location.size() && metadata_location[data_location.size()] == '/') ? 1 : 0; | ||
| size_t remove_slash = metadata_location[data_location.size()] == '/' ? 1 : 0; |
There was a problem hiding this comment.
metadata_location[data_location.size()] can read one past the end when metadata_location == data_location.
starts_with is still true in that case, so this access is out-of-bounds and introduces undefined behavior. Please restore a bounds check before indexing (for example, check metadata_location.size() > data_location.size() first).
| if (!endpoint.empty() && metadata_location.starts_with(azure_host_prefix)) | ||
| metadata_location = "/" + bucket + "/" + metadata_location.substr(azure_host_prefix.size()); | ||
| } | ||
| else if (!endpoint.empty() && data_location.starts_with(endpoint)) |
There was a problem hiding this comment.
constructLocation normalizes endpoint by removing a trailing /, but this comparison now uses the raw endpoint value.
If the setting is configured as https://account.dfs.core.windows.net/, data_location starts with https://account.dfs.core.windows.net (without trailing slash), so starts_with(endpoint) becomes false and prefix stripping is skipped. That breaks relative metadata path extraction for valid endpoint values differing only by trailing slash.
Reverts #100583
cc @scanhex12
Version info
26.4.1.719