diff --git a/be/src/vec/functions/function_string.h b/be/src/vec/functions/function_string.h index f0566b2d8070c1..0490238d9c2210 100644 --- a/be/src/vec/functions/function_string.h +++ b/be/src/vec/functions/function_string.h @@ -1322,6 +1322,9 @@ class FunctionReplace : public IFunction { private: std::string replace(std::string str, std::string_view old_str, std::string_view new_str) { + if (old_str.empty()) { + return str; + } std::string::size_type pos = 0; std::string::size_type oldLen = old_str.size(); std::string::size_type newLen = new_str.size();