[odb-users] Problem with QDate and Sqlite when it's mapped with TEXT type

Boris Kolpackov boris at codesynthesis.com
Mon Sep 7 12:33:44 EDT 2015


Hi Ali,

> I have a problem with QDate and sqlite database when QDate is mapped
> with TEXT type (default behavior). When it is mapped with INTEGER
> there is no problem, but when it is mapped with TEXT, it is persisted
> correctly, but retrieved incorrectly (it looks like an uninitialized
> variable!)

We have the TEXT mapping exercised in the ODB test suite and everything
works correctly, including on Windows. So we will have to do a little
debugging to figure out what's going on. Specifically, can you set the
breakpoint in file:

libodb-qt/odb/qt/date-time/sqlite/qdate-traits.hxx

Line 37 (the 'if (is_null)' statement in set_value()). Then run
your test and see what happens there. Specifically, you want to
look at i.data() and 'n' and verify that they describe the correct
string representation of the date.

Boris



More information about the odb-users mailing list