You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-11-03 17:13:17 +03:00 
			
		
		
		
	fix(plugin): MCOL-6029 use the right field from the rows_stats struct for inserts
This commit is contained in:
		
				
					committed by
					
						
						Leonid Fedorov
					
				
			
			
				
	
			
			
			
						parent
						
							e8b9adda8f
						
					
				
				
					commit
					5ffc688c26
				
			@@ -77,11 +77,6 @@ pthread_mutex_t mcs_mutex;
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
#define DEBUG_RETURN return
 | 
					#define DEBUG_RETURN return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if MYSQL_VERSION_ID >= 110500
 | 
					 | 
				
			||||||
/* because of renames in the handler class */
 | 
					 | 
				
			||||||
#define rows_changed rows_stats.updated
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
  @brief
 | 
					  @brief
 | 
				
			||||||
  Function we use in the creation of our hash to get key.
 | 
					  Function we use in the creation of our hash to get key.
 | 
				
			||||||
@@ -335,7 +330,7 @@ int ha_mcs::write_row(const uchar* buf)
 | 
				
			|||||||
  int rc;
 | 
					  int rc;
 | 
				
			||||||
  try
 | 
					  try
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    rc = ha_mcs_impl_write_row(buf, table, rows_changed, time_zone);
 | 
					    rc = ha_mcs_impl_write_row(buf, table, rows_inserted(), time_zone);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  catch (std::runtime_error& e)
 | 
					  catch (std::runtime_error& e)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
@@ -2008,7 +2003,7 @@ int ha_mcs_cache::flush_insert_cache()
 | 
				
			|||||||
    copied_rows++;
 | 
					    copied_rows++;
 | 
				
			||||||
    if ((error = parent::write_row(record)))
 | 
					    if ((error = parent::write_row(record)))
 | 
				
			||||||
      goto end;
 | 
					      goto end;
 | 
				
			||||||
    rows_changed++;
 | 
					    rows_inserted()++;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  if (error == HA_ERR_END_OF_FILE)
 | 
					  if (error == HA_ERR_END_OF_FILE)
 | 
				
			||||||
    error = 0;
 | 
					    error = 0;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -59,6 +59,16 @@ class ha_mcs : public handler
 | 
				
			|||||||
  int impl_external_lock(THD* thd, TABLE* table, int lock_type);
 | 
					  int impl_external_lock(THD* thd, TABLE* table, int lock_type);
 | 
				
			||||||
  int impl_rnd_init(TABLE* table, const std::vector<COND*>& condStack);
 | 
					  int impl_rnd_init(TABLE* table, const std::vector<COND*>& condStack);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					protected:
 | 
				
			||||||
 | 
					  ha_rows& rows_inserted()
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					#if MYSQL_VERSION_ID >= 110500
 | 
				
			||||||
 | 
					    return rows_stats.inserted;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					    return rows_changed;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 public:
 | 
					 public:
 | 
				
			||||||
  ha_mcs(handlerton* hton, TABLE_SHARE* table_arg);
 | 
					  ha_mcs(handlerton* hton, TABLE_SHARE* table_arg);
 | 
				
			||||||
  ~ha_mcs() override = default;
 | 
					  ~ha_mcs() override = default;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2891,7 +2891,7 @@ int ha_mcs_impl_delete_table(const char* name)
 | 
				
			|||||||
  int rc = ha_mcs_impl_delete_table_(dbName, name, *ci);
 | 
					  int rc = ha_mcs_impl_delete_table_(dbName, name, *ci);
 | 
				
			||||||
  return rc;
 | 
					  return rc;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
int ha_mcs_impl_write_row(const uchar* buf, TABLE* table, uint64_t rows_changed, long timeZone)
 | 
					int ha_mcs_impl_write_row(const uchar* buf, TABLE* table, uint64_t rows_inserted, long timeZone)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  THD* thd = current_thd;
 | 
					  THD* thd = current_thd;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -2921,7 +2921,7 @@ int ha_mcs_impl_write_row(const uchar* buf, TABLE* table, uint64_t rows_changed,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // At the beginning of insert, make sure there are no
 | 
					  // At the beginning of insert, make sure there are no
 | 
				
			||||||
  // left-over values from a previously possibly failed insert.
 | 
					  // left-over values from a previously possibly failed insert.
 | 
				
			||||||
  if (rows_changed == 0)
 | 
					  if (rows_inserted == 0)
 | 
				
			||||||
    ci->tableValuesMap.clear();
 | 
					    ci->tableValuesMap.clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (ci->alterTableState > 0)
 | 
					  if (ci->alterTableState > 0)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,7 +31,7 @@ extern int ha_mcs_impl_open(const char* name, int mode, uint32_t test_if_locked)
 | 
				
			|||||||
extern int ha_mcs_impl_close(void);
 | 
					extern int ha_mcs_impl_close(void);
 | 
				
			||||||
extern int ha_mcs_impl_rnd_next(uchar* buf, TABLE* table, long timeZone);
 | 
					extern int ha_mcs_impl_rnd_next(uchar* buf, TABLE* table, long timeZone);
 | 
				
			||||||
extern int ha_mcs_impl_rnd_end(TABLE* table, bool is_derived_hand = false);
 | 
					extern int ha_mcs_impl_rnd_end(TABLE* table, bool is_derived_hand = false);
 | 
				
			||||||
extern int ha_mcs_impl_write_row(const uchar* buf, TABLE* table, uint64_t rows_changed, long timeZone);
 | 
					extern int ha_mcs_impl_write_row(const uchar* buf, TABLE* table, uint64_t rows_inserted, long timeZone);
 | 
				
			||||||
extern void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_insert = false);
 | 
					extern void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_insert = false);
 | 
				
			||||||
extern int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table);
 | 
					extern int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table);
 | 
				
			||||||
extern int ha_mcs_impl_rename_table(const char* from, const char* to);
 | 
					extern int ha_mcs_impl_rename_table(const char* from, const char* to);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user