diff --git a/sql/item.h b/sql/item.h index ae5acd365e1..1aa613a25b8 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2529,7 +2529,6 @@ public: { TABLE *tab= field->table; tab->covering_keys.intersect(field->part_of_key); - tab->merge_keys.merge(field->part_of_key); if (tab->read_set) bitmap_fast_test_and_set(tab->read_set, field->field_index); /* diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 9bd0c062cdc..a3790043f9f 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5027,7 +5027,6 @@ static void update_field_dependencies(THD *thd, Field *field, TABLE *table) */ table->covering_keys.intersect(field->part_of_key); - table->merge_keys.merge(field->part_of_key); if (field->vcol_info) table->mark_virtual_col(field); @@ -6376,7 +6375,6 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2, /* Mark field_1 used for table cache. */ bitmap_set_bit(table_1->read_set, field_1->field_index); table_1->covering_keys.intersect(field_1->part_of_key); - table_1->merge_keys.merge(field_1->part_of_key); } if (field_2) { @@ -6384,7 +6382,6 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2, /* Mark field_2 used for table cache. */ bitmap_set_bit(table_2->read_set, field_2->field_index); table_2->covering_keys.intersect(field_2->part_of_key); - table_2->merge_keys.merge(field_2->part_of_key); } if (using_fields != NULL) @@ -7479,7 +7476,6 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, if (table) { table->covering_keys.intersect(field->part_of_key); - table->merge_keys.merge(field->part_of_key); } if (tables->is_natural_join) { @@ -7499,7 +7495,6 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, thd->lex->current_select->select_list_tables|= field_table->map; field_table->covering_keys.intersect(field->part_of_key); - field_table->merge_keys.merge(field->part_of_key); field_table->used_fields++; } } diff --git a/sql/sql_base.h b/sql/sql_base.h index 2c0e6850d04..8f363a73863 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -329,14 +329,12 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr) table->force_index= table_list->force_index; table->force_index_order= table->force_index_group= 0; table->covering_keys= table->s->keys_for_keyread; - table->merge_keys.clear_all(); TABLE_LIST *orig= table_list->select_lex ? table_list->select_lex->master_unit()->derived : 0; if (!orig || !orig->is_merged_derived()) { /* Tables merged from derived were set up already.*/ table->covering_keys= table->s->keys_for_keyread; - table->merge_keys.clear_all(); } } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 19e7668790e..bea3b14e607 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -4122,7 +4122,6 @@ void SELECT_LEX::update_used_tables() TABLE *tab= tl->table; tab->covering_keys= tab->s->keys_for_keyread; tab->covering_keys.intersect(tab->keys_in_use_for_query); - tab->merge_keys.clear_all(); bitmap_clear_all(tab->read_set); if (tab->vcol_set) bitmap_clear_all(tab->vcol_set); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ed121191209..5eda6e9bbbb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -16338,7 +16338,6 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List &fields, table->in_use= thd; table->quick_keys.init(); table->covering_keys.init(); - table->merge_keys.init(); table->intersect_keys.init(); table->keys_in_use_for_query.init(); table->no_rows_with_nulls= param->force_not_null_cols; diff --git a/sql/table.cc b/sql/table.cc index 7e139652b6f..7d14f961721 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2878,7 +2878,6 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share, goto err; outparam->quick_keys.init(); outparam->covering_keys.init(); - outparam->merge_keys.init(); outparam->intersect_keys.init(); outparam->keys_in_use_for_query.init(); diff --git a/sql/table.h b/sql/table.h index 27439670a22..344655ebbbc 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1042,7 +1042,7 @@ public: needed by the query without reading the row. */ key_map covering_keys; - key_map quick_keys, merge_keys,intersect_keys; + key_map quick_keys, intersect_keys; /* A set of keys that can be used in the query that references this table.