diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-01-13 17:43:54 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-12-12 20:27:29 +0100 |
commit | 4210538122e6e868848c703dab6c1b0d59733d28 (patch) | |
tree | 82bb0a57f07ee63d980e4bec398138ad87831366 | |
parent | 03a0623f1e50c94048d23b05ec0411243f73f9f5 (diff) | |
download | mariadb-git-4210538122e6e868848c703dab6c1b0d59733d28.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 e90efbd82be..f7105086e55 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -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); diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 83340573e8a..823dbc6c281 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -1236,10 +1236,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 6bfe01ef6df..e306097afbe 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -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; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 63a86bae054..ea24223c8eb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -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; diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 83c7db8b510..e557a009686 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -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) |