Commit 7de4cf02 authored by Christopher Powers's avatar Christopher Powers

Bug #48739 MySQL crashes on specific INTERVAL in select query

Fixed crash caused by x64 int/long incompatibility introduced
in Bug #29125.
parent 349f48e1
...@@ -386,7 +386,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, ...@@ -386,7 +386,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
if (tmp - val > 6) if (tmp - val > 6)
tmp= (char*) val + 6; tmp= (char*) val + 6;
l_time->second_part= (int) my_strtoll10(val, &tmp, &error); 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) if (frac_part > 0)
l_time->second_part*= (ulong) log_10_int[frac_part]; l_time->second_part*= (ulong) log_10_int[frac_part];
val= tmp; val= tmp;
...@@ -876,9 +876,9 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs, ...@@ -876,9 +876,9 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
value= value*LL(10) + (longlong) (*str - '0'); value= value*LL(10) + (longlong) (*str - '0');
if (transform_msec && i == count - 1) // microseconds always last if (transform_msec && i == count - 1) // microseconds always last
{ {
long msec_length= 6 - (uint) (str - start); int msec_length= 6 - (int)(str - start);
if (msec_length > 0) if (msec_length > 0)
value*= (long) log_10_int[msec_length]; value*= (long)log_10_int[msec_length];
} }
values[i]= value; values[i]= value;
while (str != end && !my_isdigit(cs,*str)) while (str != end && !my_isdigit(cs,*str))
......
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