summaryrefslogtreecommitdiffstats
path: root/src/sql
Commit message (Collapse)AuthorAgeFilesLines
* SQL: add proper support to build QMYSQL with MariaDB client librariesChristian Ehrlicher2020-01-032-10/+24
| | | | | | | | | | | | | | | The QMYSQL plugin can also be build with the MariaDB client libraries since they are source compatible. But the MariaDB libraries could not be found on windows because the library name differs. Therefore add the correct library names and update the documentation to make clear that MariaDB is supported through the QMYSQL plugin. [ChangeLog][Sql][QMYSQL] The QMYSQL plugin can now be build with the MariaDB C connector libs on Windows. Change-Id: Id99f8be96c4179fd2321b3e61c90bb300c53bb82 Reviewed-by: Marius Kittler <mariuskittler@gmx.de> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-161-7/+4
|\ | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket.cpp src/widgets/kernel/qapplication.cpp Change-Id: Ib7421cc2df59d0969f89b3fbd65a17ea76ffef3b
| * Doc/SQL: update sql driver creation instructionsChristian Ehrlicher2019-12-141-7/+4
| | | | | | | | | | | | | | | | Fix the links, remove section about Q_ODBC_VERSION_2 - it wasn't there since Qt5.0. Change-Id: I571f5c2cf0f0e2df38638299c26814b510d1a8af Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-122-22/+93
|\| | | | | | | Change-Id: I69238f23882deebeaad46e4fdcf899ab22cc2b8f
| * Doc/SQL: update sql driver creation instructionsChristian Ehrlicher2019-12-112-22/+93
| | | | | | | | | | | | | | | | Update the instructions on how to build and distribute the mysql and postgresql drivers on windows. Change-Id: Ie4d50c1c34820680d7496b9544eb00fcee17f8e7 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Tidy nullptr usageAllan Sandfeld Jensen2019-12-063-11/+11
| | | | | | | | | | | | | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-201-1/+1
| | | | | | | | | | | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-201-0/+3
|\| | | | | | | Change-Id: Ic4ffd206bdd3ed68fd3d21a93818923e8d3a1e7a
| * Doc: add warning for binding values in QSqlQuerySamuel Gaist2019-11-181-0/+3
| | | | | | | | | | | | | | | | | | | | Not all SQL operations support binding values like the PRAGMA instruction of SQLite. This patch adds a warning for the developer to make it clearer that binding values cannot be used for everything. Task-number: QTBUG-80082 Change-Id: Ie1d33815d74a0759a3593df9410b8bad448f6fe9 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* | QSqlTableModel::record: Use the const & we're givenAlbert Astals Cid2019-10-251-1/+1
| | | | | | | | | | | | | | | | | | QSqlTableModelPrivate::ModifiedRow::rec returns a const & so use it instead doing a copy. QSqlRecord is cheap to copy constructor but not having to do it is faster Change-Id: Iad6e79fcdcdf380ce681fe9426436f8cb98be553 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-011-1/+1
|\| | | | | | | Change-Id: I77ba01f09b3dbcaf13cb265a70d9da661c32a61f
| * Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-301-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qrandom.cpp src/corelib/io/qfileinfo.cpp src/corelib/kernel/qeventdispatcher_win.cpp src/corelib/kernel/qeventdispatcher_win_p.h src/gui/text/qfontdatabase.cpp src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm src/plugins/platforms/windows/qwindowsglcontext.cpp src/testlib/qtestcase.cpp Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4893212471aa24be804c989a581810e2f714545c
| | * Fix connection string code snippet for ODBC on WindowsAndy Shaw2019-09-241-1/+1
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-15133 Change-Id: I86d77aec039fdfaf262ad056c944c7cfc30e0041 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-09-241-0/+8
|\| | | | | | | | | | | Change-Id: I9ec6345a38ada55219f3cdfb6bd0d6e9169fe880
| * | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-231-0/+8
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qstylesheetstyle.cpp Change-Id: If11da7799075cc2d5768da5603c5fc46773c4eae
| | * Add SQLite specific documentation when specifying a database nameAndy Shaw2019-09-211-0/+8
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-67847 Change-Id: I3c640233526260b596e8224dc48f713a3f0cff56 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | QSqlDriver: deprecate one-arg notification() signalChristian Ehrlicher2019-09-212-0/+6
|/ / | | | | | | | | | | | | | | | | | | | | | | | | QSqlDriver::notifcation() signal is available in two versions since Qt4 times. They are both emitted in the corresponding places which is useless. Therefore deprecate the one-arg version. [ChangeLog][QtSql][QSqlDriver] The one-arg version of QSqlDriver::notifcation() is now deprecated. Change-Id: Ie09aa0cc952f4d854c6fb617b37b9047a3194ee3 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Fix build without feature.stringlistmodelTasuku Suzuki2019-06-301-1/+0
| | | | | | | | | | Change-Id: Ia7a24ef1b0beea7519403000ba20dc78a3c20a21 Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-271-0/+1
|\| | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/network/ssl/qsslsocket_openssl.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
| * Doc: Replace example file lists with links to code.qt.ioTopi Reinio2019-05-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of generating .html page for each file in an example project, generate links to code.qt.io, under the correct path and branch, where the user can browse the example source. Store all URLs under QT_INSTALL_DOCS/config where other qt5 submodules can access them. The repository name appears in the URL, so we cannot define a single URL for all modules. Task-number: QTBUG-74391 Change-Id: I63d4d6d2c352877797b1ee8e057d48c0cd789bff Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-202-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-141-0/+30
|\| | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
| * doc: Add dontdocument.qdoc filesMartin Smith2019-05-071-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each module that has publically declared classes or structs that are not meant to be documented is given a dontdocument.qdoc file to tell qdoc that these classes are not meant to be documentented. Then qdoc will not print warnings about missing \class comments for these classes and structs. Change-Id: I9195f0b546032e1c7642c9da34d85a0a4a9bfb08 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | QtSql: mark QSqlite2 plugin as obsoleteChristian Ehrlicher2019-05-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | Mark QSqlite2 plugin as obsolete so it can be removed with Qt6. The last sqlite2 release was 2005 so it's time to remove this plugin in Qt6. [ChangeLog][QtSql][SQlite2] Marked QSQLITE2 plugin as obsolete - it will be removed with Qt6 together with the QTDS plugin Change-Id: I9861331d4eb2b13f38b9e0e09ad9472b70e9b6e2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Compile with Qt 6Lars Knoll2019-05-021-1/+2
| | | | | | | | | | Change-Id: I6d8d562a871a2f49db5db8630a08f53a14c0f7d3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Prefix textstream operators with Qt::Lars Knoll2019-05-022-3/+3
| | | | | | | | | | | | | | As the non prefixed variants are deprecated Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | QRegExp include cleanupSamuel Gaist2019-04-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QRegExp includes can be found in several files where there's not even a use of the class. This patch aims to avoid needless includes as well as follow the "include only what you use" moto. This patch removes a QRegExp include from the QStringList header which means that there is likely going to be code breaking since QStringList is used in many places and would get QRegExp in. [ChangeLog][Potentially Source-Incompatible Changes] qstringlist.h no longer includes qregexp.h. Change-Id: I32847532f16e419d4cb735ddc11a26551127e923 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Qt Forward Merge Bot2019-04-041-1/+1
|\ \ | | | | | | | | | refs/staging/dev
| * | QSqlError: fix redundant space in text() outputVincas Dargis2019-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSqlError::text() returns single space if QSqlError is not valid. In addition, it adds space in case one of driverText or databaseText is empty. Change condition upon which space is added between databaseText and driverText, and update unit test to cover these cases. Fixes: QTBUG-74575 Change-Id: I52cce9b0287a523d7ff9059cff38bcd8b26eb303 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usageAllan Sandfeld Jensen2019-04-042-5/+5
|/ / | | | | | | | | Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* / More nullptr usage in headersKevin Funk2019-03-142-2/+2
|/ | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-081-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/templates/AndroidManifest.xml src/network/ssl/qsslsocket_mac.cpp src/widgets/styles/qstylesheetstyle.cpp tests/auto/corelib/kernel/qtimer/BLACKLIST tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp tests/auto/testlib/selftests/expected_blacklisted.lightxml tests/auto/testlib/selftests/expected_blacklisted.tap tests/auto/testlib/selftests/expected_blacklisted.teamcity tests/auto/testlib/selftests/expected_blacklisted.txt tests/auto/testlib/selftests/expected_blacklisted.xml tests/auto/testlib/selftests/expected_blacklisted.xunitxml tests/auto/testlib/selftests/expected_float.tap tests/auto/testlib/selftests/expected_float.teamcity tests/auto/testlib/selftests/expected_float.txt tests/auto/testlib/selftests/expected_float.xunitxml Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
| * Replace executedQuery when executing a new queryJesus Fernandez2019-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | Only the first successful query was stored in the variable. When a new query is executed the function QSqlResult::setActive was not replacing the last executed query. Fixes: QTBUG-28883 Change-Id: Ib4938c42e6264f9edd0764b4a392da7988f68fc0 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | QtBase: replace 0 with \nullptr in documentationChristian Ehrlicher2019-01-281-5/+5
| | | | | | | | | | | | | | | | | | | | Replace 0 with \nullptr in the documentation. As a drive-by also replace some 0 with nullptr in the corresponding code. Change-Id: I914b6b2151554c06acc2d244eff004524cbb9a82 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Always escape the table names when creating the SQL statementAndy Shaw2019-01-234-8/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since some databases are case sensitive if part of the query is quoted, then we should ensure that all instances of the table name are escaped unless the test is delibrately testing the non-escaped case. As a result, this commit also removes some expected failures pertaining to PostgreSQL and also adds an entry to the list of tables being dropped when a test is finished. [ChangeLog][Sql][PostgreSQL] QSqlDatabase is now stricter about table names when used with record() and primaryIndex(). If the tablename was not quoted when it was created, then the table name passed to record() and primaryIndex() needs to be in lower case so that PostgreSQL is able to find it. Fixes: QTBUG-65788 Change-Id: Id1f54cb66b761c39edf858501b730ede7eec1fd3 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-211-3/+3
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
| * QSqlRelationalDelegate: compile with QT_NO_CAST_FROM_BYTEARRAYChristian Ehrlicher2019-01-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | QSqlRelationalDelegate::setEditorData() does not compile when QT_NO_CAST_FROM_BYTEARRAY is defined. Since it's a public header this will break user code. Fix it by calling QByteArray::data() instead of relying on the implicit cast. Fixes: QTBUG-72764 Change-Id: I9c111dd25f48c9c9780d9f9a5b6b75eed0c8d6ed Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Doc: replace QItemDelegate with QStyledItemDelegateChristian Ehrlicher2019-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Since QStyledItemDelegate should be preferred over QItemDelegate the documentation should point to QStyledItemDelegate instead. Also mark some internal classes which derive from QItemDelegate so they will not be forgotten during Qt6 porting. Change-Id: I2dd17feedf8593afac5ca16d2546e1f0bc0250ae Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Add overload of QSqlDatabase::cloneDatabase to allow cloning cross threadsAndy Shaw2018-12-232-0/+35
| | | | | | | | | | | | | | | | | | | | | | Since QSqlDatabase::database() cannot be used to access another database from another thread, then the overload is provided to make it possible to clone with just the connection name. This will handle the cloning internally safely then. Fixes: QTBUG-72545 Change-Id: I861cc5aa2c38c1e3797f6f086594a1228f05bada Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-083-13/+13
|\| | | | | | | | | | | | | Conflicts: src/widgets/styles/qstylesheetstyle.cpp Change-Id: I3a503b44ae413fbc0a90f4af70b8f84daffd86ad
| * QtSql: fix code snippetsChristian Ehrlicher2018-10-033-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code snippets retrieving the native database driver handles was using qstrcmp() wrong since that is returning 0 when the strings are equal. In some snippets there was even a plain char * comparison which would not work at all. Fix all the places by correctly using qstrcmp() and replace the checks for the valid pointer by not checking for 0. Fixes: QTBUG-70598 Change-Id: I5c53dcfc51c958203fc60fa6a23dd6b27faa1d96 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-291-1/+1
|\| | | | | | | Change-Id: I6083c3e61b7dbe188f83676f7e7bb268e5ccf2f3
| * Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-09-271-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/widgets/util/qcompleter.cpp Change-Id: I4f44f0f074982530f2f2e750ce696230b2754cf3
| | * Modernize the "datestring" featureLiang Qi2018-09-241-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I2236a456fe3758d9054b22e36fe6316f3522d533 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-091-0/+2
|\| | | | | | | | | | | Change-Id: I36cda712b4cf960de70e497aef52fbc491099f1c
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-071-0/+2
| |\| | | | | | | | | | Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
| | * Doc: Check before including the \snippet from a .pro fileVenugopal Shivashankar2018-08-301-0/+2
| | | | | | | | | | | | | | | | | | Change-Id: Icc7552b46a2657c81958e40f33596ddeee045172 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Implement clearItemData in common modelsLuca Beldi2018-09-062-0/+13
|/ / | | | | | | | | | | | | | | | | | | A virtual method clearItemData was added to QAIM for Qt6. This patch implements that method to all Qt concrete models for which it makes sense. Task-number: QTBUG-69616 Change-Id: If980fcfc36f723128bc56ec4587c5c3a338dbbcc Reviewed-by: David Faure <david.faure@kdab.com>
* | Doc: Explicitly state that QSqlTableModel only handles EditRoleAndy Shaw2018-09-031-0/+4
| | | | | | | | | | | | | | | | Fixes: 5.12.0 Task-number: QTBUG-70234 Change-Id: I65c6aa60048182c5408dca2aa20098af363b10ec Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | QSqlQuery: Specify documentation of named placeholdersChristian Ehrlicher2018-08-281-1/+3
| | | | | | | | | | | | | | | | | | | | Named placeholders can only contain characters in the range of [a-zA-Z0-9_] but this was not documented anywhere. Task-number: QTBUG-69775 Change-Id: I5c4eff7674b1fc04cef60e7d7f44cd87414ffbe9 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>