diff options
-rw-r--r-- | mysys/mf_iocache.c | 3 | ||||
-rw-r--r-- | sql/item_func.cc | 2 | ||||
-rw-r--r-- | sql/sql_select.cc | 10 | ||||
-rw-r--r-- | storage/innobase/fil/fil0crypt.cc | 2 | ||||
-rw-r--r-- | storage/innobase/fsp/fsp0fsp.cc | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0ftsort.cc | 2 | ||||
-rw-r--r-- | storage/maria/ma_check.c | 8 | ||||
-rw-r--r-- | storage/myisam/mi_check.c | 8 |
8 files changed, 14 insertions, 23 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 8ade76e922e..0b19aaf9015 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -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; } diff --git a/sql/item_func.cc b/sql/item_func.cc index 7b39b7710fb..6b8025c9d0f 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -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) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ce706209017..fcdb671941d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -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) diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 8195716f722..94899ed0f65 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -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 */ diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc index 58aa18ac323..cb5eff07f88 100644 --- a/storage/innobase/fsp/fsp0fsp.cc +++ b/storage/innobase/fsp/fsp0fsp.cc @@ -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; } diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index 2ca930e0934..29e126290cf 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -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]); } diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 2795528a044..cb4585d0f62 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -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) { diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index d9b9bb5af4a..8bae409d1e6 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -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) { |