mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #71466 from ClickHouse/backport/24.10/71308
Backport #71308 to 24.10: Added missing unescaping in named collections names.
This commit is contained in:
commit
05697eb6ba
@ -568,7 +568,7 @@ std::vector<std::string> NamedCollectionsMetadataStorage::listCollections() cons
|
||||
std::vector<std::string> collections;
|
||||
collections.reserve(paths.size());
|
||||
for (const auto & path : paths)
|
||||
collections.push_back(std::filesystem::path(path).stem());
|
||||
collections.push_back(unescapeForFileName(std::filesystem::path(path).stem()));
|
||||
return collections;
|
||||
}
|
||||
|
||||
|
@ -794,3 +794,17 @@ def test_keeper_storage_remove_on_cluster(cluster, ignore, expected_raise):
|
||||
node.query(
|
||||
f"DROP NAMED COLLECTION test_nc ON CLUSTER `replicated_nc_nodes_cluster`"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"instance_name",
|
||||
[("node"), ("node_with_keeper")],
|
||||
)
|
||||
def test_name_escaping(cluster, instance_name):
|
||||
node = cluster.instances[instance_name]
|
||||
|
||||
node.query("DROP NAMED COLLECTION IF EXISTS `test_!strange/symbols!`;")
|
||||
node.query("CREATE NAMED COLLECTION `test_!strange/symbols!` AS key1=1, key2=2")
|
||||
node.restart_clickhouse()
|
||||
|
||||
node.query("DROP NAMED COLLECTION `test_!strange/symbols!`")
|
||||
|
Loading…
Reference in New Issue
Block a user