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

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2021-06-21 14:22:22 +03:00
86 changed files with 791 additions and 631 deletions

View File

@ -4935,7 +4935,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;
@ -5201,7 +5201,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
@ -5291,7 +5290,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;
@ -5307,8 +5305,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++;
@ -5360,8 +5356,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);
@ -28324,7 +28318,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) */
@ -28332,7 +28325,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)