qt5base-lts/tests/auto
Julien Blanc 190f64aab3 Added timezone support for datetime fields in PSQL
This patch adds correct timezone support in PSQL plugin. Prior to this
patch, no timezone support was provided, so only the following case
worked :
 * using local time in both client application and postgresql server
 * datetime were using second precision

This patch tries to take care that postgresql has two different
datatypes for date time, respectively :
 * timestamp with time zone
 * timestamp without time zone

Both are internally stored as UTC values, but are not parsed the same.
 * timestamp with time zone assumes that there is a time zone
   information and will parse date time accordingly, and then, convert
   into UTC before storing them
 * timestamp without time zone assumes that there is no time zone
   information and will silently ignore any, unless the datetime is
   explicitly specified as having a time zone, in case it will convert
   it into UTC before storing it

Both are retrieved as local time values, with the following difference
 * timestamp with time zone includes the timezone information
   (2014-02-12 10:20:12+0100 for example)
 * timestamp without time zone does not include it

The patch does the following :
 * parse the date retrieved by postgresql server using QDateTime
   functions, which work correctly
 * always convert the date to UTC before giving it to postgresql
 * force time zone so that timezone information is taken into account
   by postgresql
 * also adds the milliseconds when storing QDateTime values

The following configurations are tested to work :
 * client and server using same timezone, timestamp with or without tz
 * client and server using different timezone, timestamp with tz

The following configuration will *not* work :
 * client and server using different timezones, timestamp without tz

Because data will be converted to local time by the postgresql server,
so when returned it will be different from what had been serialized.
Prior to this patch, it gave the illusion to work because since TZ
information was lost, time was stored as local time from postgresql.
Lots of inconsistencies occurred, though, in case client tz changes...

I don't expect this to be an issue since having different TZ in server
and client and *not* handling this is a broken setup anyway.

Almost based on changes proposed by julien.blanc@nmc-company.fr

[ChangeLog][QtSql] Added timezone support for datetime fields in PSQL

Task-number: QTBUG-36211
Change-Id: I5650a5ef60cb3f14f0ab619825612831c7e90c12
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-12-30 23:49:14 +01:00
..
android Remove old test script & project. 2014-12-20 07:42:09 +01:00
bic/data test: Add 5.1.0 bic data for linux-gcc-ia32 2013-07-08 21:47:36 +02:00
cmake Update license headers and add new license files 2014-09-24 12:26:19 +02:00
compilerwarnings/data Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
concurrent Update license headers and add new license files 2014-09-24 12:26:19 +02:00
corelib Android: Fix QTemporaryDir/File::nonWritableCurrentDir() tests 2014-12-22 09:28:05 +01:00
dbus Autotest: Fix a race condition in launching the QtDBus sub-processes 2014-12-20 07:37:17 +01:00
gui Android: Fix qicoimageformat test. 2014-12-22 08:34:05 +01:00
guiapplauncher Update the documentation after moving examples. 2011-07-05 21:19:08 +02:00
installed_cmake Add a unit test for testing Qt in its install location. 2013-07-02 23:08:54 +02:00
network tst_QUdpSocket: Fix inverted logic in getting a non-"any" address 2014-12-28 15:58:54 +01:00
opengl Change bugreports.qt-project.org -> bugreports.qt.io 2014-12-18 09:46:09 +01:00
other Ensure that GL::updateBrushTexture() activates and binds properly 2014-12-13 01:49:24 +01:00
printsupport Change bugreports.qt-project.org -> bugreports.qt.io 2014-12-18 09:46:09 +01:00
shared Android: Keyboard doesn't hide from done button 2014-10-25 07:19:35 +02:00
sql Added timezone support for datetime fields in PSQL 2014-12-30 23:49:14 +01:00
testlib Update license headers and add new license files 2014-09-24 12:26:19 +02:00
tools Define Q_CC_CLANG to be the version of upstream Clang that's in use 2014-11-05 07:30:32 +01:00
widgets QScrollBar: emit valueChanged once even if a slot takes too much time 2014-12-19 17:15:07 +01:00
xml Update license headers and add new license files 2014-09-24 12:26:19 +02:00
auto.pro Temporarily disable the QtDBus tests if the session bus isn't available 2014-12-23 12:22:56 +01:00
network-settings.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qtest-config.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
test.pl Update license headers and add new license files 2014-09-24 12:26:19 +02:00