From ec1213138d592489175f2246201c5e65c90af0a5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 30 Jun 2011 11:57:53 +0200 Subject: Take into account precision in MySQL FLOAT type parsing --- mysql/types/driver.cxx | 1 + mysql/types/test.hxx | 4 ++++ 2 files changed, 5 insertions(+) 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_ && -- cgit v1.1