Merge pull request #69066 from yariks5s/sandbox_

Path normalization in StorageFile
This commit is contained in:
Yarik Briukhovetskyi 2024-09-02 08:27:41 +00:00 committed by GitHub
commit a1747493ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 0 deletions

View File

@ -126,6 +126,7 @@ void listFilesWithRegexpMatchingImpl(
/// Otherwise it will not allow to work with symlinks in `user_files_path` directory.
fs::canonical(path_for_ls + for_match);
fs::path absolute_path = fs::absolute(path_for_ls + for_match);
absolute_path = absolute_path.lexically_normal(); /// ensure that the resulting path is normalized (e.g., removes any redundant slashes or . and .. segments)
result.push_back(absolute_path.string());
}
catch (const std::exception &) // NOLINT

View File

@ -0,0 +1 @@
data_hive/partitioning/column0=Elizabeth/sample.parquet

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# Tags: no-fasttest
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
$CLICKHOUSE_LOCAL -q "SELECT substring(_path, position(_path, 'data_hive')) FROM file('$CURDIR/data_hive/partitioning/column0=*/sample.parquet') LIMIT 1;"