diff options
author | Christopher Powers <christopher.powers@sun.com> | 2010-02-25 09:49:09 -0600 |
---|---|---|
committer | Christopher Powers <christopher.powers@sun.com> | 2010-02-25 09:49:09 -0600 |
commit | 53e8dc26ef90f4170d5fd8b6c2ec30022d1b7c1a (patch) | |
tree | 752d259fac4c8cfbed714536f294a4b779c3fc8f /sql/item_timefunc.cc | |
parent | e3d0b6d7929ce7080958086c6f4fca61dd13de2e (diff) | |
download | mariadb-git-53e8dc26ef90f4170d5fd8b6c2ec30022d1b7c1a.tar.gz |
Bug #48739 MySQL crashes on specific INTERVAL in select query
Fixed crash caused by x64 int/long incompatibility introduced
in Bug #29125.
sql/item_timefunc.cc:
Fixed crash caused by int/long incompatibility on x64 systems.
Changed two "uint" casts and a "long" declartion to "int" in order to
ensure that the integer sign is preserved.
See Bug #48739 for details.
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index de76f821795..d582f26d46c 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -379,7 +379,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, if (tmp - val > 6) tmp= (char*) val + 6; l_time->second_part= (int) my_strtoll10(val, &tmp, &error); - frac_part= 6 - (uint) (tmp - val); + frac_part= 6 - (int) (tmp - val); if (frac_part > 0) l_time->second_part*= (ulong) log_10_int[frac_part]; val= tmp; @@ -870,7 +870,7 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs, value= value*LL(10) + (longlong) (*str - '0'); if (transform_msec && i == count - 1) // microseconds always last { - long msec_length= 6 - (uint) (str - start); + long msec_length= 6 - (int) (str - start); if (msec_length > 0) value*= (long) log_10_int[msec_length]; } |