From d59ac6134105611fb8d0d2349f0acf720c88e7d6 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 15 Nov 2011 11:44:16 +0200 Subject: Correct second precision handling --- odb/qt/date-time/oracle/default-mapping.hxx | 4 ++-- odb/qt/date-time/oracle/qdate-time-traits.hxx | 4 ++-- odb/qt/date-time/oracle/qtime-traits.hxx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/odb/qt/date-time/oracle/default-mapping.hxx b/odb/qt/date-time/oracle/default-mapping.hxx index 4411934..7ec927d 100644 --- a/odb/qt/date-time/oracle/default-mapping.hxx +++ b/odb/qt/date-time/oracle/default-mapping.hxx @@ -19,11 +19,11 @@ // represent clock times with a maximum precision of milliseconds. QTime // provides a null representation so allow NULL values by default. // -#pragma db value(QTime) type("INTERVAL DAY(0) TO SECOND") null +#pragma db value(QTime) type("INTERVAL DAY(0) TO SECOND(3)") null // Map QDateTime to ORACLE TIMESTAMP by default. QDateTime provides a null // representation so allow NULL values by default. // -#pragma db value(QDateTime) type("TIMESTAMP(6)") null +#pragma db value(QDateTime) type("TIMESTAMP(3)") null #endif // ODB_QT_DATE_TIME_ORACLE_DEFAULT_MAPPING_HXX diff --git a/odb/qt/date-time/oracle/qdate-time-traits.hxx b/odb/qt/date-time/oracle/qdate-time-traits.hxx index 3ecb268..6c45d5e 100644 --- a/odb/qt/date-time/oracle/qdate-time-traits.hxx +++ b/odb/qt/date-time/oracle/qdate-time-traits.hxx @@ -43,7 +43,7 @@ namespace odb QTime (static_cast (h), static_cast (min), static_cast (s), - static_cast (ns / 1000))); + static_cast (ns / 1000000))); } } @@ -65,7 +65,7 @@ namespace odb static_cast (t.hour ()), static_cast (t.minute ()), static_cast (t.second ()), - static_cast (t.msec () * 1000)); + static_cast (t.msec () * 1000000)); } } }; diff --git a/odb/qt/date-time/oracle/qtime-traits.hxx b/odb/qt/date-time/oracle/qtime-traits.hxx index b56bad5..7692779 100644 --- a/odb/qt/date-time/oracle/qtime-traits.hxx +++ b/odb/qt/date-time/oracle/qtime-traits.hxx @@ -37,7 +37,7 @@ namespace odb sb4 d (0), h (0), m (0), s (0), ns (0); i.get (d, h, m, s, ns); - v.setHMS (h, m, s, ns / 1000); + v.setHMS (h, m, s, ns / 1000000); } } @@ -50,7 +50,7 @@ namespace odb { is_null = false; - i.set (0, v.hour (), v.minute (), v.second (), v.msec () * 1000); + i.set (0, v.hour (), v.minute (), v.second (), v.msec () * 1000000); } } }; -- cgit v1.1