mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
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.
This commit is contained in:
parent
2f78abd21b
commit
c74609b126
1 changed files with 3 additions and 3 deletions
|
@ -386,7 +386,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;
|
||||
|
@ -876,9 +876,9 @@ 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);
|
||||
int msec_length= 6 - (int)(str - start);
|
||||
if (msec_length > 0)
|
||||
value*= (long) log_10_int[msec_length];
|
||||
value*= (long)log_10_int[msec_length];
|
||||
}
|
||||
values[i]= value;
|
||||
while (str != end && !my_isdigit(cs,*str))
|
||||
|
|
Loading…
Reference in a new issue