[CP] [CP] [to #48737315]fix bug of remote execution of select for update statement in PL

This commit is contained in:
seuwebber
2023-04-24 04:11:38 +00:00
committed by ob-robot
parent ced1abdc78
commit 7c79e6fccf
3 changed files with 19 additions and 9 deletions

View File

@ -5194,11 +5194,15 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx,
ret = OB_ERR_UNEXPECTED;
LOG_WARN("Argument in pl context is NULL", K(session), K(ret));
} else {
bool old_client_return_rowid = session->is_client_return_rowid();
bool is_inner_session = session->is_inner();
ObSQLSessionInfo::SessionType old_session_type = session->get_session_type();
ObInnerSQLConnection *spi_conn = NULL;
!is_inner_session ? session->set_inner_session() : (void)NULL;
session->set_session_type(ObSQLSessionInfo::USER_SESSION);
if (NULL != ctx->pl_ctx_) {
session->set_client_return_rowid(false);
}
if (OB_SUCC(ret)) {
WITH_CONTEXT(spi_result.get_memory_ctx()) {
if (NULL != sql.ptr()) {
@ -5220,6 +5224,7 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx,
!is_inner_session ? session->set_user_session() : (void)NULL;
session->set_session_type(old_session_type);
session->set_client_return_rowid(old_client_return_rowid);
}
}
return ret;