summaryrefslogtreecommitdiff
path: root/sql/sql_analyse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_analyse.cc')
-rw-r--r--sql/sql_analyse.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index 3c9563165fe..68f7d45e81c 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -187,7 +187,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
}
if (str == end && info->integers)
{
- info->ullval = (ulonglong) strtoull(begin ,NULL, 10);
+ char *endpos= (char*) end;
+ int error;
+ info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
if (info->integers == 1)
return 0; // a single number can't be zerofill
info->maybe_zerofill = 1;
@@ -199,7 +201,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
return 0;
if ((str + 1) == end) // number was something like '123[.eE]'
{
- info->ullval = (ulonglong) strtoull(begin, NULL, 10);
+ char *endpos= (char*) str;
+ int error;
+ info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
return 1;
}
if (*str == 'e' || *str == 'E') // number may be something like '1e+50'
@@ -218,7 +222,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
for (str++; *(end - 1) == '0'; end--); // jump over zeros at the end
if (str == end) // number was something like '123.000'
{
- info->ullval = (ulonglong) strtoull(begin, NULL, 10);
+ char *endpos= (char*) str;
+ int error;
+ info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
return 1;
}
for (; str != end && my_isdigit(system_charset_info,*str); str++)