[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

@ -272,11 +272,11 @@ int calc_instrb_expr(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &res_datum)
res_datum.set_number(res_nmb);
}
} else { // text types
ObEvalCtx::TempAllocGuard alloc_guard(ctx);
ObIAllocator &calc_alloc = alloc_guard.get_allocator();
// similar to instr, but reserve length is byte len, use binary cs type for byte access
ObTextStringIter haystack_iter(haystack_type, CS_TYPE_BINARY, haystack->get_string(), haystack_has_lob_header);
ObTextStringIter needle_iter(needle_type, calc_cs_type, needle->get_string(), needle_has_lob_header);
ObEvalCtx::TempAllocGuard alloc_guard(ctx);
ObIAllocator &calc_alloc = alloc_guard.get_allocator();
if (OB_FAIL(calc_instrb_text(haystack_iter, needle_iter, calc_alloc,
kmp_ctx, ctx, pos_int, occ_int, res_datum))) {