[scn] fix failure of mittest after refresh feature scn

This commit is contained in:
obdev
2022-11-28 01:46:42 +00:00
committed by ob-robot
parent 49a02f3304
commit 54b64a7263
1898 changed files with 255804 additions and 280809 deletions

View File

@ -28,6 +28,7 @@
#include "pl/ob_pl.h"
#include "pl/ob_pl_package.h"
#include "pl/sys_package/ob_dbms_sql.h"
#include "pl/sys_package/ob_pl_utl_file.h"
#include "observer/mysql/ob_mysql_request_manager.h"
#include "observer/mysql/obmp_stmt_send_piece_data.h"
#include "observer/mysql/ob_query_driver.h"
@ -644,7 +645,7 @@ int ObSQLSessionInfo::drop_temp_tables(const bool is_disconn, const bool is_xa_t
obrpc::ObCommonRpcProxy *common_rpc_proxy = NULL;
if (OB_FAIL(get_autocommit(ac))) {
LOG_WARN("get autocommit error", K(ret), K(ac));
} else if (!(is_inner() && !is_user_session())
} else if (!is_inner()
&& (get_has_temp_table_flag()
|| has_accessed_session_level_temp_table()
|| has_tx_level_temp_table()
@ -865,9 +866,6 @@ ObPlanCache *ObSQLSessionInfo::get_plan_cache()
if (tenant_id > OB_SYS_TENANT_ID && tenant_id <= OB_MAX_RESERVED_TENANT_ID) {
// all virtual tenants use sys tenant's plan cache
tenant_id = OB_SYS_TENANT_ID;
} else if (OB_INVALID_TENANT_ID == tenant_id) {
// When it is used by threads regardless of tenants, it switches to the system tenant for execution.
tenant_id = OB_SYS_TENANT_ID;
}
plan_cache_ = plan_cache_manager_->get_or_create_plan_cache(tenant_id,
pc_mem_conf);
@ -1218,7 +1216,6 @@ int ObSQLSessionInfo::add_cursor(pl::ObPLCursorInfo *cursor)
// open_cursors is 0 to indicate a special state, no limit is set
#define NEED_CHECK_SESS_OPEN_CURSORS_LIMIT(v) (0 == v ? false : true)
int ret = OB_SUCCESS;
bool add_cursor_success = false;
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(get_effective_tenant_id()));
CK (tenant_config.is_valid());
CK (OB_NOT_NULL(cursor));
@ -1252,7 +1249,6 @@ int ObSQLSessionInfo::add_cursor(pl::ObPLCursorInfo *cursor)
LOG_WARN("fail insert ps id to hash map", K(id), K(*cursor), K(ret));
} else {
cursor->set_id(id);
add_cursor_success = true;
if (lib::is_diagnose_info_enabled()) {
EVENT_INC(SQL_OPEN_CURSORS_CURRENT);
EVENT_INC(SQL_OPEN_CURSORS_CUMULATIVE);
@ -1260,30 +1256,6 @@ int ObSQLSessionInfo::add_cursor(pl::ObPLCursorInfo *cursor)
LOG_DEBUG("ps cursor: add cursor", K(ret), K(id), K(get_sessid()));
}
}
if (!add_cursor_success && OB_NOT_NULL(cursor)) {
int64_t id = cursor->get_id();
int tmp_ret = close_cursor(cursor);
ret = OB_SUCCESS == ret ? tmp_ret : ret;
if (OB_SUCCESS != tmp_ret) {
LOG_WARN("close cursor fail when add cursor to sesssion.", K(ret), K(id), K(get_sessid()));
}
}
return ret;
}
int ObSQLSessionInfo::close_cursor(ObPLCursorInfo *&cursor)
{
int ret = OB_SUCCESS;
if (OB_NOT_NULL(cursor)) {
int64_t id = cursor->get_id();
OZ (cursor->close(*this));
cursor->~ObPLCursorInfo();
get_cursor_allocator().free(cursor);
cursor = NULL;
LOG_DEBUG("close cursor", K(ret), K(id), K(get_sessid()));
} else {
LOG_DEBUG("close cursor is null", K(get_sessid()));
}
return ret;
}