summaryrefslogtreecommitdiffstats
path: root/tests/auto/sql
Commit message (Collapse)AuthorAgeFilesLines
* Interbase: Handle EXECUTE BLOCK statements correctlyAndy Shaw2020-09-131-0/+22
| | | | | | | | | | | | Since an EXECUTE BLOCK statement can have a mix of ? and :var syntax then a special case for this needs to be added so that it does not try to convert the :var parts into positional placeholders as they need to kept as-is when preparing such a statement. Pick-to: 5.15 Fixes: QTBUG-83152 Change-Id: Iff891207ad6dea1681a1b3a335acbbbb668b465d Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Interbase: Add support for the boolean typeAndy Shaw2020-09-112-4/+9
| | | | | | | | | | | | | This is added to Interbase in v7 and Firebird in v3 which has been available for sometime now. This means the minimum supported for Interbase is now v7. [ChangeLog][QtSQL][Interbase] The minimum required version for Interbase is now v7. Fixes: QTBUG-83401 Change-Id: I9927fd962f25c935be8ed5d2b7c76c00fb88cd8c Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Remove most compiler warnings about missing overridesLars Knoll2020-09-111-4/+4
| | | | | | | | | | | | Remove around 1000 compiler warnings about missing overrides in our auto tests. This significantly reduce the compiler warning noise in our auto tests, so that one can actually better see the real problems inbetween. Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Interbase: Correctly read/write arrays to the databaseAndy Shaw2020-09-081-0/+29
| | | | | | | | | | | The fix ensures that it can find the column for the array correctly when reading/writing and also handles the integer typed arrays correctly too. Pick-to: 5.15 Fixes: QTBUG-83409 Change-Id: I92d982bdf0927e6ebc6dce84fec9ad6c44c26c25 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QSqlite: Don't crash after binding too many placeholdersMarcel Krems2020-08-241-0/+10
| | | | | | | | | | | | | | When you bind more values than the query has placeholders, indexes will be empty which causes an out-of-bounds access in indexes.first. We can't check the parameter count because of multiple placeholders with the same name, so we check if the name is null. Tested with SQLite and PostgreSQL Pick-to: 5.15 Change-Id: Id5d4bd15d7ed16603f47b87d6e0bf811a20157d8 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Interbase: Fix tests when running against FirebirdAndy Shaw2020-08-236-61/+125
| | | | | Change-Id: Ibfcf6b557aed3b0cd2e0ece5cf122819a1acc0c1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deprecate QVariant::Type uses in QSqlFieldLars Knoll2020-08-156-128/+128
| | | | | | | | Add metaType()/setMetaType() methods to be used instead of the type() methods taking a QVariant::Type. Change-Id: Ieaba35b73f8061cd83288dd6b50d58322db3c7ed Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Restrict QVariant::isNull() behaviorLars Knoll2020-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | isNull() would forward to the contained type and check that type's isNull() method for some of the builtin types. Remove that behavior and only return true in isNull(), if the variant is invalid, doesn't contain data or contains a null pointer. In addition, implement more consistent behavior when constructing a QVariant using the internal API taking a copy from a void *. isNull() should return true in both cases. This mainly changes behavior for some corner cases and when using our internal API. [ChangeLog][Important Behavior Changes] QVariant::isNull() no longer returns true when the variant contains an object of some type with an isNull() method, that returns true for the object; QVariant::isNull() now only returns true when the variant contains no object or a null pointer. Change-Id: I3125041c4f8f8618a04aa375aa0a56b19c02dcf5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix warnings about unused variables and functions in testsTor Arne Vestbø2020-07-261-1/+0
| | | | | Change-Id: Ia758a91384083c13fb4d743f500fef7a6629dfd5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Regenerate subdir test projectsAlexandru Croitor2020-07-091-0/+2
| | | | | | | | And generate a few more test projects that were missing. Change-Id: I5df51106549aa5ae09bc3c42360e14b143719547 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-0913-13/+13
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-071-1/+1
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Sql: Fix heap-user-after-free for globally initialized db objectsAlexandru Croitor2020-07-016-13/+55
| | | | | | | | | | | | | | | Becaues the database objects were created as globals, there was a possible use-after-free issue when deleting the objects on application exit. Move the initialization of the database objects into static variables inside the test constructor. As a drive-by, also add one missing test to the CMake projects. Fixes: QTBUG-85357 Change-Id: I2c8f2c5daee96bb9d1d21dae37950a2da5ffdf27 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use QList instead of QVector in sql testsJarek Kobus2020-06-252-15/+11
| | | | | | Task-number: QTBUG-84469 Change-Id: Id429ce85da027541b53d516045a78b739c2e9745 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Change boundValues() to return a QVariantListAndy Shaw2020-06-221-41/+43
| | | | | | | | | | | | | This enables the order of boundValues to be consistent as with a QMap it could have been reordered which can be a problem for positional bindings. [ChangeLog][QtSQL] Changed signature of QSqlQuery::boundValues() to return a QVariantList Fixes: QTBUG-51609 Change-Id: I1c80fa8522fa7352723420b6fc9ec466406315fb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make qtbase compile without QT_CONFIG(timezone)Andrei Golubev2020-05-111-8/+31
| | | | | | | | Fixes: QTBUG-83795 Pick-to: 5.15 Change-Id: I05eaaf57d87a9111d3609ebab81bc707f8af98f0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QSqlError: Remove deprecated methodsMarcel Krems2020-04-061-80/+0
| | | | | | Change-Id: I4eb9918e65bc7990effb8a643332ba232e975893 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* tst_sqlquery: Skip datetime test if no database drivers are availableLeander Beernaert2020-03-231-0/+3
| | | | | Change-Id: I4a4619f2edc3c82fc37605d54e9bedc36abd7388 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-161-0/+22
|\ | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a
| * QMySQL: return QVariant::ByteArray for POINT columnChristian Ehrlicher2020-03-151-0/+22
| | | | | | | | | | | | | | | | | | | | | | qDecodeMYSQLType() did not handle FIELD_TYPE_GEOMETRY and therefore the type for a POINT column was incorrectly treated as QVariant::String. Even the type can not (yet) be properly decoded to a QPoint, treating it as QVariant::ByteArray is the better option here. Fixes: QTBUG-72140 Change-Id: I12e75b326ae3acb75cb36f2e650464528bd43c0e Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge "Merge remote-tracking branch 'origin/wip/cmake' into dev"Alexandru Croitor2020-02-1410-30/+19
|\ \
| * | Regenerate projects one last time before mergewip/cmakeAlexandru Croitor2020-02-1210-30/+19
| | | | | | | | | | | | | | | | | | Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QtSql: remove compat SQL plugin namesChristian Ehrlicher2020-02-131-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | Remove the compat SQL plugin names (QMYSQL3, QOCI8, QODBC3, QPSQL7) since they are not needed and just confuse the user [ChangeLog][QtSql] The compat plugin names QMYSQL3, QOCI8, QODBC3 and QPSQL7 are no longer available. Change-Id: I6d88f449ef3e18881a6970fb374ba0ab074ef302 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-241-39/+36
|\| | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-101-39/+36
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/network/kernel/qnetworkinterface/BLACKLIST Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
| | * tst_QSqlQuery: fix some testsChristian Ehrlicher2019-12-101-39/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix some tests in tst_QSqlQuery: - make sure to use QSql::HighPrecision in tst_QSqlQuery::precision() (needed for psql) - remove outdated stuff for mysql 3.x - psql_bindWithDoubleColonCastOperator: the placeholder are stored as named placeholders in psql - avoid some useless old-style casts Change-Id: I54d29a7e24f17d853cce6baa09a67d9278098810 Reviewed-by: Robert Szefner <robertsz27@interia.pl> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-191-103/+12
|\| | | | | | | | | | | Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-251-14/+13
| |\| | | | | | | | | | Change-Id: Iebedaa967a263854f18cd403ce007d7965f26d2b
| | * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-241-14/+13
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstandardpaths_unix.cpp src/corelib/tools/qsharedpointer_impl.h tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
| | | * QODBC: Fix crash when a prepared statement is deleted after the db was removedChristian Ehrlicher2019-10-151-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a prepared statement is still alive after the database was removed with QSqlDatabase::removeDatabase(), the cleanup routine is trying to access the driver which is no longer alive which results in a crash. Fixes: QTBUG-79019 Change-Id: I4630e3b947a12b23ed062f015abc373fc0e246c1 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-181-90/+0
| |\| | | | | | | | | | | | | | Change-Id: I4fbbf100b673ab100997dbf2f42bf195dc3c050f
| | * | tst_QSqlQuery: remove tests commented out a long time agoChristian Ehrlicher2019-10-161-90/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove some code which was commented out with 'NOT_READY_YET' since the initial Qt5 import. Since the mentioned bug reports are no longer available remove this code. Change-Id: I98686e53d85619f01d16105d147eba79b557a104 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Regenerate tests/auto/sqlAlexandru Croitor2019-11-1313-13/+136
| | | | | | | | | | | | | | | | | | | | Change-Id: If411b1e7c3a7cb58922e5a48309f42ba29f2c068 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-142-59/+24
|\| | | | | | | | | | | | | | | Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
| * | | QMYSQL: remove support for MySql 4.xChristian Ehrlicher2019-10-122-33/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySql 5.0 was released 2005 so it's time to remove support for MySql 4.x 14 years later. [ChangeLog][QtSql][QMYSQL] Removed support for MySql < 5.0 since 5.0 was released 14 years ago. Change-Id: I45005accdffefbd9338ac0e710512a4c7ea8e09e Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * | | QSqlDriver: deprecate one-arg notification() signalChristian Ehrlicher2019-09-211-26/+24
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'wip/qt6' into wip/cmakeAlexandru Croitor2019-08-153-20/+60
|\| | | | | | | | | | | Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
| * | test: migrate QSqlDatabase test to QRegularExpressionSamuel Gaist2019-07-292-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is part of the migration of qtbase from QRexExp to QRegularExpression. Task-number: QTBUG-72587 Change-Id: Id82e103d4076fed63c871385b2b0f21c04735d00 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Make sql tests build and pass with disabled deprecated APIsSona Kurazyan2019-07-231-12/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecated APIs of sql lib are used only in tests. This change makes sure, that the tests build and pass with those deprecated APIs removed or disabled, by: - Making the parts of the tests testing the deprecated APIs to be compiled conditionally, only when the corresponding methods are enabled. - If the test-case tests only the deprecated API, but not the corresponding replacement, added tests for the replacement. Task-number: QTBUG-76541 Change-Id: I93ed6ff92c7aa7af2c106b1a9d92d3704c7d9105 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Regenerate some of the test projects that do SUBDIRS += fooAlexandru Croitor2019-08-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This show cases the new cleaner subdirs handling code in pro2cmake. Change-Id: I25001942ef020e4c4191b355f55309c4fb033ecc Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-112-4/+5
|\| | | | | | | | | | | Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
| * | Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Convert uses of QTime as a timer to QElapsedTimerEdward Welbourne2019-06-141-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Merge commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-168-84/+155
|\| | | | | | | | | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
| * | QSqlError: fix redundant space in text() outputVincas Dargis2019-03-261-0/+24
| |/ | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-213-6/+7
| |\ | | | | | | | | | Change-Id: I830beea26863323ab78a5d4b093f7763d77ad3da
| | * Fix a couple of SQL testsAndy Shaw2019-02-193-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | One of the tests was not added to the parent subdirectory pro so this is also rectified. Change-Id: I270f1c2882260e3e3fac83d074ed6444c5dece19 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-081-0/+21
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-235-77/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>