mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
follow-up MDEV-18166: rename marking functions
Reformulate mark_columns_used_by_index* function family in a more laconic way: mark_columns_used_by_index -> mark_index_columns mark_columns_used_by_index_for_read_no_reset -> mark_index_columns_for_read mark_columns_used_by_index_no_reset -> mark_index_columns_no_reset static mark_index_columns -> do_mark_index_columns
This commit is contained in:
parent
0f6a5b4390
commit
f64a4f672a
6 changed files with 24 additions and 24 deletions
|
@ -465,7 +465,7 @@ void key_unpack(String *to, TABLE *table, KEY *key)
|
|||
|
||||
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields)
|
||||
{
|
||||
table->mark_columns_used_by_index(idx, &table->tmp_set);
|
||||
table->mark_index_columns(idx, &table->tmp_set);
|
||||
return bitmap_is_overlapping(&table->tmp_set, fields);
|
||||
}
|
||||
|
||||
|
|
|
@ -6681,8 +6681,8 @@ void THD::binlog_prepare_row_images(TABLE *table)
|
|||
{
|
||||
case BINLOG_ROW_IMAGE_MINIMAL:
|
||||
/* MINIMAL: Mark only PK */
|
||||
table->mark_columns_used_by_index(table->s->primary_key,
|
||||
&table->tmp_set);
|
||||
table->mark_index_columns(table->s->primary_key,
|
||||
&table->tmp_set);
|
||||
break;
|
||||
case BINLOG_ROW_IMAGE_NOBLOB:
|
||||
/**
|
||||
|
|
|
@ -1179,7 +1179,7 @@ int JOIN::init_join_caches()
|
|||
if (table->file->keyread_enabled())
|
||||
{
|
||||
if (!(table->file->index_flags(table->file->keyread, 0, 1) & HA_CLUSTERED_INDEX))
|
||||
table->mark_columns_used_by_index(table->file->keyread, table->read_set);
|
||||
table->mark_index_columns(table->file->keyread, table->read_set);
|
||||
}
|
||||
else if ((tab->read_first_record == join_read_first ||
|
||||
tab->read_first_record == join_read_last) &&
|
||||
|
|
|
@ -195,7 +195,7 @@ static void prepare_record_for_error_message(int error, TABLE *table)
|
|||
|
||||
/* Create unique_map with all fields used by that index. */
|
||||
my_bitmap_init(&unique_map, unique_map_buf, table->s->fields, FALSE);
|
||||
table->mark_columns_used_by_index(keynr, &unique_map);
|
||||
table->mark_index_columns(keynr, &unique_map);
|
||||
|
||||
/* Subtract read_set and write_set. */
|
||||
bitmap_subtract(&unique_map, table->read_set);
|
||||
|
|
32
sql/table.cc
32
sql/table.cc
|
@ -6329,7 +6329,7 @@ void TABLE::prepare_for_position()
|
|||
if ((file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) &&
|
||||
s->primary_key < MAX_KEY)
|
||||
{
|
||||
mark_columns_used_by_index_for_read_no_reset(s->primary_key);
|
||||
mark_index_columns_for_read(s->primary_key);
|
||||
/* signal change */
|
||||
file->column_bitmaps_signal();
|
||||
}
|
||||
|
@ -6345,7 +6345,7 @@ MY_BITMAP *TABLE::prepare_for_keyread(uint index, MY_BITMAP *map)
|
|||
file->ha_start_keyread(index);
|
||||
if (map != read_set || !(file->index_flags(index, 0, 1) & HA_CLUSTERED_INDEX))
|
||||
{
|
||||
mark_columns_used_by_index(index, map);
|
||||
mark_index_columns(index, map);
|
||||
column_bitmaps_set(map);
|
||||
}
|
||||
DBUG_RETURN(backup);
|
||||
|
@ -6356,12 +6356,12 @@ MY_BITMAP *TABLE::prepare_for_keyread(uint index, MY_BITMAP *map)
|
|||
Mark that only fields from one key is used. Useful before keyread.
|
||||
*/
|
||||
|
||||
void TABLE::mark_columns_used_by_index(uint index, MY_BITMAP *bitmap)
|
||||
void TABLE::mark_index_columns(uint index, MY_BITMAP *bitmap)
|
||||
{
|
||||
DBUG_ENTER("TABLE::mark_columns_used_by_index");
|
||||
DBUG_ENTER("TABLE::mark_index_columns");
|
||||
|
||||
bitmap_clear_all(bitmap);
|
||||
mark_columns_used_by_index_no_reset(index, bitmap);
|
||||
mark_index_columns_no_reset(index, bitmap);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
@ -6385,8 +6385,8 @@ void TABLE::restore_column_maps_after_keyread(MY_BITMAP *backup)
|
|||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
static void mark_index_columns(TABLE *table, uint index,
|
||||
MY_BITMAP *bitmap, bool read)
|
||||
static void do_mark_index_columns(TABLE *table, uint index,
|
||||
MY_BITMAP *bitmap, bool read)
|
||||
{
|
||||
KEY_PART_INFO *key_part= table->key_info[index].key_part;
|
||||
uint key_parts= table->key_info[index].user_defined_key_parts;
|
||||
|
@ -6397,22 +6397,22 @@ static void mark_index_columns(TABLE *table, uint index,
|
|||
bitmap_set_bit(bitmap, key_part[k].fieldnr-1);
|
||||
if (table->file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX &&
|
||||
table->s->primary_key != MAX_KEY && table->s->primary_key != index)
|
||||
mark_index_columns(table, table->s->primary_key, bitmap, read);
|
||||
do_mark_index_columns(table, table->s->primary_key, bitmap, read);
|
||||
|
||||
}
|
||||
/*
|
||||
mark columns used by key, but don't reset other fields
|
||||
*/
|
||||
|
||||
inline void TABLE::mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *bitmap)
|
||||
inline void TABLE::mark_index_columns_no_reset(uint index, MY_BITMAP *bitmap)
|
||||
{
|
||||
mark_index_columns(this, index, bitmap, false);
|
||||
do_mark_index_columns(this, index, bitmap, false);
|
||||
}
|
||||
|
||||
|
||||
inline void TABLE::mark_columns_used_by_index_for_read_no_reset(uint index)
|
||||
inline void TABLE::mark_index_columns_for_read(uint index)
|
||||
{
|
||||
mark_index_columns(this, index, read_set, true);
|
||||
do_mark_index_columns(this, index, read_set, true);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -6433,7 +6433,7 @@ void TABLE::mark_auto_increment_column()
|
|||
bitmap_set_bit(read_set, found_next_number_field->field_index);
|
||||
bitmap_set_bit(write_set, found_next_number_field->field_index);
|
||||
if (s->next_number_keypart)
|
||||
mark_columns_used_by_index_for_read_no_reset(s->next_number_index);
|
||||
mark_index_columns_for_read(s->next_number_index);
|
||||
file->column_bitmaps_signal();
|
||||
}
|
||||
|
||||
|
@ -6489,7 +6489,7 @@ void TABLE::mark_columns_needed_for_delete()
|
|||
file->use_hidden_primary_key();
|
||||
else
|
||||
{
|
||||
mark_columns_used_by_index_for_read_no_reset(s->primary_key);
|
||||
mark_index_columns_for_read(s->primary_key);
|
||||
need_signal= true;
|
||||
}
|
||||
}
|
||||
|
@ -6579,7 +6579,7 @@ void TABLE::mark_columns_needed_for_update()
|
|||
file->use_hidden_primary_key();
|
||||
else
|
||||
{
|
||||
mark_columns_used_by_index_for_read_no_reset(s->primary_key);
|
||||
mark_index_columns_for_read(s->primary_key);
|
||||
need_signal= true;
|
||||
}
|
||||
}
|
||||
|
@ -6742,7 +6742,7 @@ void TABLE::mark_columns_per_binlog_row_image()
|
|||
We don't need to mark the primary key in the rpl_write_set as the
|
||||
binary log will include all columns read anyway.
|
||||
*/
|
||||
mark_columns_used_by_index_for_read_no_reset(s->primary_key);
|
||||
mark_index_columns_for_read(s->primary_key);
|
||||
/* Only write columns that have changed */
|
||||
rpl_write_set= write_set;
|
||||
break;
|
||||
|
|
|
@ -1421,9 +1421,9 @@ public:
|
|||
MY_BITMAP *prepare_for_keyread(uint index, MY_BITMAP *map);
|
||||
MY_BITMAP *prepare_for_keyread(uint index)
|
||||
{ return prepare_for_keyread(index, &tmp_set); }
|
||||
void mark_columns_used_by_index(uint index, MY_BITMAP *map);
|
||||
void mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *map);
|
||||
void mark_columns_used_by_index_for_read_no_reset(uint index);
|
||||
void mark_index_columns(uint index, MY_BITMAP *bitmap);
|
||||
void mark_index_columns_no_reset(uint index, MY_BITMAP *bitmap);
|
||||
void mark_index_columns_for_read(uint index);
|
||||
void restore_column_maps_after_keyread(MY_BITMAP *backup);
|
||||
void mark_auto_increment_column(void);
|
||||
void mark_columns_needed_for_update(void);
|
||||
|
|
Loading…
Add table
Reference in a new issue