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 // oracle ANONYMOUS_BLOCK affect rows always return 1
affected_rows_ = stmt::T_ANONYMOUS_BLOCK == rs.get_stmt_type() affected_rows_ = stmt::T_ANONYMOUS_BLOCK == rs.get_stmt_type()
? 1 : rs.get_affected_rows(); ? 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(); last_insert_id_to_client_ = rs.get_last_insert_id_to_client();
is_partition_hit_ = session.partition_hit().get_bool(); is_partition_hit_ = session.partition_hit().get_bool();
trace_id_.set(trace_id); trace_id_.set(trace_id);

View File

@ -4005,7 +4005,6 @@ int ObQueryInfoEncoder::deserialize(ObSQLSessionInfo &sess, const char *buf, con
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
int64_t affected_rows = 0; int64_t affected_rows = 0;
int64_t found_rows = 0;
OB_UNIS_DECODE(affected_rows); OB_UNIS_DECODE(affected_rows);
sess.set_affected_rows(affected_rows); sess.set_affected_rows(affected_rows);
return ret; return ret;