diff --git a/dbms/src/Functions/Regexps.h b/dbms/src/Functions/Regexps.h index 33e4735ed80..9e415e39fc6 100644 --- a/dbms/src/Functions/Regexps.h +++ b/dbms/src/Functions/Regexps.h @@ -104,7 +104,9 @@ namespace MultiRegexps struct Pool { + /// Mutex for finding in map std::mutex mutex; + /// Patterns + possible edit_distance to database and scratch std::map, std::optional>, Regexps> storage; }; @@ -219,7 +221,7 @@ namespace MultiRegexps it = known_regexps.storage.emplace( std::pair{str_patterns, edit_distance}, constructRegexps(str_patterns, edit_distance)).first; - + lock.unlock(); return &it->second; } }