summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/field.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 1878797297f..a9aca5dc6e0 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -5954,7 +5954,7 @@ int Field_str::store(double nr)
if (exp >= (int) digits || exp < -4)
digits= max(0, (int) (max_length - 5 - (exp >= 100 || exp <= -100)));
- length= (uint) my_sprintf(buff, (buff, "%-.*g", digits, nr));
+ length= (uint) my_sprintf(buff, (buff, "%-.*g", min(digits, DBL_DIG ), nr));
#ifdef __WIN__
/*