Fix: Commit asynchronously returns the packet, resulting in the affected row not being updated in time

This commit is contained in:
yaojing624
2024-01-03 19:13:39 +00:00
committed by ob-robot
parent 554cf27d1c
commit 46d1965660
2 changed files with 6 additions and 1 deletions

View File

@ -39,6 +39,12 @@ const ObEndTransCbPacketParam &ObEndTransCbPacketParam::fill(ObResultSet &rs,
// oracle ANONYMOUS_BLOCK affect rows always return 1
affected_rows_ = stmt::T_ANONYMOUS_BLOCK == rs.get_stmt_type()
? 1 : rs.get_affected_rows();
// The commit asynchronous callback logic needs
// to trigger the update logic of affected row first.
if (session.is_session_sync_support()) {
session.set_affected_rows_is_changed(affected_rows_);
}
session.set_affected_rows(affected_rows_);
last_insert_id_to_client_ = rs.get_last_insert_id_to_client();
is_partition_hit_ = session.partition_hit().get_bool();
trace_id_.set(trace_id);