summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers
Commit message (Collapse)AuthorAgeFilesLines
* Always compile sql drivers as pluginsLars Knoll2016-04-0728-15625/+0
| | | | | | | | | | | | Compiling the drivers into Qt Sql does not make a lot of sense anymore, as we handle plugins well enough in the build system these days. [ChangeLog][Build system] SQL drivers are now always compiled as plugins. Change-Id: I364b82a480849399d1fafe4b20e9f08922569260 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Liang Qi2016-03-133-3/+10
|\
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-113-3/+10
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define and undef in src/corelib/tools/qsimd_p.h. This change is also squashed with "Fall back to c++11 standard compiler flag for host builds" which is done by Peter Seiderer. Conflicts: mkspecs/features/default_post.prf src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch src/3rdparty/sqlite/sqlite3.c src/corelib/tools/qsimd_p.h src/gui/kernel/qevent.cpp src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface_p.h src/plugins/bearer/blackberry/blackberry.pro src/plugins/platforms/cocoa/qcocoasystemsettings.mm src/plugins/platformthemes/gtk2/gtk2.pro src/plugins/styles/bb10style/bb10style.pro src/sql/drivers/sqlite2/qsql_sqlite2.cpp tools/configure/configureapp.cpp Task-number: QTBUG-51644 Done-with: Peter Seiderer <ps.report@gmx.net> Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
| | * 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>
* | | QtBase (remainder): use printf-style qWarning/qDebug where possible (I)Marc Mutz2016-03-122-5/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "" with qWarning("..."). Had to fix broken qImDebug() definition. Instead of defining it as a nullary macro in the QT_NO_DEBUG case and as a variadic macro in the other, define it in both cases, as is customary, as a non-function macro so that overload selection works without requiring variadic macro support of the compiler. Saves e.g. ~250b in text size in QtPrintSupport on optimized GCC 5.3 AMD64 builds. Change-Id: Ie30fe2f7942115d5dbf99fff1750ae0d477c379f Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | QtSql: eradicate remaining Q_FOREACH loopsMarc Mutz2016-02-171-2/+1
| | | | | | | | | | | | Change-Id: I86afe7104d506b840130517ae8066588fab2d745 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | QOCIDriver: optimize string handling in tables()Marc Mutz2016-02-171-31/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Instead of a QStringList, use a const char 2D array to hold the system user names. Don't remove the current user from that list, skip it duing processing. - Extract Method make_where_clause, optimize it and cache its result. Instead of creating a QStringList and join()ing it at the end (sometimes twice), append to the result QString directly. Reserve the max size of the result string, which is statically known. - Keep the query select statements in QLatin1String. They are only used in QStringBuilder expressions. Change-Id: I0593d2812da671a541d49a6136f3ff3d784c63d5 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Reduce allocations in QSQLiteDriver::open()'s connection options parsingMarc Mutz2016-02-151-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | - Use splitRef() instead of split(), avoiding small temporary QStrings. - Don't remove all spaces before splitting, trim strings at the QStringRef level later, where needed. This will reject nonsense strings like QSQL_ LITE _BUSY_ TI MEOUT= 1 2 3 that were previously (wrongly) accepted. - Use C++11 range-for loop. Change-Id: I875c4cf47b7a283ba55783f70c903bb9947e1cd7 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-211-0/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice_p.h src/corelib/kernel/qvariant_p.h src/corelib/tools/qsimd.cpp src/gui/kernel/qguiapplication.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp Change-Id: I742a093cbb231b282b43e463ec67173e0d29f57a
| * 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>
* | | Updated license headersJani Heikkinen2016-01-1518-252/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | qsql_sqlite: fix segfault in dtor of orphan resultMark Brand2015-12-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d79ae904660af7a83dc42a389c2457a8c94020f7 accidentally removed the check on the driver pointer before dereferencing it. This causes a segfault when deleting a result object after its driver has already been deleted. This situation can arise when a database is removed, explicitly or probably also upon unloading the driver plugin, while related results still exist. The problem affected qttools/tests/auto/qhelpcontentmode. Task-number: QTBUG-49836 Change-Id: I8ce8f8a5e27d787309ac2ff644b388e333d76435 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | qsql_sqlite and qsql_sqlite2: don't hold driver data in resultMark Brand2015-12-092-25/+15
| | | | | | | | | | | | | | | Change-Id: Ia4f6adc6daaea97ac06246e9d01c6561de1227ea Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | qsql_odbc: remove forwardOnly overrideMark Brand2015-12-091-15/+5
| | | | | | | | | | | | | | | | | | Change-Id: I243a374f8053639dcb3213478a1c65855d8613b4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | | qsql: remove empty Result destructorsMark Brand2015-12-051-5/+0
| | | | | | | | | | | | | | | Change-Id: If7594421fe5a584912e092feb18002f56d6d30f3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | qsql: apply Qt's PIMPL idiom to Q*ResultPrivateMark Brand2015-12-0516-251/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QResult and QResultPrivate are not derived from QObject and QObjectPrivate respectively, but can still benefit from Qt's PIMPL idiom. There are several interrelated aspects to this: - Base all driver ResultPrivate classes on QResultPrivate. Previously, each level in the Result hierarchy tended to keep its own private data class. - The ResultPrivate class initializes its own Result (q_ptr) and Driver members. This ensures that these pointers are correctly set in time for the ResultPrivate constructors and Result constructors. This is more efficient and makes it a lot easier to follow what's being allocated, initialized, and cleaned-up. - Use macros Q_DECLARE_PRIVATE, Q_DECLARE_PUBLIC, Q_D, and Q_Q for access to and from ResultPrivate objects. - ResultPrivate classes refer frequently to their counterpart DriverPrivate. Various patterns were used to do this. Now Q_DECLARE_SQLDRIVER_PRIVATE arranges this uniformly while hiding ugly casting. It creates a public method in the ResultPrivate returning the correctly typed pointer to the corresponding DriverPrivate object. Since the method is public, the Result class and helper classes and functions can also use it. - The explicit const is removed from QResultPrivate::sqldriver, even though it is treated (mostly) like a const within the context of Result and ResultPrivate. This is the same pattern seen in Qt's PIMPL idiom. The macro created getter methods take care of const. - qsql_mysql was using a signal/slot connection to zero its own copy of the driver pointer when the driver was destroyed. This is no longer necessary. Change-Id: Ida4933bc92fb3e9a05ea4b53b48085894734e36e Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | qsql: add missing Q_DECL_OVERRIDEMark Brand2015-11-3012-181/+181
| | | | | | | | | | | | | | | Change-Id: Ic562ee9e287f21d73b94f6dc3c4884a2ed33b9fe Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | qsql: move Q<driver>Result out of headerMark Brand2015-11-278-142/+134
| | | | | | | | | | | | | | | | | | | | | | | | Leaf result classes do not need to be exposed in the headers. The implementations were inconsistent on this point. Change-Id: I5bd41ae9e77b932f6232218a014400a59f2ef5a0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | qsql: add missing Q_EXPORT_SQLDRIVER_* macrosMark Brand2015-11-273-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | and remove a stray one. Change-Id: I1a10688e6cf916aa93f383ecc9e9aa8e28966e95 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Andre Somers <andre@familiesomers.nl> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | qsql: remove stray includes and forward declsMark Brand2015-11-265-13/+5
| | | | | | | | | | | | | | | | | | Change-Id: I9b8f6283c7e98ab071473f684f3fc22b1c0c7273 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | qsql_odbc: rename QODBCPrivate to QODBCResultPrivateMark Brand2015-11-252-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This naming pattern is consistent with the other drivers and prepares for subsequent changes. Change-Id: I77d1edcfd52727cd1126adbf70a808dfbf3255be Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | qsql_ibase: use virtual createResultMark Brand2015-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This method is virtual probably to avoid having to use the specific driver type in cases like this. Change-Id: Ifd9d5e2d320b744e098a0b24ae6f3a89cfc15c9a Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | | qsql_oci: fix option typesMark Brand2015-11-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are signed values. Notice the initialization to -1, which apparently never worked. The unsigned types previously used may be due to confusion with other arguments of OCIAttrSet(): sword OCIAttrSet ( dvoid *trgthndlp, ub4 trghndltyp, dvoid *attributep, ub4 size, ub4 attrtype, OCIError *errhp ); Examples found in web searches also use signed int. Change-Id: I8db273a554fa0ef454a8dfce5d83983f79cf6cb9 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | | qsql_db2: fix build failureMark Brand2015-11-231-5/+6
|/ / | | | | | | | | | | | | | | | | Casting between Qt::Handle (void*) and db2's SQLHANDLE (int) is not tolerated by gcc 5. Neither is the missing enum value in the switch. Change-Id: Ibce0adc68376e6c411cae238b26abc6682d0392c Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.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>
* | 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>
* | 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>
* | 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>
* | | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | 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>
* | | Added SSL support for MySQL database connectionsOlivier Delbeke2015-06-141-30/+67
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | MySQL: Add support for the timeout options via the connectionOptionsAndy Shaw2015-04-271-12/+29
| | | | | | | | | | | | 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>
* | 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>
* | 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-1118-126/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-212-27/+28
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * 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>
* | Return true for QSqlQuery::isNull on non-existent fields.Milian Wolff2014-12-291-0/+2
| | | | | | | | | | | | | | | | This fixes the tst_QSqlQuery::isNull test case when run against a MySQL database driver. Change-Id: I8248ba956472bae97a64247594055e6f02840557 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-035-85/+85
| | | | | | | | | | | | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>