Commit ccf21c99 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

fix some conversion warnings

parent 7354dc67
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
used in Item_sum_* used in Item_sum_*
*/ */
ulonglong Item_sum::ram_limitation(THD *thd) size_t Item_sum::ram_limitation(THD *thd)
{ {
return MY_MIN(thd->variables.tmp_memory_table_size, return (size_t)MY_MIN(thd->variables.tmp_memory_table_size,
thd->variables.max_heap_table_size); thd->variables.max_heap_table_size);
} }
......
...@@ -382,7 +382,7 @@ class Item_sum :public Item_func_or_sum ...@@ -382,7 +382,7 @@ class Item_sum :public Item_func_or_sum
*/ */
Item **orig_args, *tmp_orig_args[2]; Item **orig_args, *tmp_orig_args[2];
static ulonglong ram_limitation(THD *thd); static size_t ram_limitation(THD *thd);
public: public:
......
...@@ -10912,7 +10912,7 @@ int read_keys_and_merge_scans(THD *thd, ...@@ -10912,7 +10912,7 @@ int read_keys_and_merge_scans(THD *thd,
unique= new Unique(refpos_order_cmp, (void *)file, unique= new Unique(refpos_order_cmp, (void *)file,
file->ref_length, file->ref_length,
thd->variables.sortbuff_size, (size_t)thd->variables.sortbuff_size,
intersection ? quick_selects.elements : 0); intersection ? quick_selects.elements : 0);
if (!unique) if (!unique)
goto err; goto err;
......
...@@ -557,8 +557,8 @@ struct Query_cache_query_flags ...@@ -557,8 +557,8 @@ struct Query_cache_query_flags
ha_rows limit; ha_rows limit;
Time_zone *time_zone; Time_zone *time_zone;
sql_mode_t sql_mode; sql_mode_t sql_mode;
ulong max_sort_length; ulonglong max_sort_length;
ulong group_concat_max_len; ulonglong group_concat_max_len;
ulong default_week_format; ulong default_week_format;
ulong div_precision_increment; ulong div_precision_increment;
MY_LOCALE *lc_time_names; MY_LOCALE *lc_time_names;
......
...@@ -4352,7 +4352,7 @@ static bool prepare_blob_field(THD *thd, Column_definition *sql_field) ...@@ -4352,7 +4352,7 @@ static bool prepare_blob_field(THD *thd, Column_definition *sql_field)
sql_field->sql_type == FIELD_TYPE_MEDIUM_BLOB) sql_field->sql_type == FIELD_TYPE_MEDIUM_BLOB)
{ {
/* The user has given a length to the blob column */ /* The user has given a length to the blob column */
sql_field->sql_type= get_blob_type_from_length(sql_field->length); sql_field->sql_type= get_blob_type_from_length((ulong)sql_field->length);
sql_field->pack_length= calc_pack_length(sql_field->sql_type, 0); sql_field->pack_length= calc_pack_length(sql_field->sql_type, 0);
} }
sql_field->length= 0; sql_field->length= 0;
......
...@@ -432,7 +432,7 @@ static void push_locks_into_array(DYNAMIC_ARRAY *ar, THR_LOCK_DATA *data, ...@@ -432,7 +432,7 @@ static void push_locks_into_array(DYNAMIC_ARRAY *ar, THR_LOCK_DATA *data,
if (table && table->s->tmp_table == NO_TMP_TABLE) if (table && table->s->tmp_table == NO_TMP_TABLE)
{ {
TABLE_LOCK_INFO table_lock_info; TABLE_LOCK_INFO table_lock_info;
table_lock_info.thread_id= table->in_use->thread_id; table_lock_info.thread_id= (ulong)table->in_use->thread_id;
memcpy(table_lock_info.table_name, table->s->table_cache_key.str, memcpy(table_lock_info.table_name, table->s->table_cache_key.str,
table->s->table_cache_key.length); table->s->table_cache_key.length);
table_lock_info.table_name[strlen(table_lock_info.table_name)]='.'; table_lock_info.table_name[strlen(table_lock_info.table_name)]='.';
......
...@@ -79,7 +79,7 @@ int unique_intersect_write_to_ptrs(uchar* key, element_count count, Unique *uniq ...@@ -79,7 +79,7 @@ int unique_intersect_write_to_ptrs(uchar* key, element_count count, Unique *uniq
Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg, Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
uint size_arg, ulonglong max_in_memory_size_arg, uint size_arg, size_t max_in_memory_size_arg,
uint min_dupl_count_arg) uint min_dupl_count_arg)
:max_in_memory_size(max_in_memory_size_arg), :max_in_memory_size(max_in_memory_size_arg),
size(size_arg), size(size_arg),
...@@ -91,7 +91,7 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg, ...@@ -91,7 +91,7 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
if (min_dupl_count_arg) if (min_dupl_count_arg)
full_size+= sizeof(element_count); full_size+= sizeof(element_count);
with_counters= MY_TEST(min_dupl_count_arg); with_counters= MY_TEST(min_dupl_count_arg);
init_tree(&tree, (ulong) (max_in_memory_size / 16), 0, size, comp_func, init_tree(&tree, (max_in_memory_size / 16), 0, size, comp_func,
NULL, comp_func_fixed_arg, MYF(MY_THREAD_SPECIFIC)); NULL, comp_func_fixed_arg, MYF(MY_THREAD_SPECIFIC));
/* If the following fail's the next add will also fail */ /* If the following fail's the next add will also fail */
my_init_dynamic_array(&file_ptrs, sizeof(BUFFPEK), 16, 16, my_init_dynamic_array(&file_ptrs, sizeof(BUFFPEK), 16, 16,
...@@ -306,7 +306,7 @@ static double get_merge_many_buffs_cost(uint *buffer, ...@@ -306,7 +306,7 @@ static double get_merge_many_buffs_cost(uint *buffer,
*/ */
double Unique::get_use_cost(uint *buffer, size_t nkeys, uint key_size, double Unique::get_use_cost(uint *buffer, size_t nkeys, uint key_size,
ulonglong max_in_memory_size, size_t max_in_memory_size,
uint compare_factor, uint compare_factor,
bool intersect_fl, bool *in_memory) bool intersect_fl, bool *in_memory)
{ {
......
...@@ -30,7 +30,7 @@ class Unique :public Sql_alloc ...@@ -30,7 +30,7 @@ class Unique :public Sql_alloc
{ {
DYNAMIC_ARRAY file_ptrs; DYNAMIC_ARRAY file_ptrs;
ulong max_elements; ulong max_elements;
ulonglong max_in_memory_size; size_t max_in_memory_size;
IO_CACHE file; IO_CACHE file;
TREE tree; TREE tree;
ulong filtered_out_elems; ulong filtered_out_elems;
...@@ -46,7 +46,7 @@ class Unique :public Sql_alloc ...@@ -46,7 +46,7 @@ class Unique :public Sql_alloc
ulong elements; ulong elements;
SORT_INFO sort; SORT_INFO sort;
Unique(qsort_cmp2 comp_func, void *comp_func_fixed_arg, Unique(qsort_cmp2 comp_func, void *comp_func_fixed_arg,
uint size_arg, ulonglong max_in_memory_size_arg, uint size_arg, size_t max_in_memory_size_arg,
uint min_dupl_count_arg= 0); uint min_dupl_count_arg= 0);
~Unique(); ~Unique();
ulong elements_in_tree() { return tree.elements_in_tree; } ulong elements_in_tree() { return tree.elements_in_tree; }
...@@ -72,12 +72,12 @@ class Unique :public Sql_alloc ...@@ -72,12 +72,12 @@ class Unique :public Sql_alloc
} }
static double get_use_cost(uint *buffer, size_t nkeys, uint key_size, static double get_use_cost(uint *buffer, size_t nkeys, uint key_size,
ulonglong max_in_memory_size, uint compare_factor, size_t max_in_memory_size, uint compare_factor,
bool intersect_fl, bool *in_memory); bool intersect_fl, bool *in_memory);
inline static int get_cost_calc_buff_size(size_t nkeys, uint key_size, inline static int get_cost_calc_buff_size(size_t nkeys, uint key_size,
ulonglong max_in_memory_size) size_t max_in_memory_size)
{ {
register ulonglong max_elems_in_tree= register size_t max_elems_in_tree=
max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size); max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size);
return (int) (sizeof(uint)*(1 + nkeys/max_elems_in_tree)); return (int) (sizeof(uint)*(1 + nkeys/max_elems_in_tree));
} }
...@@ -86,7 +86,7 @@ class Unique :public Sql_alloc ...@@ -86,7 +86,7 @@ class Unique :public Sql_alloc
bool walk(TABLE *table, tree_walk_action action, void *walk_action_arg); bool walk(TABLE *table, tree_walk_action action, void *walk_action_arg);
uint get_size() const { return size; } uint get_size() const { return size; }
ulonglong get_max_in_memory_size() const { return max_in_memory_size; } size_t get_max_in_memory_size() const { return max_in_memory_size; }
friend int unique_write_to_file(uchar* key, element_count count, Unique *unique); friend int unique_write_to_file(uchar* key, element_count count, Unique *unique);
friend int unique_write_to_ptrs(uchar* key, element_count count, Unique *unique); friend int unique_write_to_ptrs(uchar* key, element_count count, Unique *unique);
......
...@@ -1116,7 +1116,7 @@ static int myisamchk(HA_CHECK *param, char * filename) ...@@ -1116,7 +1116,7 @@ static int myisamchk(HA_CHECK *param, char * filename)
{ {
if (param->testflag & (T_EXTEND | T_MEDIUM)) if (param->testflag & (T_EXTEND | T_MEDIUM))
(void) init_key_cache(dflt_key_cache,opt_key_cache_block_size, (void) init_key_cache(dflt_key_cache,opt_key_cache_block_size,
param->use_buffers, 0, 0, 0, 0); (size_t)param->use_buffers, 0, 0, 0, 0);
(void) init_io_cache(&param->read_cache,datafile, (void) init_io_cache(&param->read_cache,datafile,
(uint) param->read_buffer_length, (uint) param->read_buffer_length,
READ_CACHE, READ_CACHE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment