[to #52411434]ps cursor refresh table location after open

This commit is contained in:
LiuYoung00
2023-09-26 12:09:59 +00:00
committed by ob-robot
parent 941dd415c7
commit 59f8195f31

View File

@ -3803,7 +3803,7 @@ int ObSPIService::dbms_cursor_open(ObPLExecCtx *ctx,
lib::ContextTLOptGuard guard(false);
if (OB_FAIL(inner_open(ctx, sql_str, ps_sql, stmt_type, exec_params,
*spi_result, spi_result->get_out_params()))) {
if (spi_result->get_result_set() != NULL && !cursor.is_ps_cursor()) {
if (spi_result->get_result_set() != NULL) {
int cli_ret = OB_SUCCESS;
retry_ctrl.test_and_save_retry_state(GCTX,
spi_result->get_sql_ctx(),
@ -3811,9 +3811,11 @@ int ObSPIService::dbms_cursor_open(ObPLExecCtx *ctx,
ret, cli_ret, true, true, true);
LOG_WARN("fail to open, check if need retry", K(ret), K(cli_ret),
K(retry_ctrl.need_retry()), K(sql_str), K(ps_sql), K(exec_params));
ret = cli_ret;
spi_result->get_sql_ctx().clear();
ctx->exec_ctx_->get_my_session()->set_session_in_retry(retry_ctrl.need_retry());
if (!cursor.is_ps_cursor()) {
ret = cli_ret;
spi_result->get_sql_ctx().clear();
ctx->exec_ctx_->get_my_session()->set_session_in_retry(retry_ctrl.need_retry());
}
}
}
}
@ -3925,7 +3927,7 @@ int ObSPIService::dbms_cursor_open(ObPLExecCtx *ctx,
spi_result.get_result_set()->get_field_columns(),
cursor.get_field_columns()));
OZ (fill_cursor(*spi_result.get_result_set(), spi_cursor));
if (OB_FAIL(ret) && !cursor.is_ps_cursor()) {
if (OB_FAIL(ret)) {
int cli_ret = OB_SUCCESS;
retry_ctrl.test_and_save_retry_state(GCTX,
spi_result.get_sql_ctx(),
@ -3938,9 +3940,11 @@ int ObSPIService::dbms_cursor_open(ObPLExecCtx *ctx,
LOG_WARN("failed to fill_cursor, check if need retry",
K(ret), K(cli_ret), K(retry_ctrl.need_retry()),
K(sql_stmt), K(ps_sql), K(exec_params));
ret = cli_ret;
spi_result.get_sql_ctx().clear();
ctx->exec_ctx_->get_my_session()->set_session_in_retry(retry_ctrl.need_retry());
if (!cursor.is_ps_cursor()) {
ret = cli_ret;
spi_result.get_sql_ctx().clear();
ctx->exec_ctx_->get_my_session()->set_session_in_retry(retry_ctrl.need_retry());
}
}
}
OX (spi_cursor->row_store_.finish_add_row());