aboutsummaryrefslogtreecommitdiff
path: root/mysql
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-06-30 11:57:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-06-30 11:57:53 +0200
commitec1213138d592489175f2246201c5e65c90af0a5 (patch)
treeeddde64172d02a5853cef6ae5c54f4cb1c16bc5f /mysql
parent06e43da76a6173a72b0450e2dadcfa73f6c04964 (diff)
Take into account precision in MySQL FLOAT type parsing
Diffstat (limited to 'mysql')
-rw-r--r--mysql/types/driver.cxx1
-rw-r--r--mysql/types/test.hxx4
2 files changed, 5 insertions, 0 deletions
diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx
index 8a51dea..31ccde1 100644
--- a/mysql/types/driver.cxx
+++ b/mysql/types/driver.cxx
@@ -43,6 +43,7 @@ main (int argc, char* argv[])
o.ulong_long_ = 123456;
o.float_ = 1.123F;
+ o.float8_ = 1.123;
o.double_ = 1.123;
o.decimal_ = "123.456";
diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx
index 3039a88..a4421b3 100644
--- a/mysql/types/test.hxx
+++ b/mysql/types/test.hxx
@@ -139,6 +139,9 @@ struct object
#pragma db type ("FLOAT NOT NULL")
float float_;
+ #pragma db type ("FLOAT(32) NOT NULL")
+ double float8_;
+
#pragma db type ("DOUBLE NOT NULL")
double double_;
@@ -237,6 +240,7 @@ struct object
long_long_ == y.long_long_ &&
ulong_long_ == y.ulong_long_ &&
float_ == y.float_ &&
+ float8_ == y.float8_ &&
double_ == y.double_ &&
decimal_ == y.decimal_ &&
date_ == y.date_ &&