[CP] End stmt prioritize returning session error code

This commit is contained in:
felix-w15 2023-10-13 04:09:46 +00:00 committed by ob-robot
parent 75b04d6a2b
commit 8b804c84d6

View File

@ -1055,6 +1055,10 @@ int ObSqlTransControl::end_stmt(ObExecContext &exec_ctx, const bool rollback)
auto &touched_ls = tx_result.get_touched_ls();
OZ (txs->rollback_to_implicit_savepoint(*tx_desc, savepoint, stmt_expire_ts, &touched_ls),
savepoint, stmt_expire_ts, touched_ls);
// prioritize returning session error code
if (session->is_terminate(ret)) {
LOG_INFO("trans has terminated when end stmt", K(ret), K(tx_id_before_rollback));
}
}
// this may happend cause tx may implicit aborted
// (for example: first write sql of implicit started trans meet lock conflict)