summaryrefslogtreecommitdiffstats
path: root/tests/auto/sql
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup the SQL testsAndy Shaw2013-04-257-325/+325
| | | | | | | | | | This removes some XFAILS that were no longer correct and fixes some existing problems in the tests where ODBC is concerned. Change-Id: I91de526bb50ad4046ba07ddb5336aa3714966687 Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Fix sql tests in respect to Oracle databasesAndy Shaw2013-04-058-337/+354
| | | | | | | | | | Oracle has a limitation of 30 characters for a tablename so the main change is to account for this, which meant changing all the usages of qTableName(). Some other fixes are included that ensure the tests are working correctly as far as Oracle is concerned. Change-Id: I8ad8a5a33e6a70fcad235f6a7e82e91687b74fee Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Move the dbmstype to QSqlDriverPrivate so it can be used for all driversAndy Shaw2013-04-028-16/+16
| | | | | | | | | By moving it to QSqlDriverPrivate we make it easier to check what database is actually connected which is particularly useful for the autotests. Change-Id: I54d1c2c998919c1d54efb1b6ac9303070ece54aa Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QtSql tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0Debao Zhang2013-03-2812-12/+0
| | | | | Change-Id: I93169244b51f8b993f97f7595e0bc7006ae04e3a Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Merge "Merge branch 'dev' into stable" into refs/staging/stableSergio Ahumada2013-03-202-75/+75
|\
| * Merge branch 'dev' into stableOswald Buddenhagen2013-03-202-75/+75
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This starts Qt 5.1 release cycle Conflicts: src/gui/text/qfontdatabase.cpp src/gui/text/qharfbuzz_copy_p.h src/widgets/kernel/qapplication.cpp src/widgets/kernel/qcoreapplication.cpp Change-Id: I72fbf83ab3c2206aeea1b089428b0fc2a89bd62b
| | * Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-75/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| | * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-182-0/+39
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qmacstyle_mac.mm Change-Id: If8326db9e7da3cbf45dbf7475fdff9915c7723b1
| | * \ Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-144-35/+283
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| | * | | Fix warning about unhandled enumeration values in tst_sqldriver.Friedemann Kleint2013-01-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I4e750982aab861abbbbabe980a663f8b118cdf54 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* | | | | ODBC: fixed consistence of return of QODBCResult::exec()Israel Lins2013-03-201-0/+4
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QODBCResult::exec() returns false when query is an delete with no data do delete caused by SQLExecute function returning SQL_NO_DATA, but the false return means error on execution. Task-number: QTBUG-10569 Change-Id: I6c7ebadcf62ab404b60c7bcccdab6a10bf16a923 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | ODBC: fix loss of milliseconds when binding QDateTimeIsrael Lins2013-03-131-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Caused by operator precedence error. Follow-up to commit b8b79a0f37ec74fd5b4ad829e522a384ba3622ae Task-number: QTBUG-2192 Change-Id: I17decd18c469b48a0bc938ae05c16cced8042219 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | Fix for Sql query aliases with dotsMarko Kangas2013-03-131-0/+39
| |_|/ |/| | | | | | | | | | | | | | | | | Task-number: QTBUG-14904 Change-Id: I98a02d4bbf28522cd5c2f65ea606b6b26977e8e6 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | QSqlResult: fix parsing of bound SQL statementsIsrael Lins2013-02-152-0/+39
| |/ |/| | | | | | | | | | | | | | | | | | | | | Parsing for bound SQL parameters now handles identifier quoting using double quotes (") and square brackets ([]). The following has only 1 bound value but previously 2 were detected: SELECT 1 AS "A?b[?']]]de?ghi", ? Task-number: QTBUG-27159 Change-Id: Icfd02187e1126ff3b5ed11df8d4e599f574e61bf Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | QSqlQuery tests: fix create table failuresMark Brand2013-02-121-7/+16
| | | | | | | | | | Change-Id: Id20517cc68d03ac008650374fadd96cd6626d3fe Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | QSqlQuery tests: fix bool test for postgresqlMark Brand2013-02-121-4/+6
| | | | | | | | | | Change-Id: I60634f89841cbc81058588e435c6482c6c0efed6 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | QSqlQuery tests: fix mysql problemsMark Brand2013-02-121-5/+14
| | | | | | | | | | | | Change-Id: I82f4e6c8801c7a936b80ad72c229f915e6d2a4de Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | fix QSqlTableModel:revert() for OnFieldChangeMark Brand2013-02-091-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | revert() should operate in OnFieldChange edit strategy just as submit() does. The reason in Qt 4 for excluding OnFieldChange was that there was no opportunity to revert. The model was refreshed, causing all changes to be lost. In Qt 5 a failed edit remains in the cache until user action, which could be to revert. Change-Id: Ide021c4f83a53834b7ed81f2abfa3aa49317704d Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | QSqlTableModel: support refreshing inserted rows with auto columnsMark Brand2013-02-061-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, selectRow() did not work after INSERTing a new row into a table with an automatically populated column. It did not work because the model did not know the primary values for the new row. Newly inserted rows were therefore not refreshed in OnFieldChange and OnRowChange edit strategies. This change provides support for the typical simple case where a single column is populated by the database and can be retrieved with QSqlQuery::lastInsertId(). Task-Number: QTBUG-29102 Change-Id: Ibf0f0ac8661185bde57034ddf40c2178bece4778 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Lukas Geyer <lgeyer@gmx.at> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | QSqlTableModel::setData(): fix non-change detectionMark Brand2013-02-061-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 10ff9de91bedf93852f13a58287afd8831644759 introduced the optimization of ignoring non-changes, but it overshot the mark. It neglected to consider that QVariant's equality operator does not compare the null flag. It also failed to consider that setData() has a useful side effect of setting the generated flag in a column of a pending INSERT. This is important when the application actually wants a NULL to be inserted into the column. Task-number: QTBUG-29217 Change-Id: I1368f7acc21eebfeb5a8d23746fc38f6f30fd395 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | fix QSqlTableModel::headerData() for empty query with inserted rowMark Brand2013-02-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QSqlQueryModel::headerData() relied on virtual indexInQuery() to detect whether the requested column at row 0 mapped to an index in the query. This failed when row 0 was a pending insert managed by QSqlTableModel, and therefore not in the query. The only thing that matters here is the column. Task-number: QTBUG-29108 Change-Id: I3e0ae85ba223e444781ec8033386d394bb44f0e8 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | QSqlError test: Fix isValid()-check for constructed QSqlError.Marcel Krems2013-02-041-1/+1
| | | | | | | | | | Change-Id: I4dc1f537226139ceca017cc36abadd2fba4ce35b Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | tests: Fix some more old references and links to NokiaSergio Ahumada2013-02-011-18/+18
|/ | | | | | | Task-number: QTBUG-28156 Change-Id: Ifb768b167203c901c5e42ce58c9aaf3db2739320 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-1814-14/+14
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Tests: Remove declaration of built-in and automatic metatypes.Stephen Kelly2013-01-061-1/+0
| | | | | | | | These types are either built-in or 'automatically declared' and so don't need to be explicitly declared as metatypes. Change-Id: Ifd116dee32a450ff89a9a1011e26b434765d6e95 Reviewed-by: David Faure <david.faure@kdab.com>
* Remove metatype registration of built-in types.Stephen Kelly2013-01-032-2/+0
| | | | | | | | As they are built-in, they are effectively registered at compile-time already. Change-Id: I7ae6ba16088eab5d19213fa7b07c2a7760988a86 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Fix QSqlQuery test in relation to PSQL supportAndy Shaw2012-12-222-14/+28
| | | | | | | | | Some things needed to be corrected for testing with PSQL, this was checked against the the PostgreSQL documentation to confirm that the exepected behaviour is correct. Change-Id: I45a6b343e9eb920fcae2a62910ecc956abcac0f0 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* add and use qtHaveModule() functionOswald Buddenhagen2012-12-211-1/+1
| | | | | | | | | | | this is much more elegant than the so far propagated !isEmpty(QT.foo.name). also replace feature-specific tests (no-gui and no-widgets) and the obsolete contains(QT_CONFIG, foo) syntax. Change-Id: Ia4b3c8febcabf9eeca67b1f9173a523820b1038b Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Fix some typosSergio Ahumada2012-12-211-1/+1
| | | | | Change-Id: I4e8d9bd8ea66ec810e4f1fbfd8ddbf25c4b3d980 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* SQL: Fix autotests for MinGWKai Koehne2012-12-142-0/+4
| | | | | | Change-Id: Ib05a120db16f65d9833663445c028971d4de3d29 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* SQL: Change in QSqlResultPrivate::positionalToNamedBinding()Caroline Chao2012-12-104-0/+177
| | | | | | | | | | | | | | | | | | | | | | | | With the change cff46983a, prepared queries can now store a named paramater to be used more than once. When using ?, thus positional binding, there is no named parameter, thus there is no need to store it. When prepare is called from a query with ?, it currently causes an error when the feature QSqlDriver::NamedPlaceholders is true. Because holders values are called while holders is actually empty. QSqlDriver::NamedPlaceholders is true for QOCI plugin only but the problem is independant of the plugin used. Adding a test case with a test driver to make the test runnable without Oracle installed. Change-Id: I6d7491f7e09a7b62d2d4d216b40fedd67e927e27 Reviewed-by: Matt Newell <newellm@blur.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Remove warnings from qtbase.Mitch Curtis2012-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | geometryengine.cpp: In member function 'void GeometryEngine::drawCubeGeometry(QGLShaderProgram*)': geometryengine.cpp:159:93: warning: cast to pointer from integer of different sie [-Wint-to-pointer-cast] geometryengine.cpp:167:95: warning: cast to pointer f rom integer ofdifferent size [-Wint-to-pointer-cast] benchmarking.cpp: In member function 'void TestBenchmark::multiple()': benchmarking.cpp:85:9: warning: variable 'result' set but not used [-Wunused-but-set-variable] benchmarking.cpp: In member function 'void TestBenchmark::series()': benchmarking.cpp:120:9: warning: variable 'result' set but not used [-Wunused-but-set-variable] qstandarditemmodel.cpp:2717:45: warning: unused variable 'd' [-Wunused-variable] qxcbconnection.cpp: In member function 'xcb_timestamp_t QXcbConnection::getTimestamp()': qxcbconnection.cpp:930:40: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qguiapplication.cpp: In constructor 'BlockableWindow::BlockableWindow()': tst_qguiapplication.cpp:340:9: warning:'BlockableWindow::enters' will be initialized after [-Wreorder] tst_qguia pplication.cpp:339:9: warning 'int BlockableWindow::leaves' [-Wreorder] tst_qguiapplication.cpp:342:12: waring: when initialized here [-Wreorder] tst_qsqltablemodel.cpp:570:10: warning: unused parameter 'value' [-Wunused-parameter] tst_qabstractitemview.cpp:1546:8: warning: unused parameter 'index' [-Wunused-parameter] Change-Id: I49c88547182e4669cfde2c2536403fc5573ca2da Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix error reporting in TDS SQL driver.Aaron McCarthy2012-11-181-0/+32
| | | | | | | | | | | | | | | | | | | | The error and message handlers used by the freetds library were getting reset to back to the default every time a database was opened. The Qt TDS SQL driver was calling dbinit() from QTDSDriver::open(). This had two problems: 1. dbinit() would reset the error handler previously set by a call to dberrhandle(). A db error would then cause the application to abort. 2. freetds expects dbinit() and dbexit() to be called symmetrically. Opening multiple database connections would result in freetds not cleaning up on application close. Solved by moving the dbinit() call into the QTDSDriver constructor. Change-Id: I59018d83238672c903b96a4d7f3f21b664c3ff4c Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* fix binding of bool type in mysql driverMark Brand2012-11-091-0/+35
| | | | | | | | | | | | | | | | | | MYSQL_TYPE_TINY should be used for binding bool input value. MYSQL_TYPE_LONG might be too big for bool, resulting in bools being saved in the database as int 127. The problem was not specific to the vendor's BOOL column type. http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html http://dev.mysql.com/doc/refman/5.0/en/c-api-prepared-statement-type-codes.html Added generic autotest to make sure that binding bool works. All drivers should pass this test. Task-number: QTBUG-27763 Change-Id: I4e69f8e3b32fffb702ec9fa8a80ff5c50dea954b Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* normalise signal/slot signatures [QtSql tests]Marc Mutz2012-10-193-12/+12
| | | | | Change-Id: I06573bc2ad58378dd835565cd07d711bfc760411 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlQuery::value string overloadThiago A. Correa2012-10-081-0/+1
| | | | | | | | | | Introduce value overload to take field name as a parameter. This allows for terser application code that avoids explicit calls to QSqlRecord::value(). Change-Id: I02b6712cd5ec41633b902714315b5716c17d1a9b Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableModel::selectRow(): don't expand cache if there is no changeMark Brand2012-10-052-2/+21
| | | | | | | | Test added. Change-Id: Ibd72ef2aeee482abbd22991573460e55dc577457 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: David Faure (fixes for KDE) <faure@kde.org>
* QSqlTableModel: record(row) must use virtual data()Mark Brand2012-10-051-0/+41
| | | | | | | | | | | | | | Commit fbf010a26617b3986e9a76bd9c004403aebfcdc2 introduced a version of record(row) that includes the generated flags, but it neglected to populate the values using virtual data() as QSqlQueryModel correctly does. Test included lest we forget again. Change-Id: I49d0f8f87cd0c5078aa6a0e8373b2cffc01f2387 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QSqlTableModel: restore use of virtual setData() in setRecord()Mark Brand2012-10-051-9/+48
| | | | | | | | | | | | | | | | setRecord() should use setData() as intended so that reimplementations of setData() in subclasses will be respected. Commit 11bd543d901f67f79db3f5b5dfaa626c6e8faa45 failed to consider this. Test added which should prevent this mistake being repeated. Change-Id: Ia2d930cd42b5a27521bb389edb1b07fb1bf0fa36 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableModel: don't cache unchanged value in setData()Mark Brand2012-10-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | This is good for performance in terms of avoiding unnecessary database activity and keeping the cache smaller. Detail: This change was not included in the big refactoring of QSqlTM. The idea was that the model shouldn't second guess the intention of the application and maybe the application wants to cause a submit. It was a marginal consideration. Now I think it's clear that our interest in not unnecessarily expanding the cache outweighs that. In addition, applications can now call selectRow() if they worry that the database values for the row have changed and want to set a value back again. Test added. Change-Id: I63814dcb63a96c6ba1c8cc227807725a954a0b68 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>
* QSqlTableModel: fix segfault when overriding selectRow()Mark Brand2012-10-051-0/+49
| | | | | | | | | | | | | | | | | The STL-style iteration over the cache in submitAll() assumed the iterator would remain valid until reaching cache.end(). This failed to consider that virtual selectRow() might be overridden so that it removes rows from the cache. For example, it might call select() which would empty the cache. The new approach checks at each iteration whether the row is still in the cache. Using foreach here is justified by its fitness for purpose and readability. New test included. Change-Id: Idee8807ede239c3ba56ff1604574c49f47385ad2 Reviewed-by: David Faure (fixes for KDE) <faure@kde.org>
* Remove duplicate words and punctuation from documentation.Mitch Curtis2012-09-261-1/+1
| | | | | Change-Id: I5550c62d412510bc2c5acceb2cae7d2f2ef6a8d3 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QSqlTableModel::selectRow(): fix failure on uncached rowsMark Brand2012-09-241-0/+45
| | | | | | | | | | | | | | | | | | | | This method was originally intended for refreshing rows after submitting changes. It should also work for refreshing rows that are unchanged (i.e., not cached), but did not because constructing the primary values depended on the cache. As a consequence, the WHERE clause for the query was not created. Fixed by deriving primary values for uncached rows from the query record. Note that the cache is still authoritative for rows it holds. This is important because the prmary values there may differ from the original query record due to changes to columns of the primary key. Includes new test. Change-Id: I41cca2cbf26019d4b495ffa6d876e2b55ec57803 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2212-288/+288
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Use QStringList::join(QChar) overload where applicable [QtSql]Marc Mutz2012-09-031-1/+1
| | | | | | | | | | | This is an automated change performing the following replacements: join\("(.)"\) -> join('\1') join\(QLatin1String\("(.)"\)\) -> join(QLatin1Char('\1')) join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1')) Change-Id: Ie395d82d17710683968d006d22de313ef49dc6e5 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlQueryModel: fix nested beginResetModel/endResetModelMark Brand2012-08-301-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up to 83c9ebbd6692cde99ee692e6549c591100f12545. Consider the case where calls to the reset methods on the same object are nested as in the following sequence: 1. beginResetModel() 2. beginResetModel() 3. endResetModel() 4. endResetModel() In such cases, only the outermost calls, i.e., 1) and 4), should emit signals. After 83c9ebbd6692cde99ee692e6549c591100f12545, 1) and 3) emitted the signals, which is wrong. This is corrected by keeping track of the nesting level. Such sequences can come about when a base class calls the begin/end methods between the calls made by the subclass. QSqlTableModel::select() is an example of this. Test included. Change-Id: Ia62b45cb1abaab00a32bb8357de4a958bcff83e5 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-0111-0/+11
| | | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix error when inserting to tables with datetime fields with QODBCThiago A. Correa2012-07-161-1/+27
| | | | | | | | | | | | | SQL Server 10 introduced stricter rules for TIMESTAMP validation, making it necessary to specify the decimal digits. Other databases might do the same as well, so this patch introduces a check for the TIMESTAMP column size and adjusts the decimal digits parameter as needed. Task-number: QTBUG-2192 Change-Id: If6d798c6c928ebda75bc474e49a07fbbfbe5816c Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Make sql autotests build without widgetsKent Hansen2012-06-071-0/+2
| | | | | Change-Id: Icd4d2ef39961e2e0ec5c9e910c74b3e8a35503bf Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add CONFIG+=parallel_test to suspected parallel-safe tests.Rohan McGovern2012-05-285-0/+5
| | | | | | | | | These tests have passed a parallel stress test on all three of Linux, Mac, Windows. Mark them with CONFIG+=parallel_test to allow CI to run them in parallel, saving time. Change-Id: I19fd333c3c645a67374ca998f6c8530dd236b0f8 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>