Commit 66905f6d authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix several compile warnings on Windows

parent 7668a79a
...@@ -483,7 +483,18 @@ void my_write_core(int sig) ...@@ -483,7 +483,18 @@ void my_write_core(int sig)
#else /* __WIN__*/ #else /* __WIN__*/
#ifdef _MSC_VER
/* Silence warning in OS header dbghelp.h */
#pragma warning(push)
#pragma warning(disable : 4091)
#endif
#include <dbghelp.h> #include <dbghelp.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include <tlhelp32.h> #include <tlhelp32.h>
#include <my_sys.h> #include <my_sys.h>
#if _MSC_VER #if _MSC_VER
......
...@@ -2218,10 +2218,10 @@ bool Item_sum_bit::remove_as_window(ulonglong value) ...@@ -2218,10 +2218,10 @@ bool Item_sum_bit::remove_as_window(ulonglong value)
if (!bit_counters[i]) if (!bit_counters[i])
{ {
// Don't attempt to remove values that were never added. // Don't attempt to remove values that were never added.
DBUG_ASSERT((value & (1 << i)) == 0); DBUG_ASSERT((value & (1ULL << i)) == 0);
continue; continue;
} }
bit_counters[i]-= (value & (1 << i)) ? 1 : 0; bit_counters[i]-= (value & (1ULL << i)) ? 1 : 0;
} }
// Prevent overflow; // Prevent overflow;
...@@ -2235,7 +2235,7 @@ bool Item_sum_bit::add_as_window(ulonglong value) ...@@ -2235,7 +2235,7 @@ bool Item_sum_bit::add_as_window(ulonglong value)
DBUG_ASSERT(as_window_function); DBUG_ASSERT(as_window_function);
for (int i= 0; i < NUM_BIT_COUNTERS; i++) for (int i= 0; i < NUM_BIT_COUNTERS; i++)
{ {
bit_counters[i]+= (value & (1 << i)) ? 1 : 0; bit_counters[i]+= (value & (1ULL << i)) ? 1 : 0;
} }
// Prevent overflow; // Prevent overflow;
num_values_added = std::max(num_values_added, num_values_added + 1); num_values_added = std::max(num_values_added, num_values_added + 1);
...@@ -2306,7 +2306,7 @@ void Item_sum_and::set_bits_from_counters() ...@@ -2306,7 +2306,7 @@ void Item_sum_and::set_bits_from_counters()
{ {
// We've only added values of 1 for this bit. // We've only added values of 1 for this bit.
if (bit_counters[i] == num_values_added) if (bit_counters[i] == num_values_added)
value|= (1 << i); value|= (1ULL << i);
} }
bits= value & reset_bits; bits= value & reset_bits;
} }
...@@ -3490,9 +3490,9 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref) ...@@ -3490,9 +3490,9 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
result.set_charset(collation.collation); result.set_charset(collation.collation);
result_field= 0; result_field= 0;
null_value= 1; null_value= 1;
max_length= thd->variables.group_concat_max_len max_length= (uint32)(thd->variables.group_concat_max_len
/ collation.collation->mbminlen / collation.collation->mbminlen
* collation.collation->mbmaxlen; * collation.collation->mbmaxlen);
uint32 offset; uint32 offset;
if (separator->needs_conversion(separator->length(), separator->charset(), if (separator->needs_conversion(separator->length(), separator->charset(),
......
...@@ -3302,14 +3302,14 @@ uchar* sys_var_pluginvar::real_value_ptr(THD *thd, enum_var_type type) ...@@ -3302,14 +3302,14 @@ uchar* sys_var_pluginvar::real_value_ptr(THD *thd, enum_var_type type)
{ {
switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) { switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) {
case PLUGIN_VAR_BOOL: case PLUGIN_VAR_BOOL:
thd->sys_var_tmp.my_bool_value= option.def_value; thd->sys_var_tmp.my_bool_value= (my_bool)option.def_value;
return (uchar*) &thd->sys_var_tmp.my_bool_value; return (uchar*) &thd->sys_var_tmp.my_bool_value;
case PLUGIN_VAR_INT: case PLUGIN_VAR_INT:
thd->sys_var_tmp.int_value= option.def_value; thd->sys_var_tmp.int_value= (int)option.def_value;
return (uchar*) &thd->sys_var_tmp.int_value; return (uchar*) &thd->sys_var_tmp.int_value;
case PLUGIN_VAR_LONG: case PLUGIN_VAR_LONG:
case PLUGIN_VAR_ENUM: case PLUGIN_VAR_ENUM:
thd->sys_var_tmp.long_value= option.def_value; thd->sys_var_tmp.long_value= (long)option.def_value;
return (uchar*) &thd->sys_var_tmp.long_value; return (uchar*) &thd->sys_var_tmp.long_value;
case PLUGIN_VAR_LONGLONG: case PLUGIN_VAR_LONGLONG:
case PLUGIN_VAR_SET: case PLUGIN_VAR_SET:
......
...@@ -6017,7 +6017,7 @@ double matching_candidates_in_table(JOIN_TAB *s, bool with_found_constraint, ...@@ -6017,7 +6017,7 @@ double matching_candidates_in_table(JOIN_TAB *s, bool with_found_constraint,
{ {
TABLE *table= s->table; TABLE *table= s->table;
double sel= table->cond_selectivity; double sel= table->cond_selectivity;
double table_records= table->stat_records(); double table_records= (double)table->stat_records();
dbl_records= table_records * sel; dbl_records= table_records * sel;
return dbl_records; return dbl_records;
} }
...@@ -6043,7 +6043,7 @@ double matching_candidates_in_table(JOIN_TAB *s, bool with_found_constraint, ...@@ -6043,7 +6043,7 @@ double matching_candidates_in_table(JOIN_TAB *s, bool with_found_constraint,
if (s->table->quick_condition_rows != s->found_records) if (s->table->quick_condition_rows != s->found_records)
records= s->table->quick_condition_rows; records= s->table->quick_condition_rows;
dbl_records= records; dbl_records= (double)records;
return dbl_records; return dbl_records;
} }
......
...@@ -5206,7 +5206,7 @@ int default_regex_flags_pcre(const THD *thd) ...@@ -5206,7 +5206,7 @@ int default_regex_flags_pcre(const THD *thd)
int i, res; int i, res;
for (i= res= 0; default_regex_flags_to_pcre[i]; i++) for (i= res= 0; default_regex_flags_to_pcre[i]; i++)
{ {
if (src & (1 << i)) if (src & (1ULL << i))
res|= default_regex_flags_to_pcre[i]; res|= default_regex_flags_to_pcre[i];
} }
return res; return res;
......
...@@ -143,7 +143,7 @@ btr_scrub_lock_dict_func(ulint space, bool lock_to_close_table, ...@@ -143,7 +143,7 @@ btr_scrub_lock_dict_func(ulint space, bool lock_to_close_table,
"WARNING: %s:%u waited %lu seconds for" "WARNING: %s:%u waited %lu seconds for"
" dict_sys lock, space: %lu" " dict_sys lock, space: %lu"
" lock_to_close_table: %u\n", " lock_to_close_table: %u\n",
file, line, now - start, space, file, line, (unsigned long)(now - start), space,
lock_to_close_table); lock_to_close_table);
last = now; last = now;
......
...@@ -95,9 +95,9 @@ class ha_seq: public handler ...@@ -95,9 +95,9 @@ class ha_seq: public handler
ha_rows records_in_range(uint inx, key_range *min_key, ha_rows records_in_range(uint inx, key_range *min_key,
key_range *max_key); key_range *max_key);
double scan_time() { return nvalues(); } double scan_time() { return (double)nvalues(); }
double read_time(uint index, uint ranges, ha_rows rows) { return rows; } double read_time(uint index, uint ranges, ha_rows rows) { return (double)rows; }
double keyread_time(uint index, uint ranges, ha_rows rows) { return rows; } double keyread_time(uint index, uint ranges, ha_rows rows) { return (double)rows; }
private: private:
void set(uchar *buf); void set(uchar *buf);
......
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