1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.2 into 10.3

This commit is contained in:
Marko Mäkelä
2021-06-21 09:07:40 +03:00
43 changed files with 427 additions and 162 deletions

View File

@ -4500,7 +4500,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
int error= 0;
TABLE *UNINIT_VAR(table); /* inited in all loops */
uint i,table_count,const_count,key;
table_map found_const_table_map, all_table_map, found_ref, refs;
table_map found_const_table_map, all_table_map;
key_map const_ref, eq_part;
bool has_expensive_keyparts;
TABLE **table_vector;
@ -4763,7 +4763,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
{
ref_changed = 0;
more_const_tables_found:
found_ref=0;
/*
We only have to loop from stat_vector + const_count as
@ -4853,7 +4852,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
key=keyuse->key;
s->keys.set_bit(key); // TODO: remove this ?
refs=0;
const_ref.clear_all();
eq_part.clear_all();
has_expensive_keyparts= false;
@ -4869,8 +4867,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
if (keyuse->val->is_expensive())
has_expensive_keyparts= true;
}
else
refs|=keyuse->used_tables;
eq_part.set_bit(keyuse->keypart);
}
keyuse++;
@ -4922,8 +4918,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
found_const_table_map|= table->map;
break;
}
else
found_ref|= refs; // Table is const if all refs are const
}
else if (base_const_ref == base_eq_part)
s->const_keys.set_bit(key);
@ -27248,7 +27242,6 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab,
*/
if (tab)
{
key_part_map const_parts= 0;
key_part_map map= 1;
uint kp;
/* Find how many key parts would be used by ref(const) */
@ -27256,7 +27249,6 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab,
{
if (!(table->const_key_parts[keynr] & map))
break;
const_parts |= map;
}
if (kp > 0)