[FEAT MERGE] Solidify session vars for functional index
This commit is contained in:
@ -133,7 +133,8 @@ ObPhysicalPlan::ObPhysicalPlan(MemoryContext &mem_context /* = CURRENT_CONTEXT *
|
||||
append_table_id_(0),
|
||||
logical_plan_(),
|
||||
is_enable_px_fast_reclaim_(false),
|
||||
subschema_ctx_(allocator_)
|
||||
subschema_ctx_(allocator_),
|
||||
all_local_session_vars_(&allocator_)
|
||||
{
|
||||
}
|
||||
|
||||
@ -229,6 +230,7 @@ void ObPhysicalPlan::reset()
|
||||
logical_plan_.reset();
|
||||
is_enable_px_fast_reclaim_ = false;
|
||||
subschema_ctx_.reset();
|
||||
all_local_session_vars_.reset();
|
||||
}
|
||||
|
||||
void ObPhysicalPlan::destroy()
|
||||
@ -1340,5 +1342,31 @@ int ObPhysicalPlan::set_feedback_info(ObExecContext &ctx)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObPhysicalPlan::set_all_local_session_vars(ObIArray<ObLocalSessionVar> *all_local_session_vars)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (!all_local_session_vars_.empty()) {
|
||||
all_local_session_vars_.reset();
|
||||
}
|
||||
if (OB_ISNULL(all_local_session_vars)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected null", K(ret), K(all_local_session_vars));
|
||||
} else if (OB_FAIL(all_local_session_vars_.reserve(all_local_session_vars->count()))) {
|
||||
LOG_WARN("reserve for local_session_vars failed", K(ret));
|
||||
} else {
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < all_local_session_vars->count(); ++i) {
|
||||
if (OB_FAIL(all_local_session_vars_.push_back(ObLocalSessionVar()))) {
|
||||
LOG_WARN("push back local session var failed", K(ret));
|
||||
} else {
|
||||
all_local_session_vars_.at(i).set_allocator(&allocator_);
|
||||
if (OB_FAIL(all_local_session_vars_.at(i).deep_copy(all_local_session_vars->at(i)))) {
|
||||
LOG_WARN("deep copy local session vars failed", K(ret));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
} //namespace sql
|
||||
} //namespace oceanbase
|
||||
|
||||
Reference in New Issue
Block a user