diff --git a/utils/funcexp/func_json_value.cpp b/utils/funcexp/func_json_value.cpp index c05a010aa..9fa6d0cde 100644 --- a/utils/funcexp/func_json_value.cpp +++ b/utils/funcexp/func_json_value.cpp @@ -64,8 +64,7 @@ bool JSONPathWrapper::extract(std::string& ret, rowgroup::Row& row, execplan::SP bool isNullJS = false, isNullPath = false; const string js = funcParamJS->data()->getStrVal(row, isNullJS).safeString(""); - const string sjsp = funcParamPath->data()->getStrVal(row, isNullPath).safeString(""); - const string_view jsp = sjsp; + const utils::NullString& sjsp = funcParamPath->data()->getStrVal(row, isNullPath); if (isNullJS || isNullPath) return true; @@ -79,8 +78,8 @@ bool JSONPathWrapper::extract(std::string& ret, rowgroup::Row& row, execplan::SP constant = (constCol != nullptr); } - if (isNullPath || json_path_setup(&p, getCharset(funcParamPath), (const uchar*)jsp.data(), - (const uchar*)jsp.data() + jsp.size())) + if (isNullPath || json_path_setup(&p, getCharset(funcParamPath), (const uchar*)sjsp.str(), + (const uchar*)sjsp.end())) return true; parsed = constant;