diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-01-13 17:43:54 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-10-08 15:24:06 +0200 |
commit | 62c92bce422362b8e9e522ddc64f429cf9ab3120 (patch) | |
tree | a7327201a575a029ba303290df22c8a313dfeb94 | |
parent | a3d55f8caae739c5959d57c27dd425525cdaaef5 (diff) | |
download | mariadb-git-62c92bce422362b8e9e522ddc64f429cf9ab3120.tar.gz |
cleanup: avoid Field::field_index
prefer x->field over table->field[x->field->field_index]
-rw-r--r-- | sql/item_subselect.cc | 2 | ||||
-rw-r--r-- | sql/item_subselect.h | 4 | ||||
-rw-r--r-- | sql/sql_load.cc | 2 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 | ||||
-rw-r--r-- | sql/sql_statistics.cc | 4 |
5 files changed, 7 insertions, 7 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 8745baa8c69..90b7a558c12 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -6145,7 +6145,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); diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 58b5a948048..86e97423e28 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -1226,10 +1226,10 @@ public: 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; } diff --git a/sql/sql_load.cc b/sql/sql_load.cc index f1c29203f3e..842a251e583 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -790,7 +790,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; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 3134f8eb007..876700105e9 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7354,7 +7354,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; diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index f6811b020eb..c98e5ab7daf 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -3582,7 +3582,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(); @@ -3620,7 +3620,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) |