From e98c49a58fb87e08c8807c28a9c38344d6d9c627 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 24 Dec 2023 05:44:24 +0100 Subject: [PATCH 1/2] Fix a benign error in archive reader --- src/Storages/StorageFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Storages/StorageFile.cpp b/src/Storages/StorageFile.cpp index bc4db8f1998..25bb6691ff6 100644 --- a/src/Storages/StorageFile.cpp +++ b/src/Storages/StorageFile.cpp @@ -1935,7 +1935,7 @@ void StorageFile::parseFileSource(String source, String & filename, String & pat } std::string_view path_to_archive_view = std::string_view{source}.substr(0, pos); - while (path_to_archive_view.back() == ' ') + while (path_to_archive_view.ends_with(' ')) path_to_archive_view.remove_suffix(1); if (path_to_archive_view.empty()) From f582a9b39c8ba141f3bbca0945ce6418cd6126ba Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 24 Dec 2023 05:55:53 +0100 Subject: [PATCH 2/2] Add a test --- tests/queries/0_stateless/02952_archive_parsing.reference | 0 tests/queries/0_stateless/02952_archive_parsing.sql | 1 + 2 files changed, 1 insertion(+) create mode 100644 tests/queries/0_stateless/02952_archive_parsing.reference create mode 100644 tests/queries/0_stateless/02952_archive_parsing.sql diff --git a/tests/queries/0_stateless/02952_archive_parsing.reference b/tests/queries/0_stateless/02952_archive_parsing.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/queries/0_stateless/02952_archive_parsing.sql b/tests/queries/0_stateless/02952_archive_parsing.sql new file mode 100644 index 00000000000..49b0223e6ec --- /dev/null +++ b/tests/queries/0_stateless/02952_archive_parsing.sql @@ -0,0 +1 @@ +SELECT * FROM file('::a'); -- { serverError BAD_ARGUMENTS }