[to #51856685]fix dblink sanity core by optimizing dblink connection management

This commit is contained in:
seuwebber
2023-09-08 12:20:53 +08:00
committed by ob-robot
parent 8194d7657a
commit 67319c4c5d
3 changed files with 55 additions and 29 deletions

View File

@ -8544,11 +8544,14 @@ int ObSPIService::spi_execute_dblink(ObExecContext &exec_ctx,
OZ (spi_after_execute_dblink(session, routine_info, allocator, params, exec_params));
}
if (OB_NOT_NULL(dblink_conn)) {
if (OB_NOT_NULL(dblink_proxy) && OB_NOT_NULL(dblink_conn)) {
int tmp_ret = OB_SUCCESS;
if (OB_SUCCESS != (tmp_ret = dblink_proxy->release_dblink(link_type, dblink_conn))) {
LOG_WARN("failed to relese connection", K(tmp_ret));
}
if (OB_SUCC(ret)) {
ret = tmp_ret;
}
}
return ret;
}