[CP] [dblink][4.x] add defensive measure for unexpected ref of tx desc

This commit is contained in:
obdev
2024-02-10 00:26:04 +00:00
committed by ob-robot
parent 1b77f3c4ca
commit e8fb45ef6f
5 changed files with 49 additions and 18 deletions

View File

@ -208,6 +208,14 @@ int ObSqlTransControl::implicit_end_trans(ObExecContext &exec_ctx,
#endif
ObSQLSessionInfo *session = GET_MY_SESSION(exec_ctx);
CK (OB_NOT_NULL(session));
if (OB_SUCCESS != ret) {
// do nothing
} else if (session->associated_xa()) {
// NOTE that not support dblink trans in this interface
// PLEASE handle implicit cases for dblink trans instead of this interface
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("executing do end trans in xa", K(ret), K(session->get_xid()));
}
int64_t tx_id = 0;
OX (tx_id = session->get_tx_id().get_id());
CHECK_TX_FREE_ROUTE(exec_ctx, session);