Skip to content

Commit f64a4f6

Browse files
committed
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
1 parent 0f6a5b4 commit f64a4f6

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

sql/key.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ void key_unpack(String *to, TABLE *table, KEY *key)
465465

466466
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields)
467467
{
468-
table->mark_columns_used_by_index(idx, &table->tmp_set);
468+
table->mark_index_columns(idx, &table->tmp_set);
469469
return bitmap_is_overlapping(&table->tmp_set, fields);
470470
}
471471

sql/sql_class.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6681,8 +6681,8 @@ void THD::binlog_prepare_row_images(TABLE *table)
66816681
{
66826682
case BINLOG_ROW_IMAGE_MINIMAL:
66836683
/* MINIMAL: Mark only PK */
6684-
table->mark_columns_used_by_index(table->s->primary_key,
6685-
&table->tmp_set);
6684+
table->mark_index_columns(table->s->primary_key,
6685+
&table->tmp_set);
66866686
break;
66876687
case BINLOG_ROW_IMAGE_NOBLOB:
66886688
/**

sql/sql_select.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ int JOIN::init_join_caches()
11791179
if (table->file->keyread_enabled())
11801180
{
11811181
if (!(table->file->index_flags(table->file->keyread, 0, 1) & HA_CLUSTERED_INDEX))
1182-
table->mark_columns_used_by_index(table->file->keyread, table->read_set);
1182+
table->mark_index_columns(table->file->keyread, table->read_set);
11831183
}
11841184
else if ((tab->read_first_record == join_read_first ||
11851185
tab->read_first_record == join_read_last) &&

sql/sql_update.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static void prepare_record_for_error_message(int error, TABLE *table)
195195

196196
/* Create unique_map with all fields used by that index. */
197197
my_bitmap_init(&unique_map, unique_map_buf, table->s->fields, FALSE);
198-
table->mark_columns_used_by_index(keynr, &unique_map);
198+
table->mark_index_columns(keynr, &unique_map);
199199

200200
/* Subtract read_set and write_set. */
201201
bitmap_subtract(&unique_map, table->read_set);

sql/table.cc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6329,7 +6329,7 @@ void TABLE::prepare_for_position()
63296329
if ((file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) &&
63306330
s->primary_key < MAX_KEY)
63316331
{
6332-
mark_columns_used_by_index_for_read_no_reset(s->primary_key);
6332+
mark_index_columns_for_read(s->primary_key);
63336333
/* signal change */
63346334
file->column_bitmaps_signal();
63356335
}
@@ -6345,7 +6345,7 @@ MY_BITMAP *TABLE::prepare_for_keyread(uint index, MY_BITMAP *map)
63456345
file->ha_start_keyread(index);
63466346
if (map != read_set || !(file->index_flags(index, 0, 1) & HA_CLUSTERED_INDEX))
63476347
{
6348-
mark_columns_used_by_index(index, map);
6348+
mark_index_columns(index, map);
63496349
column_bitmaps_set(map);
63506350
}
63516351
DBUG_RETURN(backup);
@@ -6356,12 +6356,12 @@ MY_BITMAP *TABLE::prepare_for_keyread(uint index, MY_BITMAP *map)
63566356
Mark that only fields from one key is used. Useful before keyread.
63576357
*/
63586358

6359-
void TABLE::mark_columns_used_by_index(uint index, MY_BITMAP *bitmap)
6359+
void TABLE::mark_index_columns(uint index, MY_BITMAP *bitmap)
63606360
{
6361-
DBUG_ENTER("TABLE::mark_columns_used_by_index");
6361+
DBUG_ENTER("TABLE::mark_index_columns");
63626362

63636363
bitmap_clear_all(bitmap);
6364-
mark_columns_used_by_index_no_reset(index, bitmap);
6364+
mark_index_columns_no_reset(index, bitmap);
63656365
DBUG_VOID_RETURN;
63666366
}
63676367

@@ -6385,8 +6385,8 @@ void TABLE::restore_column_maps_after_keyread(MY_BITMAP *backup)
63856385
DBUG_VOID_RETURN;
63866386
}
63876387

6388-
static void mark_index_columns(TABLE *table, uint index,
6389-
MY_BITMAP *bitmap, bool read)
6388+
static void do_mark_index_columns(TABLE *table, uint index,
6389+
MY_BITMAP *bitmap, bool read)
63906390
{
63916391
KEY_PART_INFO *key_part= table->key_info[index].key_part;
63926392
uint key_parts= table->key_info[index].user_defined_key_parts;
@@ -6397,22 +6397,22 @@ static void mark_index_columns(TABLE *table, uint index,
63976397
bitmap_set_bit(bitmap, key_part[k].fieldnr-1);
63986398
if (table->file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX &&
63996399
table->s->primary_key != MAX_KEY && table->s->primary_key != index)
6400-
mark_index_columns(table, table->s->primary_key, bitmap, read);
6400+
do_mark_index_columns(table, table->s->primary_key, bitmap, read);
64016401

64026402
}
64036403
/*
64046404
mark columns used by key, but don't reset other fields
64056405
*/
64066406

6407-
inline void TABLE::mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *bitmap)
6407+
inline void TABLE::mark_index_columns_no_reset(uint index, MY_BITMAP *bitmap)
64086408
{
6409-
mark_index_columns(this, index, bitmap, false);
6409+
do_mark_index_columns(this, index, bitmap, false);
64106410
}
64116411

64126412

6413-
inline void TABLE::mark_columns_used_by_index_for_read_no_reset(uint index)
6413+
inline void TABLE::mark_index_columns_for_read(uint index)
64146414
{
6415-
mark_index_columns(this, index, read_set, true);
6415+
do_mark_index_columns(this, index, read_set, true);
64166416
}
64176417

64186418
/*
@@ -6433,7 +6433,7 @@ void TABLE::mark_auto_increment_column()
64336433
bitmap_set_bit(read_set, found_next_number_field->field_index);
64346434
bitmap_set_bit(write_set, found_next_number_field->field_index);
64356435
if (s->next_number_keypart)
6436-
mark_columns_used_by_index_for_read_no_reset(s->next_number_index);
6436+
mark_index_columns_for_read(s->next_number_index);
64376437
file->column_bitmaps_signal();
64386438
}
64396439

@@ -6489,7 +6489,7 @@ void TABLE::mark_columns_needed_for_delete()
64896489
file->use_hidden_primary_key();
64906490
else
64916491
{
6492-
mark_columns_used_by_index_for_read_no_reset(s->primary_key);
6492+
mark_index_columns_for_read(s->primary_key);
64936493
need_signal= true;
64946494
}
64956495
}
@@ -6579,7 +6579,7 @@ void TABLE::mark_columns_needed_for_update()
65796579
file->use_hidden_primary_key();
65806580
else
65816581
{
6582-
mark_columns_used_by_index_for_read_no_reset(s->primary_key);
6582+
mark_index_columns_for_read(s->primary_key);
65836583
need_signal= true;
65846584
}
65856585
}
@@ -6742,7 +6742,7 @@ void TABLE::mark_columns_per_binlog_row_image()
67426742
We don't need to mark the primary key in the rpl_write_set as the
67436743
binary log will include all columns read anyway.
67446744
*/
6745-
mark_columns_used_by_index_for_read_no_reset(s->primary_key);
6745+
mark_index_columns_for_read(s->primary_key);
67466746
/* Only write columns that have changed */
67476747
rpl_write_set= write_set;
67486748
break;

sql/table.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,9 +1421,9 @@ struct TABLE
14211421
MY_BITMAP *prepare_for_keyread(uint index, MY_BITMAP *map);
14221422
MY_BITMAP *prepare_for_keyread(uint index)
14231423
{ return prepare_for_keyread(index, &tmp_set); }
1424-
void mark_columns_used_by_index(uint index, MY_BITMAP *map);
1425-
void mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *map);
1426-
void mark_columns_used_by_index_for_read_no_reset(uint index);
1424+
void mark_index_columns(uint index, MY_BITMAP *bitmap);
1425+
void mark_index_columns_no_reset(uint index, MY_BITMAP *bitmap);
1426+
void mark_index_columns_for_read(uint index);
14271427
void restore_column_maps_after_keyread(MY_BITMAP *backup);
14281428
void mark_auto_increment_column(void);
14291429
void mark_columns_needed_for_update(void);

0 commit comments

Comments
 (0)