From 157d130a87cf5b7b1d37e03c46f17b662d73beda Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 29 Sep 2017 20:14:03 +0000 Subject: [PATCH] Fix some conversion warnings. --- sql/opt_range.cc | 10 +++++----- sql/sql_class.cc | 2 +- sql/sql_delete.cc | 2 +- sql/sql_show.cc | 8 ++++---- storage/myisam/mi_preload.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index f06ae21fe9c..f111ecf8999 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -4756,7 +4756,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge, unique_calc_buff_size= Unique::get_cost_calc_buff_size((ulong)non_cpk_scan_records, param->table->file->ref_length, - param->thd->variables.sortbuff_size); + (size_t)param->thd->variables.sortbuff_size); if (param->imerge_cost_buff_size < unique_calc_buff_size) { if (!(param->imerge_cost_buff= (uint*)alloc_root(param->mem_root, @@ -4768,7 +4768,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge, imerge_cost += Unique::get_use_cost(param->imerge_cost_buff, (uint)non_cpk_scan_records, param->table->file->ref_length, - param->thd->variables.sortbuff_size, + (size_t)param->thd->variables.sortbuff_size, TIME_FOR_COMPARE_ROWID, FALSE, NULL); DBUG_PRINT("info",("index_merge total cost: %g (wanted: less then %g)", @@ -5021,7 +5021,7 @@ typedef struct st_common_index_intersect_info PARAM *param; /* context info for range optimizations */ uint key_size; /* size of a ROWID element stored in Unique object */ uint compare_factor; /* 1/compare - cost to compare two ROWIDs */ - ulonglong max_memory_size; /* maximum space allowed for Unique objects */ + size_t max_memory_size; /* maximum space allowed for Unique objects */ ha_rows table_cardinality; /* estimate of the number of records in table */ double cutoff_cost; /* discard index intersects with greater costs */ INDEX_SCAN_INFO *cpk_scan; /* clustered primary key used in intersection */ @@ -5216,7 +5216,7 @@ bool prepare_search_best_index_intersect(PARAM *param, common->param= param; common->key_size= table->file->ref_length; common->compare_factor= TIME_FOR_COMPARE_ROWID; - common->max_memory_size= param->thd->variables.sortbuff_size; + common->max_memory_size= (size_t)param->thd->variables.sortbuff_size; common->cutoff_cost= cutoff_cost; common->cpk_scan= NULL; common->table_cardinality= @@ -5652,7 +5652,7 @@ bool check_index_intersect_extension(PARTIAL_INDEX_INTERSECT_INFO *curr, uint *buff_elems= common_info->buff_elems; uint key_size= common_info->key_size; uint compare_factor= common_info->compare_factor; - ulonglong max_memory_size= common_info->max_memory_size; + size_t max_memory_size= common_info->max_memory_size; records_sent_to_unique+= ext_index_scan_records; cost= Unique::get_use_cost(buff_elems, (size_t) records_sent_to_unique, key_size, diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 1ab2ac67802..22d6137bfba 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -5235,7 +5235,7 @@ void THD::inc_status_sort_range() void THD::inc_status_sort_rows(ha_rows count) { - statistic_add(status_var.filesort_rows_, (ha_rows)count, &LOCK_status); + statistic_add(status_var.filesort_rows_, (ulong)count, &LOCK_status); #ifdef HAVE_PSI_STATEMENT_INTERFACE PSI_STATEMENT_CALL(inc_statement_sort_rows)(m_statement_psi, (ulong)count); #endif diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index eb5f0d7a477..a30f9ae2a32 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -794,7 +794,7 @@ l Delete multiple tables from join ***************************************************************************/ -#define MEM_STRIP_BUF_SIZE current_thd->variables.sortbuff_size +#define MEM_STRIP_BUF_SIZE (size_t)(current_thd->variables.sortbuff_size) extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b) { diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 229d284bc3d..97fa231a13a 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2437,7 +2437,7 @@ public: size_t size __attribute__((unused))) { TRASH(ptr, size); } - ulong thread_id; + my_thread_id thread_id; uint32 os_thread_id; ulonglong start_time; uint command; @@ -2611,7 +2611,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) while ((thd_info=thread_infos.get())) { protocol->prepare_for_resend(); - protocol->store((ulonglong) thd_info->thread_id); + protocol->store(thd_info->thread_id); protocol->store(thd_info->user, system_charset_info); protocol->store(thd_info->host, system_charset_info); protocol->store(thd_info->db, system_charset_info); @@ -6487,7 +6487,7 @@ static bool store_trigger(THD *thd, Trigger *trigger, { table->field[16]->set_notnull(); thd->variables.time_zone->gmt_sec_to_TIME(×tamp, - trigger->create_time/100); + (my_time_t)(trigger->create_time/100)); /* timestamp is with 6 digits */ timestamp.second_part= (trigger->create_time % 100) * 10000; ((Field_temporal_with_date*) table->field[16])->store_time_dec(×tamp, @@ -9498,7 +9498,7 @@ static bool show_create_trigger_impl(THD *thd, Trigger *trigger) { MYSQL_TIME timestamp; thd->variables.time_zone->gmt_sec_to_TIME(×tamp, - trigger->create_time/100); + (my_time_t)(trigger->create_time/100)); timestamp.second_part= (trigger->create_time % 100) * 10000; p->store(×tamp, 2); } diff --git a/storage/myisam/mi_preload.c b/storage/myisam/mi_preload.c index 5feb1c59ac3..e0d23e0fca0 100644 --- a/storage/myisam/mi_preload.c +++ b/storage/myisam/mi_preload.c @@ -68,7 +68,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) } } else - block_length= share->key_cache->param_block_size; + block_length= (size_t)share->key_cache->param_block_size; length= info->preload_buff_size/block_length * block_length; set_if_bigger(length, block_length);