Fix: Commit asynchronously returns the packet, resulting in the affected row not being updated in time
This commit is contained in:
		@ -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);
 | 
			
		||||
 | 
			
		||||
@ -4005,7 +4005,6 @@ int ObQueryInfoEncoder::deserialize(ObSQLSessionInfo &sess, const char *buf, con
 | 
			
		||||
{
 | 
			
		||||
  int ret = OB_SUCCESS;
 | 
			
		||||
  int64_t affected_rows = 0;
 | 
			
		||||
  int64_t found_rows = 0;
 | 
			
		||||
  OB_UNIS_DECODE(affected_rows);
 | 
			
		||||
  sess.set_affected_rows(affected_rows);
 | 
			
		||||
  return ret;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user