summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorChristopher Powers <christopher.powers@sun.com>2009-11-19 16:49:13 -0600
committerChristopher Powers <christopher.powers@sun.com>2009-11-19 16:49:13 -0600
commitc74609b12627b7405a21c22f166702da6cc93120 (patch)
tree25ae78716004919af9fe8899baf05950aa3aea95 /sql/item_timefunc.cc
parent2f78abd21b11aa53fc8426c018b78621f77157f7 (diff)
downloadmariadb-git-c74609b12627b7405a21c22f166702da6cc93120.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.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index b5037c08b3c..b293145cc27 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -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))