fix temporary table not cleaned bug

This commit is contained in:
wjhh2008
2023-11-20 18:44:44 +00:00
committed by ob-robot
parent bafb8222cf
commit e68289c158
2 changed files with 5 additions and 4 deletions

View File

@ -1211,7 +1211,8 @@ bool ObResultSet::need_end_trans_callback() const
} else if (is_returning_) { } else if (is_returning_) {
need = false; need = false;
} else if (my_session_.get_has_temp_table_flag() } else if (my_session_.get_has_temp_table_flag()
|| my_session_.has_tx_level_temp_table()) { || my_session_.has_tx_level_temp_table()
|| (OB_NOT_NULL(physical_plan_) && physical_plan_->is_contain_oracle_trx_level_temporary_table())) {
need = false; need = false;
} else if (stmt::T_END_TRANS == get_stmt_type()) { } else if (stmt::T_END_TRANS == get_stmt_type()) {
need = true; need = true;

View File

@ -859,12 +859,12 @@ int ObSQLSessionInfo::drop_temp_tables(const bool is_disconn, const bool is_xa_t
if (OB_ISNULL(common_rpc_proxy)) { if (OB_ISNULL(common_rpc_proxy)) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
LOG_WARN("rpc proxy is null", K(ret)); LOG_WARN("rpc proxy is null", K(ret));
} else if (is_oracle_mode() && OB_FAIL(delete_from_oracle_temp_tables(drop_table_arg))) { } else if (OB_FAIL(delete_from_oracle_temp_tables(drop_table_arg))) {
LOG_WARN("failed to delete from oracle temporary table", K(drop_table_arg), K(ret)); LOG_WARN("failed to delete from oracle temporary table", K(drop_table_arg), K(ret));
} else if (!is_oracle_mode() && OB_FALSE_IT(drop_table_arg.compat_mode_ = lib::Worker::CompatMode::MYSQL)) { }/* else if (!is_oracle_mode() && OB_FALSE_IT(drop_table_arg.compat_mode_ = lib::Worker::CompatMode::MYSQL)) {
} else if (!is_oracle_mode() && OB_FAIL(common_rpc_proxy->drop_table(drop_table_arg, res))) { } else if (!is_oracle_mode() && OB_FAIL(common_rpc_proxy->drop_table(drop_table_arg, res))) {
LOG_WARN("failed to drop temporary table", K(drop_table_arg), K(ret)); LOG_WARN("failed to drop temporary table", K(drop_table_arg), K(ret));
} else { }*/ else {
LOG_INFO("temporary tables dropped due to connection disconnected", K(is_sess_disconn), K(drop_table_arg)); LOG_INFO("temporary tables dropped due to connection disconnected", K(is_sess_disconn), K(drop_table_arg));
} }
} }