fix bug Batch optimization may cause auto-increment column jumps
This commit is contained in:
		
				
					committed by
					
						
						ob-robot
					
				
			
			
				
	
			
			
			
						parent
						
							01ad74c050
						
					
				
				
					commit
					b9ae891ab1
				
			@ -2795,7 +2795,11 @@ int ObDelUpdResolver::get_value_row_size(uint64_t& value_row_size)
 | 
			
		||||
  } else if (del_upd_stmt->is_insert_stmt()) {
 | 
			
		||||
    ObInsertStmt *insert_stmt = static_cast<ObInsertStmt*>(del_upd_stmt);
 | 
			
		||||
    if (!insert_stmt->value_from_select()) {
 | 
			
		||||
      value_row_size = insert_stmt->get_insert_row_count();
 | 
			
		||||
      if (params_.is_batch_stmt_) {
 | 
			
		||||
        value_row_size = params_.batch_stmt_num_;
 | 
			
		||||
      } else {
 | 
			
		||||
        value_row_size = insert_stmt->get_insert_row_count();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return ret;
 | 
			
		||||
 | 
			
		||||
@ -327,6 +327,7 @@ struct ObResolverParams
 | 
			
		||||
       have_same_table_name_(false),
 | 
			
		||||
       is_default_param_(false),
 | 
			
		||||
       is_batch_stmt_(false),
 | 
			
		||||
       batch_stmt_num_(0),
 | 
			
		||||
       new_gen_did_(common::OB_INVALID_ID - 1),
 | 
			
		||||
       new_gen_cid_(common::OB_MAX_TMP_COLUMN_ID),
 | 
			
		||||
       new_gen_qid_(1),
 | 
			
		||||
@ -388,6 +389,7 @@ public:
 | 
			
		||||
  bool have_same_table_name_;
 | 
			
		||||
  bool is_default_param_;
 | 
			
		||||
  bool is_batch_stmt_;
 | 
			
		||||
  int64_t batch_stmt_num_;
 | 
			
		||||
private:
 | 
			
		||||
  uint64_t new_gen_did_;
 | 
			
		||||
  uint64_t new_gen_cid_;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user