Merge pull request #28438 from azat/udf-race-fix-v2

Fix race in UDF (follow up)
This commit is contained in:
Maksim Kita 2021-09-01 23:57:05 +03:00 committed by GitHub
commit be4c9102d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,9 +80,9 @@ ASTPtr UserDefinedFunctionFactory::tryGet(const std::string & function_name) con
std::vector<std::string> UserDefinedFunctionFactory::getAllRegisteredNames() const
{
std::vector<std::string> registered_names;
registered_names.reserve(function_name_to_create_query.size());
std::lock_guard lock(mutex);
registered_names.reserve(function_name_to_create_query.size());
for (const auto & [name, _] : function_name_to_create_query)
registered_names.emplace_back(name);