Commit 42105381 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: avoid Field::field_index

prefer x->field over table->field[x->field->field_index]
parent 03a0623f
......@@ -6186,7 +6186,7 @@ subselect_rowid_merge_engine::init(MY_BITMAP *non_null_key_parts,
Check if the first and only indexed column contains NULL in the curent
row, and add the row number to the corresponding key.
*/
if (tmp_table->field[merge_keys[i]->get_field_idx(0)]->is_null())
if (merge_keys[i]->get_field(0)->is_null())
merge_keys[i]->set_null(cur_rownum);
else
merge_keys[i]->add_key(cur_rownum);
......
......@@ -1236,10 +1236,10 @@ class Ordered_key : public Sql_alloc
uint get_column_count() { return key_column_count; }
uint get_keyid() { return keyid; }
uint get_field_idx(uint i)
Field *get_field(uint i)
{
DBUG_ASSERT(i < key_column_count);
return key_columns[i]->field->field_index;
return key_columns[i]->field;
}
rownum_t get_min_null_row() { return min_null_row; }
rownum_t get_max_null_row() { return max_null_row; }
......
......@@ -881,7 +881,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
while ((sql_field= (Item_field*) it++))
{
if (table->field[sql_field->field->field_index] == table->next_number_field)
if (sql_field->field == table->next_number_field)
auto_increment_field_not_null= true;
}
......
......@@ -7490,7 +7490,7 @@ double table_multi_eq_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s,
if (!s->keyuse)
return sel;
Item_equal *item_equal;
Item_equal *item_equal;
List_iterator_fast<Item_equal> it(cond_equal->current_level);
TABLE *table= s->table;
table_map table_bit= table->map;
......
......@@ -3591,7 +3591,7 @@ double get_column_avg_frequency(Field * field)
return res;
}
Column_statistics *col_stats= table->s->field[field->field_index]->read_stats;
Column_statistics *col_stats= field->read_stats;
if (!col_stats)
res= table->stat_records();
......@@ -3629,7 +3629,7 @@ double get_column_range_cardinality(Field *field,
{
double res;
TABLE *table= field->table;
Column_statistics *col_stats= table->field[field->field_index]->read_stats;
Column_statistics *col_stats= field->read_stats;
double tab_records= table->stat_records();
if (!col_stats)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment