summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-284-20/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsettings.cpp src/corelib/kernel/qvariant.cpp src/corelib/serialization/qjsoncbor.cpp src/corelib/serialization/qjsonvalue.cpp src/corelib/tools/tools.pri src/gui/image/qimage.cpp src/gui/kernel/qguivariant.cpp src/widgets/kernel/qshortcut.cpp tests/auto/tools/moc/allmocs_baseline_in.json tests/auto/tools/moc/tst_moc.cpp src/opengl/qglframebufferobject.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Leander Beernaert <leander.beernaert@qt.io> Change-Id: Ie7f5fa646c607fe70c314bf7195f7578ded1d271
| * Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-234-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | SQL: cleanup private classesChristian Ehrlicher2020-01-076-56/+34
| | | | | | | | | | | | | | | | | | | | | | Cleanup private SQL classes: - use nullptr - use member initialization - adjust style - remove deprecated functions Change-Id: I845f5b1081649fdd40f4f80e1052331806230cf7 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-092-4/+4
|\| | | | | | | Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
| * Tidy nullptr usageAllan Sandfeld Jensen2019-12-062-4/+4
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Inline the size and begin pointer in QVectorThiago Macieira2019-12-081-3/+0
| | | | | | | | | | | | | | | | | | | | | | Add QGenericArray to simplify operations. This class can be shared by other tool classes. If there is nothing else to share it, we can move the code onto qvector.h. The one candidate is QList. All tests pass and valgrind is good. Change-Id: Ieaa80709caf5f50520aa97312ab726396f5475eb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-251-0/+3
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qhash.h src/gui/kernel/qevent.h src/widgets/kernel/qshortcut.cpp src/widgets/kernel/qshortcut.h Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
| * 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>
* | | pass QSqlDatabase by const &Albert Astals Cid2019-10-152-5/+5
|/ / | | | | | | | | Change-Id: I326c09ab9313098470cb657571f67755fd7810c7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | 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>
* | 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>
* | Prefix textstream operators with Qt::Lars Knoll2019-05-021-1/+1
| | | | | | | | | | | | | | 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-041-3/+3
|/ | | | | Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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>
* | Always escape the table names when creating the SQL statementAndy Shaw2019-01-232-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | 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.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>
* | 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>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-071-2/+4
|\| | | | | | | Change-Id: Idf2bef470663864069bbf7e41af07b534936863a
| * QSqlDatabase: Skip confusing thread warning on invalid QSqlDatabaseDavid Faure2018-04-061-2/+4
| | | | | | | | | | | | | | | | | | If the db isn't valid, then that's the actual issue, not the fact that we're getting the same invalid db (with the same driver QSqlNullDriver) in multiple threads. Change-Id: I95490818ed78e741c3823e115f139c2cff01b0b1 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-03-282-4/+4
|\| | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_mouse.mm src/testlib/testlib.pro Change-Id: Ia0ce4243418fe6a485b0f290c67bd433b3b04ff2
| * QSqlResult: use QVector<int> instead QList<int> for indexes valueChristian Ehrlicher2018-03-232-4/+4
| | | | | | | | | | | | | | | | Minor tweak: QList<int> is taking 64bit per entry, QVector<int> only 32bit - this should reduce memory usage a little bit. Change-Id: I3e17269feb4840343f5cecfc71f8fccd70edc80f Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-081-17/+17
|\| | | | | | | Change-Id: Idf471ca5c6cf211813466b539ce45bdc1ae9b97c
| * QSqlField: rearrange QSqlFieldPrivate membersChristian Ehrlicher2018-03-071-17/+17
| | | | | | | | | | | | | | | | Rearrange QSqlFieldPrivate members to only need 64Byte instead 72 in an 64bit environment. Change-Id: I620c18aca06a11b7ab4bd8e99b377b9d823da7f4 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Sql: Add a feature for the SQL item modelsUlf Hermann2018-02-202-0/+2
|/ | | | | | | | ... and make sure we can build if it's switched off. Change-Id: I9565a2ce632a861a99e1276f3edf4f0d094b5451 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* doc: Fix several minor qdoc warningsMartin Smith2018-01-201-0/+1
| | | | | | | | | | | The fixes included undocumented enum values, which are now marked as omitted, adding a test for Q_CLANG_QDOC for a couple windows enum values, adding \fn commands for a pair of member functions in QLocale, and a \fn command for an obsolete function in QSqlError. Change-Id: I12a8ea7287039096b9cfe7870d2ab213a3d78dcf Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* doc: Add missing template clause in \fn commandMartin Smith2018-01-121-1/+1
| | | | | | | | The template clause was missing in the \fn command for a member function of a template class. Change-Id: Ie1a8f8372d3183f05f02e518b363a7bac735abbb Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Liang Qi2018-01-121-7/+8
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-111-7/+8
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/src/hb-private.hh src/sql/doc/snippets/code/doc_src_sql-driver.cpp src/sql/doc/src/sql-driver.qdoc Change-Id: I38f0e82fcd37926cbf3c1915e009a731040d4598
| | * QSqlRecord: (re)speedup indexOf(const QString& name)Christian Ehrlicher2018-01-061-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While adding the possibility to access values for QSqlRecord with decorated field names (table.field), some string-allocations were added which created a remarkable slowdown. Replace the QString allocations with QStringRef avoids those allocations and restores the speed for normal operations (apart from on QString::indexOf() call and some integer comparisons) Task-number: QTBUG-65226 Change-Id: I9e458523891421abce9e4a7ed931fec000dcbe76 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | Add more Q_FALLTHROUGH()Friedemann Kleint2018-01-121-1/+1
|/ / | | | | | | | | | | | | | | Silence g++ 7.X warnings. Change-Id: Id06d06e7e3b5be2cf3934d81f1891da58dea2649 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QPSQL: Add support for forward-only queriesRobert Szefner2018-01-063-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, it is possible to significantly reduce memory consumption of applications that fetch large result sets from databases. The implementation is based on the new functionality called "single-row mode" that was introduced in PostgreSQL version 9.2: https://www.postgresql.org/docs/9.2/static/libpq-async.html It also uses asynchronous commands PQsendQuery(), PQgetResult(): https://www.postgresql.org/docs/9.2/static/libpq-single-row-mode.html [ChangeLog][QtSql][QPSQL] Added support for forward-only queries (requires libpq version 9.2 or later) [Important Behavior Changes] The QPSQL driver now supports forward-only queries. To use this feature, you must build QPSQL plugin with PostreSQL client library version 9.2 or later. See the Qt SQL documentation for more information about QPSQL limitations of forward-only queries (sql-driver.html). [Important Behavior Changes] If you build the QPSQL plugin with PostgreSQL version 9.2 or later, then you must distribute your application with libpq version 9.2 or later. Otherwise, the QPSQL plugin will fail to load. Task-number: QTBUG-63714 Change-Id: I15db8c8fd664f2a1f719329f5d113511fa69010c Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QtSql: Raise minimum supported MSVC version to 2015Friedemann Kleint2018-01-042-11/+2
| | | | | | | | | | | | | | | | Remove code for older versions and streamline #ifdefs. Task-number: QTBUG-51673 Change-Id: I1d0f89784f8fb698828e11ce39086501971f1756 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Liang Qi2018-01-023-14/+21
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-023-14/+21
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| | * Merge remote-tracking branch 'origin/5.10.0' into 5.10Liang Qi2017-12-082-2/+16
| | |\ | | | | | | | | | | | | Change-Id: I6dcf85067ec226136c207ea69ca9d66736c84db5
| | | * Fix BC breakage by adding an overload for the QSqlField constructorAndy Shaw2017-11-132-2/+16
| | | | | | | | | | | | | | | | | | | | Change-Id: I253bb8cd97b982fa5ed5dd546c38deb1f7995986 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-12-051-12/+5
| | |\ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/quiview.mm Change-Id: I88384c70047391c75d9ff166c8d9881ff6751dbf
| | | * QSqlQuery: Remove temporary variable in navigation functionsRobert Szefner2017-11-291-12/+5
| | | | | | | | | | | | | | | | | | | | Change-Id: I33836a75e1d2e5663f81a33a195d0cb21760e1f8 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | | DB2: Pass on the native error codes to QSqlErrorAndy Shaw2018-01-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since DB2 can potentially have more than one error code, we need to join these together using ';' as a separator. Task-number: QTBUG-142 Change-Id: Idd376df84a8e3ae4c05b4722b4d0020fa4f3edad Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Return an invalid QSqlDatabase when accessing from another threadAndy Shaw2018-01-021-0/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSqlDatabase objects can only be used in the thread that the connection was opened for. So if the driver was created already then we check if the thread is correct. If it is not then we output a warning and return an invalid QSqlDatabase. [ChangeLog][QtSql][QSqlDatabase] QSqlDatabase::database() will return an invalid QSqlDatabase if the calling thread does not own the requested QSqlDatabase. Task-number: QTBUG-216 Change-Id: Ib5a25aa62129e3925f9819109af05961e5178bc5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>