[FEAT MERGE] Lob SQL refactoring (Mem-LobLocator, expressions and dbms_lob adaptions)

Co-authored-by: chaser-ch <chaser.ch@antgroup.com>
This commit is contained in:
obdev
2023-01-28 20:40:15 +08:00
committed by ob-robot
parent 4bb1033505
commit 3d4f554258
350 changed files with 19091 additions and 3918 deletions

View File

@ -155,7 +155,9 @@ int ObExprJsonSet::eval_json_set(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &re
LOG_WARN("eval json path datum failed", K(ret));
} else {
ObString path_val = path_data->get_string();
if (OB_FAIL(ObJsonExprHelper::find_and_add_cache(path_cache, json_path, path_val, i, false))) {
if (OB_FAIL(ObJsonExprHelper::get_json_or_str_data(expr.args_[i], ctx, temp_allocator, path_val, is_null_result))) {
LOG_WARN("fail to get real data.", K(ret), K(path_val));
} else if (OB_FAIL(ObJsonExprHelper::find_and_add_cache(path_cache, json_path, path_val, i, false))) {
LOG_WARN("get json path cache failed", K(path_data->get_string()), K(ret));
} else if (OB_FAIL(json_doc->seek(*json_path, json_path->path_node_cnt(), true, false, hit))) {
LOG_WARN("json seek failed", K(path_data->get_string()), K(ret));
@ -181,15 +183,8 @@ int ObExprJsonSet::eval_json_set(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &re
ObString str;
if (OB_FAIL(json_doc->get_raw_binary(str, &temp_allocator))) {
LOG_WARN("json_set result to binary failed", K(ret));
} else {
char *buf = expr.get_str_res_mem(ctx, str.length());
if (OB_UNLIKELY(buf == NULL)){
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("fail to alloc memory for json set result", K(ret));
} else {
MEMCPY(buf, str.ptr(), str.length());
res.set_string(buf, str.length());
}
} else if (OB_FAIL(ObJsonExprHelper::pack_json_str_res(expr, ctx, res, str))) {
LOG_WARN("fail to pack json result", K(ret));
}
}
return ret;