[to #50408284]spi_result need close result set first

This commit is contained in:
LiuYoung00
2023-07-26 10:12:46 +00:00
committed by ob-robot
parent 271b8814fe
commit 0cabd54742
2 changed files with 8 additions and 1 deletions

View File

@ -3505,6 +3505,13 @@ int ObSPIService::spi_cursor_open(ObPLExecCtx *ctx,
spi_result->end_cursor_stmt(ctx, ret);
if (!need_destruct && OB_SUCCESS != ret) {
need_destruct = true;
if (OB_NOT_NULL(spi_result->get_result_set())) {
// 此分支所有错误码都被吞掉,最终返回最初的错误码
int close_ret = spi_result->close_result_set();
if (OB_SUCCESS != close_ret) {
LOG_WARN("close mysql result set failed", K(ret), K(close_ret));
}
}
}
}
if (need_destruct) {

View File

@ -111,7 +111,7 @@ public:
need_end_nested_stmt_(EST_NEED_NOT),
mem_context_(nullptr),
mem_context_destroy_guard_(mem_context_),
allocator_(ObModIds::OB_PL_TEMP),
allocator_(ObModIds::OB_PL_TEMP, OB_MALLOC_NORMAL_BLOCK_SIZE, MTL_ID()),
result_set_(NULL),
sql_ctx_(),
schema_guard_(share::schema::ObSchemaMgrItem::MOD_SPI_RESULT_SET),