[SCN REFACTOR] replace flash back snapshot and remove read snapshot session
This commit is contained in:
@ -1209,7 +1209,8 @@ int ObSPIService::spi_inner_execute(ObPLExecCtx *ctx,
|
||||
const bool *exprs_not_null_flag,
|
||||
const int64_t *pl_integer_ranges,
|
||||
int64_t is_bulk,
|
||||
bool is_forall)
|
||||
bool is_forall,
|
||||
int32_t array_binding_count)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObWarningBuffer* wb = NULL;
|
||||
@ -1231,7 +1232,7 @@ int ObSPIService::spi_inner_execute(ObPLExecCtx *ctx,
|
||||
if (OB_SUCC(ret) && is_forall && !session->is_enable_batched_multi_statement()) {
|
||||
/* forall need rollback to for loop */
|
||||
ret = OB_BATCHED_MULTI_STMT_ROLLBACK;
|
||||
LOG_TRACE("cannot batch execute", K(ret));
|
||||
LOG_TRACE("cannot batch execute", K(ret), K(sql), K(type));
|
||||
}
|
||||
HEAP_VAR(ObSPIResultSet, spi_result) {
|
||||
stmt::StmtType stmt_type = stmt::T_NONE;
|
||||
@ -1293,7 +1294,8 @@ int ObSPIService::spi_inner_execute(ObPLExecCtx *ctx,
|
||||
into_count,
|
||||
spi_result.get_mysql_result(),
|
||||
out_params,
|
||||
is_forall))) {
|
||||
is_forall,
|
||||
array_binding_count))) {
|
||||
LOG_WARN("failed to open", K(id), K(type), K(ret));
|
||||
} else if (OB_FAIL(inner_fetch(ctx,
|
||||
retry_ctrl,
|
||||
@ -1660,13 +1662,15 @@ int ObSPIService::spi_execute(ObPLExecCtx *ctx,
|
||||
const bool *exprs_not_null_flag,
|
||||
const int64_t *pl_integer_ranges,
|
||||
bool is_bulk,
|
||||
bool is_forall)
|
||||
bool is_forall,
|
||||
int32_t array_binding_count)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
FLTSpanGuard(pl_spi_execute);
|
||||
OZ (spi_inner_execute(ctx, NULL, id, type, param_exprs, param_count,
|
||||
into_exprs, into_count, column_types, type_count,
|
||||
exprs_not_null_flag, pl_integer_ranges, is_bulk, is_forall));
|
||||
exprs_not_null_flag, pl_integer_ranges, is_bulk,
|
||||
is_forall, array_binding_count));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -3702,10 +3706,6 @@ int ObSPIService::spi_cursor_fetch(ObPLExecCtx *ctx,
|
||||
limit));
|
||||
|
||||
if (lib::is_mysql_mode() || OB_READ_NOTHING != ret) {
|
||||
if (lib::is_mysql_mode() && OB_READ_NOTHING == ret) {
|
||||
ret = OB_ERR_SP_FETCH_NO_DATA;
|
||||
LOG_WARN("No data found", K(ret));
|
||||
}
|
||||
//Oracle模式的cursor发生NOT FOUND错误的时候不对外报错,而是把错误信息记录在CURSOR上,PL的CG会吞掉这个错误
|
||||
SET_SPI_STATUS;
|
||||
}
|
||||
@ -4773,7 +4773,8 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx,
|
||||
int64_t into_count,
|
||||
ObMySQLProxy::MySQLResult &mysql_result,
|
||||
ObSPIOutParams &out_params,
|
||||
bool is_forall)
|
||||
bool is_forall,
|
||||
int32_t array_binding_count)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
int64_t query_num = 0;
|
||||
@ -4788,10 +4789,11 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx,
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret) && is_forall) {
|
||||
if (OB_FAIL(get_batch_query_num(exec_params, query_num))) {
|
||||
LOG_WARN("get query_num failed", K(ret));
|
||||
if (array_binding_count <= 0) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("array_binding_count is wrong", K(array_binding_count), K(ret));
|
||||
} else if (OB_FAIL(ObSQLUtils::transform_pl_ext_type(
|
||||
exec_params, query_num, param_allocator, batch_params))) {
|
||||
exec_params, array_binding_count, param_allocator, batch_params))) {
|
||||
LOG_WARN("transform failed", K(ret));
|
||||
} else if (OB_ISNULL(batch_params)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
@ -4801,8 +4803,8 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx,
|
||||
}
|
||||
}
|
||||
|
||||
OZ (inner_open(ctx, sql, id, type, *curr_params, mysql_result, out_params, is_forall),
|
||||
K(sql), K(id), K(type), K(param_count), K(out_params), K(exec_params), K(is_forall));
|
||||
OZ (inner_open(ctx, sql, id, type, *curr_params, mysql_result, out_params, is_forall, array_binding_count),
|
||||
K(sql), K(id), K(type), K(param_count), K(out_params), K(exec_params), K(is_forall), K(array_binding_count));
|
||||
|
||||
// if failed, we need release complex parameter memory in here
|
||||
if (OB_FAIL(ret)
|
||||
@ -4818,19 +4820,6 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObSPIService::get_batch_query_num(ParamStore ¶ms, int64_t &query_num)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
pl::ObPLCollection *coll = NULL;
|
||||
CK (params.count() > 0);
|
||||
CK (params.at(0).is_ext());
|
||||
CK (OB_NOT_NULL(coll = reinterpret_cast<pl::ObPLCollection*>(params.at(0).get_ext())));
|
||||
if (OB_SUCC(ret)) {
|
||||
query_num = coll->get_count();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObSPIService::inner_open(ObPLExecCtx *ctx,
|
||||
const char *sql,
|
||||
uint64_t id,
|
||||
@ -4838,7 +4827,8 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx,
|
||||
ParamStore &exec_params,
|
||||
ObMySQLProxy::MySQLResult &mysql_result,
|
||||
ObSPIOutParams &out_params,
|
||||
bool is_forall)
|
||||
bool is_forall,
|
||||
int32_t array_binding_count)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
@ -4887,7 +4877,8 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx,
|
||||
mysql_result,
|
||||
true,
|
||||
false,
|
||||
is_forall), spi_conn, id, exec_params);
|
||||
is_forall,
|
||||
array_binding_count), spi_conn, id, exec_params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user