[CP] Set tenant id for ConnectByPump

This commit is contained in:
obdev
2022-07-22 10:45:24 +08:00
committed by wangzelin.wzl
parent fc3e6e947b
commit c2c53f977c
7 changed files with 31 additions and 1 deletions

View File

@ -382,6 +382,9 @@ int ObConnectByPump::init(const ObConnectBy& connect_by, common::ObExprCtx* expr
if (OB_UNLIKELY(is_inited_)) {
ret = OB_INIT_TWICE;
LOG_WARN("init twice", K(ret));
} else if (OB_ISNULL(expr_ctx) || OB_ISNULL(expr_ctx->my_session_)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("expr_ctx or session is null", K(ret));
} else if (OB_UNLIKELY(2 != connect_by.get_child_num())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("invalid child num", K(ret));
@ -397,6 +400,8 @@ int ObConnectByPump::init(const ObConnectBy& connect_by, common::ObExprCtx* expr
} else if (OB_FAIL(hash_filter_rows_.create(CONNECT_BY_TREE_HEIGHT))) {
LOG_WARN("create hash set failed", K(ret));
} else {
uint64_t tenant_id = expr_ctx->my_session_->get_effective_tenant_id();
allocator_.set_tenant_id(tenant_id);
pump_row_desc_ = connect_by.get_pump_row_desc();
pseudo_column_row_desc_ = connect_by.get_pseudo_column_row_desc();
connect_by_prior_exprs_ = connect_by.get_connect_by_prior_exprs();