[BUGFIX] fix ObTextStringIter deconstruct after allocator

This commit is contained in:
obdev
2023-02-08 19:57:29 +08:00
committed by ob-robot
parent 4150a9de1d
commit eb6c0e1eac
9 changed files with 21 additions and 22 deletions

View File

@ -142,10 +142,10 @@ int ObExprLowerUpper::calc(ObObj &result, const ObString &text,
ObString real_str;
int32_t multiply = get_case_mutiply(cs_type);
ObObjType text_type = get_result_type().get_calc_meta().get_type();
// not found caller of this func, need text src obj to judge whether has lob header
ObTextStringIter src_iter(text_type, cs_type, text, has_lob_header);
// Need calc buff, user AreanaAllocator instead, for cannot find the caller of this function
common::ObArenaAllocator temp_allocator(ObModIds::OB_LOB_READER, OB_MALLOC_NORMAL_BLOCK_SIZE, MTL_ID());
// not found caller of this func, need text src obj to judge whether has lob header
ObTextStringIter src_iter(text_type, cs_type, text, has_lob_header);
char *buf = NULL; // res buffer
int64_t src_byte_len = 0;
int64_t buf_size = 0;
@ -388,11 +388,10 @@ int ObExprLowerUpper::calc_common(const ObExpr &expr, ObEvalCtx &ctx,
str_result.assign(buf, static_cast<int32_t>(out_len));
}
} else { // text tc only
ObTextStringIter src_iter(text_meta.type_, text_meta.cs_type_, text_datum->get_string(), has_lob_header);
ObTextStringDatumResult output_result(expr.datum_meta_.type_, &expr, &ctx, &expr_datum);
ObEvalCtx::TempAllocGuard alloc_guard(ctx);
ObIAllocator &calc_alloc = alloc_guard.get_allocator();
ObTextStringIter src_iter(text_meta.type_, text_meta.cs_type_, text_datum->get_string(), has_lob_header);
ObTextStringDatumResult output_result(expr.datum_meta_.type_, &expr, &ctx, &expr_datum);
ObString dst;
char *buf = NULL; // res buffer