[to #52411434]ps cursor refresh table location after open
This commit is contained in:
@ -3803,7 +3803,7 @@ int ObSPIService::dbms_cursor_open(ObPLExecCtx *ctx,
|
|||||||
lib::ContextTLOptGuard guard(false);
|
lib::ContextTLOptGuard guard(false);
|
||||||
if (OB_FAIL(inner_open(ctx, sql_str, ps_sql, stmt_type, exec_params,
|
if (OB_FAIL(inner_open(ctx, sql_str, ps_sql, stmt_type, exec_params,
|
||||||
*spi_result, spi_result->get_out_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;
|
int cli_ret = OB_SUCCESS;
|
||||||
retry_ctrl.test_and_save_retry_state(GCTX,
|
retry_ctrl.test_and_save_retry_state(GCTX,
|
||||||
spi_result->get_sql_ctx(),
|
spi_result->get_sql_ctx(),
|
||||||
@ -3811,6 +3811,7 @@ int ObSPIService::dbms_cursor_open(ObPLExecCtx *ctx,
|
|||||||
ret, cli_ret, true, true, true);
|
ret, cli_ret, true, true, true);
|
||||||
LOG_WARN("fail to open, check if need retry", K(ret), K(cli_ret),
|
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));
|
K(retry_ctrl.need_retry()), K(sql_str), K(ps_sql), K(exec_params));
|
||||||
|
if (!cursor.is_ps_cursor()) {
|
||||||
ret = cli_ret;
|
ret = cli_ret;
|
||||||
spi_result->get_sql_ctx().clear();
|
spi_result->get_sql_ctx().clear();
|
||||||
ctx->exec_ctx_->get_my_session()->set_session_in_retry(retry_ctrl.need_retry());
|
ctx->exec_ctx_->get_my_session()->set_session_in_retry(retry_ctrl.need_retry());
|
||||||
@ -3818,6 +3819,7 @@ int ObSPIService::dbms_cursor_open(ObPLExecCtx *ctx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
OV (OB_NOT_NULL(spi_result->get_result_set()),
|
OV (OB_NOT_NULL(spi_result->get_result_set()),
|
||||||
OB_ERR_UNEXPECTED, sql_stmt, ps_sql, exec_params);
|
OB_ERR_UNEXPECTED, sql_stmt, ps_sql, exec_params);
|
||||||
CK (OB_NOT_NULL(spi_result->get_result_set()->get_field_columns()));
|
CK (OB_NOT_NULL(spi_result->get_result_set()->get_field_columns()));
|
||||||
@ -3925,7 +3927,7 @@ int ObSPIService::dbms_cursor_open(ObPLExecCtx *ctx,
|
|||||||
spi_result.get_result_set()->get_field_columns(),
|
spi_result.get_result_set()->get_field_columns(),
|
||||||
cursor.get_field_columns()));
|
cursor.get_field_columns()));
|
||||||
OZ (fill_cursor(*spi_result.get_result_set(), spi_cursor));
|
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;
|
int cli_ret = OB_SUCCESS;
|
||||||
retry_ctrl.test_and_save_retry_state(GCTX,
|
retry_ctrl.test_and_save_retry_state(GCTX,
|
||||||
spi_result.get_sql_ctx(),
|
spi_result.get_sql_ctx(),
|
||||||
@ -3938,11 +3940,13 @@ int ObSPIService::dbms_cursor_open(ObPLExecCtx *ctx,
|
|||||||
LOG_WARN("failed to fill_cursor, check if need retry",
|
LOG_WARN("failed to fill_cursor, check if need retry",
|
||||||
K(ret), K(cli_ret), K(retry_ctrl.need_retry()),
|
K(ret), K(cli_ret), K(retry_ctrl.need_retry()),
|
||||||
K(sql_stmt), K(ps_sql), K(exec_params));
|
K(sql_stmt), K(ps_sql), K(exec_params));
|
||||||
|
if (!cursor.is_ps_cursor()) {
|
||||||
ret = cli_ret;
|
ret = cli_ret;
|
||||||
spi_result.get_sql_ctx().clear();
|
spi_result.get_sql_ctx().clear();
|
||||||
ctx->exec_ctx_->get_my_session()->set_session_in_retry(retry_ctrl.need_retry());
|
ctx->exec_ctx_->get_my_session()->set_session_in_retry(retry_ctrl.need_retry());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
OX (spi_cursor->row_store_.finish_add_row());
|
OX (spi_cursor->row_store_.finish_add_row());
|
||||||
if (OB_SUCC(ret) && lib::is_oracle_mode()) {
|
if (OB_SUCC(ret) && lib::is_oracle_mode()) {
|
||||||
transaction::ObTxReadSnapshot &snapshot =
|
transaction::ObTxReadSnapshot &snapshot =
|
||||||
|
|||||||
Reference in New Issue
Block a user