aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-11-15 11:44:16 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-11-15 11:44:16 +0200
commitd59ac6134105611fb8d0d2349f0acf720c88e7d6 (patch)
treef51764f42cc98ce59cecc1e4be81ac2537258cad
parenta926388f73aed90d1aa9743d32ed4c049af6bf84 (diff)
Correct second precision handling
-rw-r--r--odb/qt/date-time/oracle/default-mapping.hxx4
-rw-r--r--odb/qt/date-time/oracle/qdate-time-traits.hxx4
-rw-r--r--odb/qt/date-time/oracle/qtime-traits.hxx4
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<int> (h),
static_cast<int> (min),
static_cast<int> (s),
- static_cast<int> (ns / 1000)));
+ static_cast<int> (ns / 1000000)));
}
}
@@ -65,7 +65,7 @@ namespace odb
static_cast<ub1> (t.hour ()),
static_cast<ub1> (t.minute ()),
static_cast<ub1> (t.second ()),
- static_cast<ub4> (t.msec () * 1000));
+ static_cast<ub4> (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);
}
}
};