mirror of
https://github.com/MariaDB/server.git
synced 2025-04-02 05:15:33 +02:00
fix clang build
a new warning -Wunused-but-set-variable was introduced recently to clang
This commit is contained in:
parent
7d591cf850
commit
1c35a3f6fd
8 changed files with 14 additions and 23 deletions
mysys
sql
storage
|
@ -1384,7 +1384,7 @@ static void copy_to_read_buffer(IO_CACHE *write_cache,
|
|||
|
||||
static int _my_b_seq_read(IO_CACHE *info, uchar *Buffer, size_t Count)
|
||||
{
|
||||
size_t length, diff_length, left_length= 0, save_count, max_length;
|
||||
size_t length, diff_length, save_count, max_length;
|
||||
my_off_t pos_in_file;
|
||||
save_count=Count;
|
||||
|
||||
|
@ -1435,7 +1435,6 @@ static int _my_b_seq_read(IO_CACHE *info, uchar *Buffer, size_t Count)
|
|||
*/
|
||||
goto read_append_buffer;
|
||||
}
|
||||
left_length+=length;
|
||||
diff_length=0;
|
||||
}
|
||||
|
||||
|
|
|
@ -2756,7 +2756,6 @@ bool Item_func_min_max::fix_length_and_dec()
|
|||
max_length=0;
|
||||
maybe_null=0;
|
||||
Item_result tmp_cmp_type= args[0]->cmp_type();
|
||||
uint string_type_count= 0;
|
||||
uint temporal_type_count= 0;
|
||||
enum_field_types temporal_field_type= MYSQL_TYPE_DATETIME;
|
||||
|
||||
|
@ -2769,7 +2768,6 @@ bool Item_func_min_max::fix_length_and_dec()
|
|||
if (args[i]->maybe_null)
|
||||
maybe_null= 1;
|
||||
tmp_cmp_type= item_cmp_type(tmp_cmp_type, args[i]->cmp_type());
|
||||
string_type_count+= args[i]->cmp_type() == STRING_RESULT;
|
||||
if (args[i]->cmp_type() == TIME_RESULT)
|
||||
{
|
||||
if (!temporal_type_count)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1012,13 +1012,11 @@ static bool fil_crypt_start_encrypting_space(fil_space_t* space)
|
|||
/* 4 - sync tablespace before publishing crypt data */
|
||||
|
||||
bool success = false;
|
||||
ulint sum_pages = 0;
|
||||
|
||||
do {
|
||||
ulint n_pages = 0;
|
||||
success = buf_flush_lists(ULINT_MAX, end_lsn, &n_pages);
|
||||
buf_flush_wait_batch_end(NULL, BUF_FLUSH_LIST);
|
||||
sum_pages += n_pages;
|
||||
} while (!success);
|
||||
|
||||
/* 5 - publish crypt data */
|
||||
|
|
|
@ -2719,7 +2719,6 @@ fsp_reserve_free_extents(
|
|||
ulint n_free;
|
||||
ulint n_free_up;
|
||||
ulint reserve;
|
||||
size_t total_reserved = 0;
|
||||
|
||||
ut_ad(mtr);
|
||||
*n_reserved = n_ext;
|
||||
|
@ -2801,7 +2800,6 @@ try_again:
|
|||
}
|
||||
try_to_extend:
|
||||
if (ulint n = fsp_try_extend_data_file(space, space_header, mtr)) {
|
||||
total_reserved += n;
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
|
|
|
@ -770,7 +770,6 @@ fts_parallel_tokenization(
|
|||
row_merge_block_t** crypt_block;
|
||||
int tmpfd[FTS_NUM_AUX_INDEX];
|
||||
ulint mycount[FTS_NUM_AUX_INDEX];
|
||||
ib_uint64_t total_rec = 0;
|
||||
ulint num_doc_processed = 0;
|
||||
doc_id_t last_doc_id = 0;
|
||||
mem_heap_t* blob_heap = NULL;
|
||||
|
@ -1038,7 +1037,6 @@ exit:
|
|||
goto func_exit;
|
||||
}
|
||||
|
||||
total_rec += merge_file[i]->n_rec;
|
||||
close(tmpfd[i]);
|
||||
}
|
||||
|
||||
|
|
|
@ -4191,7 +4191,7 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
|
|||
const char * name, my_bool rep_quick)
|
||||
{
|
||||
int got_error;
|
||||
uint i,key, total_key_length, istep;
|
||||
uint i,key, istep;
|
||||
ha_rows start_records;
|
||||
my_off_t new_header_length,del;
|
||||
File new_file;
|
||||
|
@ -4353,7 +4353,9 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
|
|||
_ma_check_print_error(param,"Not enough memory for key!");
|
||||
goto err;
|
||||
}
|
||||
total_key_length=0;
|
||||
#ifdef USING_SECOND_APPROACH
|
||||
uint total_key_length=0;
|
||||
#endif
|
||||
rec_per_key_part= param->new_rec_per_key_part;
|
||||
share->state.state.records=share->state.state.del=share->state.split=0;
|
||||
share->state.state.empty=0;
|
||||
|
@ -4422,7 +4424,9 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
|
|||
if (keyseg->flag & HA_NULL_PART)
|
||||
sort_param[i].key_length++;
|
||||
}
|
||||
#ifdef USING_SECOND_APPROACH
|
||||
total_key_length+=sort_param[i].key_length;
|
||||
#endif
|
||||
|
||||
if (sort_param[i].keyinfo->flag & HA_FULLTEXT)
|
||||
{
|
||||
|
|
|
@ -2614,7 +2614,7 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
|
|||
const char * name, int rep_quick)
|
||||
{
|
||||
int got_error;
|
||||
uint i,key, total_key_length, istep;
|
||||
uint i,key, istep;
|
||||
ulong rec_length;
|
||||
ha_rows start_records;
|
||||
my_off_t new_header_length,del;
|
||||
|
@ -2800,7 +2800,9 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
|
|||
mi_check_print_error(param,"Not enough memory for key!");
|
||||
goto err;
|
||||
}
|
||||
total_key_length=0;
|
||||
#ifdef USING_SECOND_APPROACH
|
||||
uint total_key_length=0;
|
||||
#endif
|
||||
rec_per_key_part= param->rec_per_key_part;
|
||||
info->state->records=info->state->del=share->state.split=0;
|
||||
info->state->empty=0;
|
||||
|
@ -2869,7 +2871,9 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
|
|||
if (keyseg->flag & HA_NULL_PART)
|
||||
sort_param[i].key_length++;
|
||||
}
|
||||
#ifdef USING_SECOND_APPROACH
|
||||
total_key_length+=sort_param[i].key_length;
|
||||
#endif
|
||||
|
||||
if (sort_param[i].keyinfo->flag & HA_FULLTEXT)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue