fix sql executor use memory of 500 tenant

This commit is contained in:
obdev
2023-04-19 08:15:11 +00:00
committed by ob-robot
parent ff0be6d455
commit 6e8c6def52
5 changed files with 16 additions and 0 deletions

View File

@ -267,6 +267,9 @@ int ObExprMinus::calc(ObDatum &res, const ObDatum &left, const ObDatum &right,
OZ (plan_ctx.init_datum_param_store());
OX (exec_ctx.set_physical_plan_ctx(&plan_ctx));
OX (exec_ctx.set_my_session(&default_session));
OX (exec_ctx.set_mem_attr(ObMemAttr(tenant_id,
ObModIds::OB_SQL_EXEC_CONTEXT,
ObCtxIds::EXECUTE_CTX_ID)));
OX (arith = OB_NEWx(ObRTDatumArith, allocator, exec_ctx, default_session));
if (OB_FAIL(ret)) {
if (NULL != arith) {

View File

@ -40,9 +40,11 @@ int calc_digest_text(ObIAllocator &allocator,
int ret = OB_SUCCESS;
ObArenaAllocator temp_allocator(ObModIds::OB_SQL_EXPR_CALC);
HEAP_VAR(ObExecContext, exec_ctx, temp_allocator) {
uint64_t tenant_id = session->get_effective_tenant_id();
ObPhysicalPlanCtx phy_plan_ctx(allocator);
exec_ctx.set_physical_plan_ctx(&phy_plan_ctx);
exec_ctx.set_my_session(session);
exec_ctx.set_mem_attr(ObMemAttr(tenant_id, ObModIds::OB_SQL_EXEC_CONTEXT, ObCtxIds::EXECUTE_CTX_ID));
ObSqlCtx sql_ctx;
sql_ctx.session_info_ = session;
sql_ctx.schema_guard_ = schema_guard;