summaryrefslogtreecommitdiff
path: root/sql/item_sum.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r--sql/item_sum.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h
index b5516792676..46e5ae76ab1 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -1274,8 +1274,13 @@ public:
void make_unique();
double val_real()
{
- String *res; res=val_str(&str_value);
- return res ? my_atof(res->c_ptr()) : 0.0;
+ int error;
+ const char *end;
+ String *res;
+ if (!(res= val_str(&str_value)))
+ return 0.0;
+ end= res->ptr() + res->length();
+ return (my_strtod(res->ptr(), (char**) &end, &error));
}
longlong val_int()
{