summaryrefslogtreecommitdiffstats
path: root/src/sql
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Change instances of '(Mac) OS X' to 'macOS'Topi Reinio2016-08-121-8/+8
| | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change the occurrences where the Mac platform is discussed to use a macro \macos, which expands to 'macOS'. This helps with adapting to future renaming. Update the instructions on mac-specific Q_OS_* macro usage. Add a \target for the old 'Qt for OS X' topic to keep links working for other documentation modules that try to link with the old name. Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Fix UNSIGNED values in QMYSQLJesus Fernandez2016-06-141-0/+1
| | | | | | | | | | | | | | The unsigned flag in columns was ignored when creating the list of bound values in a mysql table. So the result iteration with QSqlQuery::next stops after the first wrong truncated value. [ChangeLog][QtSql] Fixed QSqlQuery::prepare value truncation error when using UNSIGNED values in a MySQL database. Task-number: QTBUG-53969 Task-number: QTBUG-53237 Change-Id: I10d977993445f2794f1dd8c88b2e83517ef524f3 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Doc: Remove repository name from examplesinstallpathTopi Reinio2016-05-121-1/+1
| | | | | | | | Examples in binary packages now directly match the install path. Change-Id: Ic1487bc766cfd3b0a0a340cc4ae4ba49d953eaa6 Task-number: QTBUG-52953 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Fix typo in QSqlTableModel documentationVladislav Tronko2016-05-061-1/+1
| | | | | Change-Id: I4e9ab7469b028464186d3067759a2cf6fb187b07 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* tst_QSqlQuery: fix UBs (invalid downcasts, member calls)Marc Mutz2016-03-151-0/+5
| | | | | | | | | | | | | | | | The existing code derived a helper class from QSqlResult and overloaded two protected functions as public ones so the test could call them after casting QSqlResults to that helper class. Both the cast (which is a C-style cast, but with combined static_cast and const_cast semanics) and the following member function call are undefined behavior. Fix by making the test class a friend of QSqlResult, and dropping the casts. Change-Id: I09de2e2b46976d01cfce25892aec6ad36881d3eb Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* consistently put {qt,qml}_{module,plugin} at the end of project filesOswald Buddenhagen2016-03-071-5/+4
| | | | | | | | this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: Icbce502dcbcb4d4b4d922c42679f44e2cc930bf3 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* ODBC: Fix a memory leak when open() fails.HyungDon Lee2016-03-051-1/+6
| | | | | | | | | When connection or login fails, the ODBC SQL driver was leaking memory. This bug has been present since Qt 4.8 and up. Task-number: QTBUG-51334 Change-Id: Ie17f3d575a08d47e047a65d1b30af9ce0789b2d0 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Fix compile with clang and -Werror.Milian Wolff2016-03-031-2/+0
| | | | | | | | | | | | | | Fixes the following warning/error: src/sql/drivers/sqlite2/qsql_sqlite2.cpp:142:19: error: unused variable 'initial_cache_size' [-Werror,-Wunused-const-variable] static const uint initial_cache_size = 128; ^ 1 error generated. Change-Id: I4ed7f789561dd9b68dd374c122f4db3813e63e05 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* PostgreSQL: Fix memory leak in subscribeToNotification() and ↵Vincas Dargis2016-03-011-0/+4
| | | | | | | | | | | unsubscribeFromNotification() Both subscribeToNotification() and unsubscribeFromNotification() are missing PQclear calls to free PGresult. Task-number: QTBUG-51412 Change-Id: I72ec3438b22bc99205c984b67b922766bcdbed08 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlDriver::sqlStatement: documentation fixMark Brand2016-02-241-0/+11
| | | | | | Change-Id: I12bd612c48020594b5377b04aeccc51f7c4be53d Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: Vyacheslav Grigoryev <armagvvg@gmail.com>
* QSqlDriver: use table prefix in WHERE clausesVyacheslav Grigoryev2016-02-171-23/+15
| | | | | | | | | | | If the WHERE clause is used in a query involving multiple tables, such as generated by QSqlRelationalTableModel, the table prefix may be necessary to disambiguate column references. It is harmless if not needed. Task-number: QTBUG-43320 Change-Id: I39e1ab7359bf748afa8bcd8578220e3abb3ee24a Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-191-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/common/atomic64/atomic64.cpp configure src/3rdparty/forkfd/forkfd.c src/corelib/io/forkfd_qt.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tools/configure/configureapp.cpp Change-Id: Ic6168d82e51a0ef1862c3a63bee6722e8f138414
| * PostgreSQL: Fix memory leak in QPSQLDriverPrivate::getPSQLVersion()Vincas Dargis2015-12-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | Memory leak occurs when 'release' pointer variable is overwritten for second use without releasing resources it is currently pointing to. Leak occurs only in specific edge case depending on client/server versions. Task-number: QTBUG-49789 Change-Id: Ie5be8996ed158309f20dbb3574f956d2eb137460 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | QSqlQueryModel::clear(): Call begin/endResetModel().Friedemann Kleint2015-11-193-0/+6
| | | | | | | | | | | | | | | | | | Call begin/endResetModel() in QSqlQueryModel and all derived classes. Task-number: QTBUG-49404 Change-Id: I11492d6386efb4c945c246a6379aaa6ca4502a25 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | Doc: corrected snippet QSqlTableModelNico Vertriest2015-11-161-2/+3
| | | | | | | | | | | | | | | | Wrongly used QSQLQueryModel previously Task-number: QTBUG-35860 Change-Id: I059ba45e54ac67b75b68eb0b804f66642b87a29f Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Fix build of PostgreSQL plugin with -Werror on Windows/64bit.Friedemann Kleint2015-11-061-1/+1
| | | | | | | | | | | | | | | | Fix MSVC warning: sql\drivers\psql\qsql_psql.cpp(452): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data Change-Id: I44a902a9169efa568dcd82bdc08c5b97e661d65a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Doc: Update examplesinstallpath to include the repository nameTopi Reinio2015-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The examplesinstallpath variable in .qdocconf files defines the path under QT_INSTALL_EXAMPLES where examples are found. To match the way examples are packaged in Qt 5.6, prefix each install path with the repository name. Task-number: QTBUG-48736 Change-Id: I6a35c94fdacaad21cd044411aba02027b9019300 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-131-14/+15
|\| | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qabstractsocket.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp src/sql/drivers/mysql/qsql_mysql.cpp Change-Id: Ifb73623d09f53340ee5e10283f1f86b580998902
| * Fix QMYSQL plugin database connection setup checkSamuel Gaist2015-09-151-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opening a connection to an e.g. inactive server will return true regardless of the server accessibility. This patch aims to fix the current checks done. The first one is an allocation check which should only fail if there's not enough memory but is currently wrote as if the connection failed there. The second check that is "failing" is the connection setup. The return value should either be NULL or the same value provided as first parameter. That is now verified. [ChangeLog][QtSql][QSqlDatabase] Fixed a bug where opening a connection to a MySQL database using the QMYSQL plugin would always return true even if the server was unreachable. This bug could also lead to crashes depending on the platform used. Task-number: QTBUG-47784 Task-number: QTBUG-47452 Change-Id: I91651684b5a342eaa7305473e26d8371b35396c4 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| * Doc: Corrected link issues in qtbaseNico Vertriest2015-09-041-1/+1
| | | | | | | | | | | | Task-number: QTBUG-43810 Change-Id: I0a019becc53b222cb6a7df1fafdccd57aca5b598 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Libraries: Fix single-character string literals.Friedemann Kleint2015-10-132-2/+2
| | | | | | | | | | | | | | Use character literals where applicable. Change-Id: I8e198774c2247c1cc1d852a41b59b301199b7878 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Doc: fixed links to qmake documentationNico Vertriest2015-09-251-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-43810 Change-Id: I56676d6f6f95ed79bd1719404b4e48c26490eea6 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-08-261-0/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/snippets/code/doc_src_qmake-manual.pro qmake/doc/src/qmake-manual.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qbytearray.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp tests/auto/network/access/qnetworkreply/BLACKLIST Change-Id: I9efcd7e1cce1c394eed425c43aa6fce7d2edf31c
| * Merge remote-tracking branch 'origin/5.4' into 5.5Oswald Buddenhagen2015-07-171-0/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/manifest-meta.qdocconf src/corelib/global/qnamespace.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qtools_p.h src/sql/drivers/psql/qsql_psql.cpp Change-Id: I23a15ac84e03ad61d865e3df872b013eb0752949
| | * quote QUuid valuesEvgeniy Fominov2015-06-071-0/+3
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-44480 Change-Id: I125ab913c867758d958a2774ad125533d6a07a83 Reviewed-by: Evgeniy Fominov <fm@stilsoft.ru> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | Remove temporary string allocations when reading prepared statement.Milian Wolff2015-08-131-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead, we use the binary MySQL encoding and copy the data directly into the QVariant of the desired type. This gets rid of the temporary string allocations and greatly improves the performance of the added benchmark. On my machine, the results are: Before: 0.562 msecs per iteration (total: 563, iterations: 1000) 1,922,479.330 instructions per iteration (total: 1,922,479,330, iterations: 1000) After: 0.381 msecs per iteration (total: 381, iterations: 1000) 774,132.957 instructions per iteration (total: 774,132,958, iterations: 1000) Note that the same could be applied to floating point data types in the future. Additionally, special support for MYSQL_TIME structure coult be added to get rid of the string conversions there. To ensure everything keeps working, a new auto test is added as well that verifies the select statements and insertions of integral data into a MySql table works as intended. [ChangeLog][QtSql] Improve performance when reading integer values from MySQL databases via prepared statements. Change-Id: I21dd9277661971ded934546f09535014b63f8eb8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QtSql: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-085-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: Ie14e5280c430b6a254f8f686534450c1e5995374 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-012-9/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * | Replace MAC OS X with OS XNico Vertriest2015-06-301-8/+8
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * | Fixing error with reading Time fields by qibase sql driver.Roman Bogolyubov2015-06-081-1/+1
| | | | | | | | | | | | | | | Change-Id: I8b874d2fbf54d0a2dcd6eea13f5b6d7405f6e663 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | QSqlIndex: replace QList<bool> with QVector<bool>Marc Mutz2015-06-282-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QList<bool> uses from 400% (32-bit platforms) to 800% (64-bit) more per-element memory than QVector<bool>. This change is binary compatible, since QList and QVector have the same size, and the QList field was not referenced from inline functions. This includes all relevant special member functions, since they are all out-of-line (and move assignment and move constructor are disabled by used-defined copy assignment and copy constructors, resp.). The header is unchanged from Qt 5.0, so there were also no past inline users of the member. Change-Id: I3a94ddc73a4f388031dfd4fce3fedccc507a39c7 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | Added SSL support for MySQL database connectionsOlivier Delbeke2015-06-143-32/+73
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Addition of new options SSL_KEY, SSL_CERT, SSL_CA, SSL_CAPATH and SSL_CIPHER to allow SSL-encrypted connections to MySQL databases. When needed, these options must be specified in the function call QSqlDatabase::setConnectOptions() before the call to QSqlDatabase::open(). SSL_KEY = the path name to the key file SSL_CERT = the path name to the certificate file SSL_CA = the path name to the certificate authority file SSL_CAPATH = the path name to a directory that contains trusted SSL CA certificates in PEM format. SSL_CIPHER = a list of permissible ciphers to use for SSL encryption. These options replace CLIENT_SSL (which should not be used any more). Example: db.setConnectOptions("SSL_KEY=client-key.pem;" \ "SSL_CERT=client-cert.pem;" \ "SSL_CA=server-ca.pem"); [ChangeLog][QtSql] SSL support for MySQL database connections has been added. Option CLIENT_SSL replaced by SSL_KEY, SSL_CERT, SSL_CA, SSL_CAPATH and SSL_CIPHER, so that the keys, certificates and cipher can be specified. Task-number: QtBUG-3500 Change-Id: I8197234b169a818658678d6fcc953c90e83db23e Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | Doc: added doc for non-documented functionsNico Vertriest2015-05-182-0/+11
| | | | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: I85f58c2877d83b98bf3427cbb0f567575803524f Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | MySQL: Add support for the timeout options via the connectionOptionsAndy Shaw2015-04-272-12/+32
| | | | | | | | | | | | Task-number: QTBUG-321 Change-Id: I0bbc1ae713fb0278a9973f8e87f28f1b3f1c49ce Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | MySQL: Keep the precision of the field when formatting the valueAndy Shaw2015-03-201-0/+3
| | | | | | | | | | Change-Id: I4ab08be5112167a617d6d1d109754f2404a9605f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | QtSql: Fix const correctness in old style castsThiago Macieira2015-03-112-22/+22
| | | | | | | | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c94688f5b6ed76 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-242-26/+26
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * Update SQL plugin path within Qt's sourcesSamuel Gaist2015-02-162-26/+26
| | | | | | | | | | | | | | | | | | The current SQL plugins path are still Qt 4 style. This patch adds qtbase to ensure users will be directed to the right place. Change-Id: I11bf933864f0a8955079bf7175eb1e33bb5bc07f Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | PostgreSQL: Fix special floating point handling for 'float' types.Friedemann Kleint2015-02-181-15/+27
| | | | | | | | | | | | | | | | | | Introduce a template function to determine the special values via macro and use that for QVariant::Double and QMetaType::Float. Task-number: QTBUG-44381 Change-Id: I379dd82b22d467b0aebaa42f4f0f5c52472a5c47 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* | Updated BSD licensed file headersJani Heikkinen2015-02-1510-30/+30
| | | | | | | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Pass params of shareable type by const-ref rather than by valueKonstantin Ritt2015-02-131-1/+1
| | | | | | | | | | | | | | | | ...where passing them by value was not intentional. Change-Id: Ifd5036d57b41fddeeacfbd3f5890881605b80647 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Update copyright headersJani Heikkinen2015-02-1167-444/+444
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* | Use prefix instead of postfix for iteratorsMaks Naumov2015-02-081-1/+2
| | | | | | | | | | | | | | | | | | | | The postfix increment(decrement) creates a temp copy of *this before the modification and then returns that copy. It's needed only when using the old iterator and then incrementing it. Change-Id: I7f6702de78f5f987cec3556047e76049b4ee063a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-213-27/+29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/global.pri src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.h src/corelib/tools/qdatetime.cpp src/plugins/platforms/xcb/qxcbscreen.h src/plugins/platforms/xcb/qxcbwindow.h src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qcolordialog_p.h tools/configure/configureapp.cpp Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
| * Correction on bound values in case of repeated QSqlQuery::execBatchEric Lemanissier2015-01-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | Until now, QSqlQuery::execBatch did not call resetBindCount, which lead the next call to QSqlQuery::addBindValue to start at non zero index. This is problematic in case of a prepared query which is called several times. Task-number: QTBUG-43874 Change-Id: I1a0f46e39b74d9538009967fd98a269e05aac6f2 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * QODBC: fix converted string values empty SQLServer 2012Maximilian Hrabowski2014-12-301-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SQL Server 2012 Native Client (version 11.0.2100.60) or later introduced a change in the behavior of the SQLGetData method when converted string values are involved. In older version a (sometimes wrong) size was returned. Now always SQL_NO_TOTAL is returned which signals to read as much data as available. SQL_NO_TOTAL was handled like SQL_NULL_DATA in the code before which indicates a NULL value so the returned string was empty. See link for more info: http://msdn.microsoft.com/en-us/library/jj219209.aspx Change-Id: Ia0d2296caf593890b301ee1848d1bf3eb8d7b6fe Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Added timezone support for datetime fields in PSQLJulien Blanc2014-12-301-26/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/devSimon Hausmann2014-12-301-3/+2
|\ \
| * | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-291-3/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/kernel/qplatformsystemtrayicon.cpp src/gui/kernel/qplatformsystemtrayicon.h src/plugins/platforms/xcb/xcb-plugin.pro Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
| | * Doc: corrected broken links qtbaseNico Vertriest2014-12-231-3/+2
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-43115 Change-Id: Ib441326083294a6d59d75510142b1481f7b0bc35 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>