summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/datadict.cc2
-rw-r--r--sql/item_func.h2
-rw-r--r--sql/item_strfunc.cc7
-rw-r--r--sql/item_sum.cc2
-rw-r--r--sql/rpl_mi.cc2
-rw-r--r--sql/rpl_rli.h2
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/slave.cc2
-rw-r--r--sql/spatial.cc2
-rw-r--r--sql/sql_acl.cc2
-rw-r--r--sql/sql_lex.cc2
-rw-r--r--sql/unireg.cc2
-rw-r--r--storage/myisam/sort.c4
-rw-r--r--storage/perfschema/pfs_autosize.cc6
-rw-r--r--strings/ctype-uca.c2
-rw-r--r--strings/ctype-utf8.c2
16 files changed, 21 insertions, 22 deletions
diff --git a/sql/datadict.cc b/sql/datadict.cc
index 287e8568d90..c1e1e85c377 100644
--- a/sql/datadict.cc
+++ b/sql/datadict.cc
@@ -94,7 +94,7 @@ frm_type_enum dd_frm_type(THD *thd, char *path, enum legacy_db_type *dbt)
if (mysql_file_seek(file, 0, SEEK_SET, MYF(MY_WME)))
goto err;
- if (read_string(file, &frm_image, state.st_size))
+ if (read_string(file, &frm_image, (size_t)state.st_size))
goto err;
if ((n_length= uint4korr(frm_image+55)))
diff --git a/sql/item_func.h b/sql/item_func.h
index 1f8d1ddb67e..133074122dd 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -643,7 +643,7 @@ public:
Reserve max_length to fit at least one character for one digit,
plus one character for the sign (if signed).
*/
- set_if_bigger(char_length, 1 + (unsigned_flag ? 0 : 1));
+ set_if_bigger(char_length, 1U + (unsigned_flag ? 0 : 1));
fix_char_length(char_length);
}
virtual void print(String *str, enum_query_type query_type);
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 9740dc9dae1..21f8ccb4348 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -5091,9 +5091,10 @@ bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
case DYN_COL_UINT:
if (signed_value || val.x.ulong_value <= LONGLONG_MAX)
{
- bool neg= val.x.ulong_value > LONGLONG_MAX;
- if (int_to_datetime_with_warn(neg, neg ? -val.x.ulong_value :
- val.x.ulong_value,
+ longlong llval = (longlong)val.x.ulong_value;
+ bool neg = llval < 0;
+ if (int_to_datetime_with_warn(neg, (ulonglong)(neg ? -llval :
+ llval),
ltime, fuzzy_date, 0 /* TODO */))
goto null;
return 0;
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index d0ffa42ae33..3ac861d61ff 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -3119,7 +3119,7 @@ int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)),
{
Item_func_group_concat *item= (Item_func_group_concat *) item_arg;
TABLE *table= item->table;
- uint max_length= table->in_use->variables.group_concat_max_len;
+ uint max_length= (uint)table->in_use->variables.group_concat_max_len;
String tmp((char *)table->record[1], table->s->reclength,
default_charset_info);
String tmp2;
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index fd04e233d35..a141d238f78 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -1172,7 +1172,7 @@ bool Master_info_index::init_all_master_info()
else if (succ_num) // Have some Error and some Success
{
sql_print_warning("Reading of some Master_info entries failed");
- DBUG_RETURN(2);
+ DBUG_RETURN(1);
}
else // All failed
{
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h
index 5c637702d04..60a75859050 100644
--- a/sql/rpl_rli.h
+++ b/sql/rpl_rli.h
@@ -522,7 +522,7 @@ public:
}
int32 get_sql_delay() { return sql_delay; }
- void set_sql_delay(time_t _sql_delay) { sql_delay= _sql_delay; }
+ void set_sql_delay(int32 _sql_delay) { sql_delay= _sql_delay; }
time_t get_sql_delay_end() { return sql_delay_end; }
private:
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 004af2a5690..07395e3e708 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -401,7 +401,7 @@ double sys_var::val_real(bool *is_null,
switch (show_type())
{
case_get_string_as_lex_string;
- case_for_integers(return val);
+ case_for_integers(return (double)val);
case_for_double(return val);
case SHOW_MY_BOOL: return *(my_bool*)value;
default:
diff --git a/sql/slave.cc b/sql/slave.cc
index 05e967c4edb..e031a424ea6 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3445,7 +3445,7 @@ sql_delay_event(Log_event *ev, THD *thd, rpl_group_info *rgi)
// The time we will have to sleep before executing the event.
unsigned long nap_time= 0;
if (sql_delay_end > now)
- nap_time= sql_delay_end - now;
+ nap_time= (ulong)(sql_delay_end - now);
DBUG_PRINT("info", ("sql_delay= %lu "
"ev->when= %lu "
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 0e3976ba573..7c9d8bb771e 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -372,7 +372,7 @@ Geometry *Geometry::create_from_json(Geometry_buffer *buffer,
key_len=0;
break;
}
- key_buf[key_len++]= je->s.c_next | 0x20; /* make it lowercase. */
+ key_buf[key_len++]= (uchar)je->s.c_next | 0x20; /* make it lowercase. */
}
if (je->s.error)
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index ab0ed527bc3..d18a5b4d503 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -12462,7 +12462,7 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length)
{
my_message(ER_UNKNOWN_COM_ERROR, ER_THD(thd, ER_UNKNOWN_COM_ERROR),
MYF(0));
- DBUG_RETURN(packet_error);
+ DBUG_RETURN(1);
}
DBUG_PRINT("info", ("client_plugin=%s, restart", client_plugin));
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 4c53ba5b93d..c59edfd8751 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -466,7 +466,7 @@ int my_wc_mb_utf8_with_escape(CHARSET_INFO *cs, my_wc_t escape, my_wc_t wc,
DBUG_ASSERT(escape > 0);
if (str + 1 >= end)
return MY_CS_TOOSMALL2; // Not enough space, need at least two bytes.
- *str= escape;
+ *str= (uchar)escape;
int cnvres= my_charset_utf8_handler.wc_mb(cs, wc, str + 1, end);
if (cnvres > 0)
return cnvres + 1; // The character was normally put
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 959f8341a90..0bb8a4e77c6 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -58,7 +58,7 @@ static bool make_empty_rec(THD *, uchar *, uint, List<Create_field> &, uint,
static uchar *extra2_write_len(uchar *pos, size_t len)
{
if (len <= 255)
- *pos++= len;
+ *pos++= (uchar)len;
else
{
/*
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index d411272c273..0d177072ec7 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -869,13 +869,13 @@ static my_off_t read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
uint sort_length)
{
register ha_keys count;
- my_off_t length;
+ size_t length;
if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys,
(ha_rows) buffpek->count)))
{
if (my_b_pread(fromfile, (uchar*) buffpek->base,
- (length= (my_off_t) (sort_length * count)),
+ (length= (size_t) (sort_length * count)),
buffpek->file_pos))
return(HA_OFFSET_ERROR);
buffpek->key=buffpek->base;
diff --git a/storage/perfschema/pfs_autosize.cc b/storage/perfschema/pfs_autosize.cc
index 9bf70ceb216..6f267cb4599 100644
--- a/storage/perfschema/pfs_autosize.cc
+++ b/storage/perfschema/pfs_autosize.cc
@@ -132,7 +132,7 @@ PFS_sizing_data small_data=
/* Min tables */
200,
/* Load factors */
- 0.90, 0.90, 0.90
+ 0.90f, 0.90f, 0.90f
};
PFS_sizing_data medium_data=
@@ -148,7 +148,7 @@ PFS_sizing_data medium_data=
/* Min tables */
500,
/* Load factors */
- 0.70, 0.80, 0.90
+ 0.70f, 0.80f, 0.90f
};
PFS_sizing_data large_data=
@@ -164,7 +164,7 @@ PFS_sizing_data large_data=
/* Min tables */
10000,
/* Load factors */
- 0.50, 0.65, 0.80
+ 0.50f, 0.65f, 0.80f
};
static inline ulong apply_load_factor(ulong raw_value, float factor)
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 79ad8ca7302..e3ed531df93 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -31610,7 +31610,7 @@ my_uca_implicit_weight_put(uint16 *to, my_wc_t code, uint level)
break;
}
/* Primary level */
- to[0]= (code >> 15) + my_uca_implicit_weight_base(code);
+ to[0]= (uint16)(code >> 15) + my_uca_implicit_weight_base(code);
to[1]= (code & 0x7FFF) | 0x8000;
to[2]= 0;
}
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 6ab07d99e23..683c80f643d 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -4831,7 +4831,6 @@ my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags)
{
- my_wc_t UNINIT_VAR(wc);
uchar *dst0= dst;
uchar *de= dst + dstlen;
@@ -4877,7 +4876,6 @@ my_strnxfrm_unicode_full_nopad_bin(CHARSET_INFO *cs,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags)
{
- my_wc_t UNINIT_VAR(wc);
uchar *dst0= dst;
uchar *de= dst + dstlen;