diff --git a/src/sql/ob_sql_utils.cpp b/src/sql/ob_sql_utils.cpp index 7f9802b8d7..f34a39a2b4 100644 --- a/src/sql/ob_sql_utils.cpp +++ b/src/sql/ob_sql_utils.cpp @@ -4817,7 +4817,8 @@ bool ObSQLUtils::is_pl_nested_sql(ObExecContext *cur_ctx) && !parent_ctx->get_pl_stack_ctx()->in_autonomous()) { if (ObStmt::is_dml_stmt(parent_ctx->get_sql_ctx()->stmt_type_)) { bret = true; - } else if (stmt::T_ANONYMOUS_BLOCK == parent_ctx->get_sql_ctx()->stmt_type_) { + } else if (stmt::T_ANONYMOUS_BLOCK == parent_ctx->get_sql_ctx()->stmt_type_ + || stmt::T_CALL_PROCEDURE == parent_ctx->get_sql_ctx()->stmt_type_) { /* anonymous block in a store procedure will be send to sql engine as sql, which will make new obexeccontext. consider follow scene: dml1(exec_ctx1)->udf/trigger->procedure->anonymous block(exec_ctx2)->dml2 @@ -4826,7 +4827,8 @@ bool ObSQLUtils::is_pl_nested_sql(ObExecContext *cur_ctx) do { parent_ctx = parent_ctx->get_parent_ctx(); } while (OB_NOT_NULL(parent_ctx) && OB_NOT_NULL(parent_ctx->get_sql_ctx()) && - (stmt::T_ANONYMOUS_BLOCK == parent_ctx->get_sql_ctx()->stmt_type_)); + (stmt::T_ANONYMOUS_BLOCK == parent_ctx->get_sql_ctx()->stmt_type_ + || stmt::T_CALL_PROCEDURE == parent_ctx->get_sql_ctx()->stmt_type_)); if (OB_NOT_NULL(parent_ctx) && OB_NOT_NULL(parent_ctx->get_sql_ctx()) && diff --git a/src/sql/resolver/ob_resolver_utils.cpp b/src/sql/resolver/ob_resolver_utils.cpp index d30adcc987..b73c7c1c47 100644 --- a/src/sql/resolver/ob_resolver_utils.cpp +++ b/src/sql/resolver/ob_resolver_utils.cpp @@ -2157,6 +2157,9 @@ stmt::StmtType ObResolverUtils::get_stmt_type_by_item_type(const ObItemType item type = stmt::T_LOCK_TABLE; } break; + case T_SP_CALL_STMT: { + type = stmt::T_CALL_PROCEDURE; + } default: { type = stmt::T_NONE; }