1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

fix clang build

a new warning -Wunused-but-set-variable was introduced recently to clang
This commit is contained in:
Eugene Kosov
2021-06-15 13:09:15 +03:00
parent 7d591cf850
commit 1c35a3f6fd
8 changed files with 14 additions and 23 deletions

View File

@ -3928,7 +3928,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;
@ -4191,7 +4191,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
@ -4280,7 +4279,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;
@ -4296,8 +4294,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++;
@ -4348,8 +4344,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);
@ -26190,7 +26184,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) */
@ -26198,7 +26191,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)