summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <kaa@polly.(none)>2007-12-01 15:25:24 +0300
committerunknown <kaa@polly.(none)>2007-12-01 15:25:24 +0300
commit1f22720c3f6bf28a44ee0e3a9a9abd52e9debe64 (patch)
treeef0425d76948e8696f54c69d42e7d37d7a11c274 /sql
parentd8d07eff702b303b9458ac5622bdc42e5a0c1f93 (diff)
downloadmariadb-git-1f22720c3f6bf28a44ee0e3a9a9abd52e9debe64.tar.gz
Fixed the floating point number tests on Windows.
mysql-test/r/insert.result: Fixed the test cases. mysql-test/t/cast.test: We need to do replace_result because warnings are printed by another procedure. mysql-test/t/insert.test: Windows implements a different rounding rules in printf("%g"), thus we still need to do replace_result. sql/field.cc: Limit the precision to avoid garbage past the significant digits.
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__
/*