提交 51685f35 编写于 作者: A Alexey Milovidov

Fixed TSan report in base64 library

上级 438ea5bc
......@@ -166,4 +166,14 @@ private:
}
};
}
/** We must call it in advance from a single thread
* to avoid thread sanitizer report about data race in "codec_choose" function.
*/
inline void initializeBase64()
{
size_t outlen = 0;
base64_encode(nullptr, 0, nullptr, &outlen, 0);
}
#endif
......@@ -8,6 +8,7 @@ namespace DB
{
void registerFunctionBase64Decode(FunctionFactory & factory)
{
initializeBase64();
factory.registerFunction<FunctionBase64Conversion<Base64Decode>>();
}
}
......
......@@ -9,6 +9,7 @@ namespace DB
{
void registerFunctionBase64Encode(FunctionFactory & factory)
{
initializeBase64();
factory.registerFunction<FunctionBase64Conversion<Base64Encode>>();
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册