Fix: fix the bug of get_root_ctx function;
This commit is contained in:
@ -229,9 +229,7 @@ int ObExecContext::get_root_ctx(ObExecContext* &root_ctx)
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_ISNULL(this->get_parent_ctx())) {
|
||||
root_ctx = this;
|
||||
} else if (OB_ISNULL(get_parent_ctx()->get_pl_stack_ctx())) {
|
||||
root_ctx = this;
|
||||
} else if (get_parent_ctx()->get_pl_stack_ctx()->in_autonomous()) {
|
||||
} else if (get_parent_ctx()->get_pl_stack_ctx() != nullptr && get_parent_ctx()->get_pl_stack_ctx()->in_autonomous()) {
|
||||
root_ctx = this;
|
||||
} else if (OB_FAIL( SMART_CALL(get_parent_ctx()->get_root_ctx(root_ctx)))) {
|
||||
LOG_WARN("failed to get root ctx", K(ret));
|
||||
@ -239,6 +237,17 @@ int ObExecContext::get_root_ctx(ObExecContext* &root_ctx)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ObExecContext::is_root_ctx()
|
||||
{
|
||||
bool ret = false;
|
||||
if (OB_ISNULL(this->get_parent_ctx())) {
|
||||
ret = true;
|
||||
} else if (get_parent_ctx()->get_pl_stack_ctx() != nullptr && get_parent_ctx()->get_pl_stack_ctx()->in_autonomous()) {
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObExecContext::init_phy_op(const uint64_t phy_op_size)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
@ -209,7 +209,7 @@ public:
|
||||
ObExecContext *get_parent_ctx() { return parent_ctx_; }
|
||||
//get the root execute context in nested sql
|
||||
int get_root_ctx(ObExecContext* &root_ctx);
|
||||
bool is_root_ctx() {return parent_ctx_ == nullptr;}
|
||||
bool is_root_ctx();
|
||||
int64_t get_nested_level() const { return nested_level_; }
|
||||
/**
|
||||
* @brief set sql proxy
|
||||
|
||||
Reference in New Issue
Block a user