Commit Graph

244 Commits

Author SHA1 Message Date
Qt Forward Merge Bot
375efdd0e1 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iebedaa967a263854f18cd403ce007d7965f26d2b
2019-10-25 01:00:16 +02:00
Qt Forward Merge Bot
b327807c5e Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/io/qstandardpaths_unix.cpp
	src/corelib/tools/qsharedpointer_impl.h
	tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp

Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
2019-10-24 10:23:44 +02:00
Qt Forward Merge Bot
dce8849037 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I4fbbf100b673ab100997dbf2f42bf195dc3c050f
2019-10-18 01:00:35 +02:00
Christian Ehrlicher
78d349eaab tst_QSqlQuery: remove tests commented out a long time ago
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>
2019-10-16 08:25:38 +02:00
Christian Ehrlicher
ed7dd9a6ed QODBC: Fix crash when a prepared statement is deleted after the db was removed
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>
2019-10-15 13:37:42 +02:00
Christian Ehrlicher
b43f5ed2da QMYSQL: remove support for MySql 4.x
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>
2019-10-12 08:31:01 +02:00
Christian Ehrlicher
aa6d7dd7ee QSqlDriver: deprecate one-arg notification() signal
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>
2019-09-21 08:13:59 +02:00
Samuel Gaist
889b1c4b28 test: migrate QSqlDatabase test to QRegularExpression
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>
2019-07-29 20:01:24 +02:00
Sona Kurazyan
b6f7efba48 Make sql tests build and pass with disabled deprecated APIs
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>
2019-07-23 20:48:44 +02:00
Giuseppe D'Angelo
34fe9232db Port from QAtomic::load() to loadRelaxed()
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>
2019-06-20 20:48:59 +02:00
Edward Welbourne
84e89c1e9e Convert uses of QTime as a timer to QElapsedTimer
Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-14 10:42:33 +02:00
Qt Forward Merge Bot
0c0c4a23bc Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I830beea26863323ab78a5d4b093f7763d77ad3da
2019-02-21 01:00:08 +01:00
Andy Shaw
4c75934008 Fix a couple of SQL tests
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>
2019-02-19 11:00:19 +00:00
Liang Qi
fbfacd33be Merge remote-tracking branch 'origin/5.12' into 5.13
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
2019-02-08 12:31:02 +01:00
Jesus Fernandez
9501e92841 Replace executedQuery when executing a new query
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>
2019-01-30 23:08:04 +00:00
Andy Shaw
461ef575bc Always escape the table names when creating the SQL statement
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>
2019-01-23 20:07:09 +00:00
Andy Shaw
f03941e411 Add overload of QSqlDatabase::cloneDatabase to allow cloning cross threads
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>
2018-12-23 11:41:36 +00:00
Qt Forward Merge Bot
290aac23a7 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Id1e4664d3c942226b76e2c3b338df3116ff89297
2018-11-06 01:00:56 +01:00
Christian Ehrlicher
2b682972c2 QSqlQuery: add another testcase for bindBool()
tst_QSqlQuery::bindBool() did not check if the bool is correctly bound
as part of the WHERE statement. Add a new test to query for the bool
column and check if there is exactly one row returned.

Fixes: QTBUG-38891
Change-Id: I0bd1ceb1b30e50f67f44f5b06d68683195b78b29
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-11-02 08:27:12 +00:00
Christian Ehrlicher
f46c9f67ba SQLite: enable json1 extension
This patch enabled json1 support for sqlite3 by defining
SQLITE_ENABLE_JSON1

[ChangeLog][QtSql][SQLite] Enable the json1-extension for
the SQLite3 plugin

Task-number: QTBUG-63498
Change-Id: Iaf1069ff1396c573125a5a3f490c0df5df560468
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-10-03 19:36:26 +00:00
Qt Forward Merge Bot
42f84de26a Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Ic4c1a8041dcfd143861c39e0014fbdaaa3fb25c6
2018-09-14 01:00:08 +02:00
Florian Bruhin
49efea26a5 sqlite: Fix QSqlError handling when opening/closing database
Both sqlite3_open_v2 and sqlite3_close are documented to return an error code:
https://www.sqlite.org/c3ref/open.html https://sqlite.org/c3ref/close.html

However, those were ignored (other than checking whether the operation
succeeded), causing QSqlError::nativeErrorCode() to always be "-1" when there
was an error while opening/closing the database.

Additionally, the error string needs to be read (via sqlite3_errmsg16) in
qMakeError *before* d->access is set to 0, or the databaseText() will always be
"out of memory" no matter what error actually happened.

Task-number: QTBUG-70506
Change-Id: I75cbf178c9711442e640afd26c4502214d20c598
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-13 18:18:47 +00:00
Christian Ehrlicher
0d1481b4d2 SQL PostgreSQL/SQlite: Properly decode default varchar parameter
The default values for varchar columns were not decoded properly.

Task-number: QTBUG-46968
Change-Id: Ie13d48c316cd694240f7e287010b97afc8c6c341
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-09-12 09:11:04 +00:00
Andy Shaw
28702cb239 Initialize the QSqlQuery to be invalid when creating a sql model
When QSqlQueryModel or QSqlTableModel is created it will create a
QSqlQuery which defaults to using the default QSqlDatabase connection.

If this connection belongs to another thread then it will throw a
warning as this is not safe to use. Since the QSqlQuery is always
recreated when a query is set, the instance which is a member of
the class can effectively be invalid until a new one is set.

Task-number: QTBUG-69213
Change-Id: I68a5dd59fe62788f531d59a0680da11b118ee383
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-28 16:10:30 +00:00
Oswald Buddenhagen
99c3ef0789 prune cargo-culted and obsolete winsock deps from autotests
Change-Id: I9666598d34e965d7058aeb2b2e7fb3f59600675c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-07-19 13:31:08 +00:00
Edward Welbourne
2afa6e5f94 tst_QSqlThread: match #if-ery on declaration to use
Variable was declared outside #if-ery but only used inside,
leading to warnings when the define wasn't set.

Change-Id: Iad6a236bdf76b8ca0a58a84509d19f7e1a3e2df2
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-07-05 13:39:02 +00:00
Andy Shaw
ae42461f44 MySQL: Handle TIME types as a string to allow the full range of data
As the full range of TIME is '-838:59:59' to '838:59:59' then we cannot
use QTime as the object to store this data in. Therefore a QString is
used instead for passing the data to and from. This does not impact
existing code using QTime already as it will still convert it from
the QString to a QTime to give the same result as before.

[ChangeLog][QtSql][MySQL] The TIME data type is now treated like a
string-based type in order to respect the full range of the TIME data
type.

Task-number: QTBUG-57028
Change-Id: Ieb7105bff3043b845f76bc873d088e6bac1e4f10
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-06 11:14:03 +00:00
Andy Shaw
b92db8a4ad Show the display role inside the editor for the relation in a QComboBox
When a QComboBox is used as the editor for a relation inside a view then
it could end up showing the contents of the EditRole. This would be the
field which is used to represent the entry as opposed to the DisplayRole
which is what the user would expect to see is.

Therefore, setEditorData() is overridden to ensure that it is showing
the right data to the user. When the model gets updated, it will take the
corresponding EditRole value as before to ensure it is updated correctly.

Task-number: QTBUG-59632
Change-Id: Ibbccc3e9477de1cdefb654051b97dd111df36382
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-05-29 22:08:28 +00:00
Andy Shaw
fce6303a35 Remove a reference to a no longer used database server
Task-number: QTBUG-32390
Change-Id: I7556507267be04ca50c4ad0c7d49f3aa5fe31a90
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-05-16 14:40:19 +00:00
Andy Shaw
b0f3cc1594 sqlite: Allow for duplicated placeholders with just one placeholder
This accounts for a case of a placeholder being duplicated in the
prepare query, but where only one placeholder was used. This amends
e4e87a2ece

Task-number: QTBUG-68299
Change-Id: Ia92ee912facd51a13e7222886debb219b24442b0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-05-16 11:42:25 +00:00
Andy Shaw
ec23d96c86 oci: Use OCIBindByPos2 to accommodate data longer than USHRT_MAX
OCIBindByPos2 is only needed when using execBatch(), binding data that
is longer than USHRT_MAX works for exec() so this is left unchanged.

Change-Id: Ifdcf91939d184f225d24c13052ea0b81611ecf91
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-06 12:44:37 +00:00
David Faure
e729ac6dc5 QSqlDatabase: Skip confusing thread warning on invalid QSqlDatabase
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>
2018-04-06 07:18:03 +00:00
Andy Shaw
7775eb248a sqlite: Support using execBatch() with duplicated named placeholders
Also expands the tst_qsqlquery::batchExec() test to account for this
case and generally test the functionality. In addition it is made to be
more robust to avoid any discrepencies with the testing data. The test
in general is also cleaned up to enable more of it being tested with
the different database drivers where possible.

An expected fail is added for MySQL due to the fact that it has a bug
where null timestamp entries are being converted to the current
datetime when adding it as a bind value.

Change-Id: I0061bd1c69ae35b4858afc49420f13ce59cf48ae
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-03-27 16:50:19 +00:00
Andy Shaw
9b68dc19bf MySQL: Fix tests
This fixes the following:
  - tst_QSqlDatabase::recordMySQL() to account for performance
    improvements done for small integral types
  - tst_QSqlQuery::nextResult() so that NUMERIC results are seen
    as doubles
  - tst_QSqlQuery::timeStampParsing() so that MySQL accepts the
    CREATE TABLE statement

Change-Id: I68fb1d06dac12d500bb4596463f5bdd65cc9c226
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-03-17 23:14:34 +00:00
Andy Shaw
e4e87a2ece sqlite: Prevent a crash when sqlite does not detect any parameters
When using a virtual table inside a SQLite database it is possible that
it does not report the right number of parameters. Therefore we need
to account for this case to prevent it from crashing when trying to
bind parameters it thinks does not exist.

Task-number: QTBUG-66816
Change-Id: I3ff70bb1fe73091f43c3df53616f75858e451cfd
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-03-17 23:14:14 +00:00
Christian Ehrlicher
3185b40d5d SQL/Postgres: Fix support for nan, inf and -inf
Postgresql needs a special value for nan and +/- inf. This was
considered during insert but not during select.
Also remove some pre-c++11 inf/nan - handling and replace it with
Qt equivalents.

Change-Id: I044ca58e9cf673f4b100b05a0d8e25c8a9c29ec5
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-07 18:35:57 +00:00
Andy Shaw
8635ad1b59 psql: Add expected failures where the table name is case sensitive
Currently there is a bug in Qt regarding the PostgreSQL driver as it
does not correctly escape the table names when constructing queries
internally. Therefore, these tests are marked as expected failures until
the bug itself is fixed in Qt.

Change-Id: I74dadc187f8a08509128dfea27be99787e57ea51
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-21 07:07:26 +00:00
Andy Shaw
a245c312b8 psql: Fix SQL tests
This also accounts for some quirks on the PostgreSQL side:
 - Null values for a related table are placed in a different
   order when sorted.
 - Functions (sum, count) return a different type than other databases
 - Using quotes to account for case sensitivity with tables

Task-number: QTBUG-63861
Change-Id: Ib1894fa8d0c77d7045941f7c57be0d0acd8d117e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-20 15:20:54 +00:00
Liang Qi
48577b2e7f Merge remote-tracking branch 'origin/5.10.1' into 5.11
Conflicts:
	src/plugins/sqldrivers/psql/qsql_psql.cpp

Change-Id: I070b455078b41e75c46562fcea5676d6218cd00c
2018-02-19 16:02:52 +01:00
Andy Shaw
6c6ace9d23 psql: Improve performance of record()
In order to save having to always run a query to get the tablename for
a known oid then we cache the result on the driver side. The oid stays
the same while the table exists, so only on dropping it would it change.
Recreating the table causes it to get a new oid, so there is no risk of
the old one being associated with the wrong table when this happens, if
the driver is still open at that point.

The benchmark added shows the improvement from the previous code, before
the results for PostgreSQL was:

RESULT : tst_QSqlRecord::benchmarkRecord():"0_QPSQL@localhost":
     259 msecs per iteration (total: 259, iterations: 1)

whereas now it is:

RESULT : tst_QSqlRecord::benchmarkRecord():"0_QPSQL@localhost":
     0.000014 msecs per iteration (total: 59, iterations: 4194304)

Task-number: QTBUG-65226
Change-Id: Ic290cff719102743da84e2044cd23e540f20c96c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-08 18:24:48 +00:00
Andy Shaw
e4fc098a53 Make it easier to specify test databases on a per system level
Instead of having to modify the tst_databases.h file whenever you want
to add a test database, this will now read from a file to find what
databases are available. This defaults to dbs.json in the same directory
or the QT_TEST_DATABASES_FILE environment variable can be set to point
to the file that contains the databases. The latter makes it easier for
CI then to have something set up on a per configuration basis.

The SQLite database stays hardcoded so this will continue to be tested as
before without any additional changes.

Change-Id: I7e7ccde6a6be3e490dd640b1590e3b691a6b2ab3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-26 11:33:07 +00:00
Liang Qi
f4d8cafc1b Merge remote-tracking branch 'origin/5.10' into dev
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
2018-01-11 18:10:41 +01:00
Andy Shaw
3e58f2b090 sqlite: Bind duplicated named placeholders correctly
sqlite will reuse the index for bound parameters when the named
placeholder is duplicated so we only need to call bind one time for each
placeholder. Therefore we need to have just one instance of each value
when doing the bind.

Task-number: QTBUG-65150
Change-Id: I75c4bcc4563e43c180a59a7a4cbb770dbe994642
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-01-08 10:13:10 +00:00
Robert Szefner
6d0c8825f9 QPSQL: Add support for multiple result sets
This change adds support for multiple result sets in PostgreSQL.

[Important Behavior Changes] The QPSQL driver now supports multiple
result sets. Since QPSQL previously did not support multiple result
sets, there may be some compatibility issues with the existing code
that executed several queries as one and were expecting to get
the results of the last one. In this case use QSqlQuery::nextResult()
to move to the last result set.

[ChangeLog][QtSql][QPSQL] Added support for multiple result sets

Change-Id: I2bfc91f512c4dac83116f3aa42833839a6da084c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-08 09:10:10 +00:00
Robert Szefner
f99d2b21b8 QPSQL: Add support for forward-only queries
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>
2018-01-06 08:24:32 +00:00
Andy Shaw
fa1397882a Test calling setRelation() with QSqlRelation() clears the relation
Change-Id: I93dbec54bfb9402b9044323862c2ae1d41e1790a
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-01-02 08:50:54 +00:00
Andy Shaw
9b361f0e90 Return an invalid QSqlDatabase when accessing from another thread
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>
2018-01-02 08:49:40 +00:00
Andy Shaw
c4ba2b1c70 Copy the numericalPrecisionPolicy when copying the QSqlDatabase
As the numercialPrecisionPolicy can be set and subsequently retrieved
from the QSqlDatabase's driver, then when copying the QSqlDatabase, we
need to set that appropriately too.

Task-number: QTBUG-10452
Change-Id: I2c63748365ab4e9fbc29d8d460d80d2e2a0ee385
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-01 10:52:44 +00:00
Andy Shaw
33b03d99cd Remove code that refers to PostgreSQL 7.2 or older
We haven't had support for anything older than 7.3 for a long time, so
this removes the code to save having to maintain it any further.

Task-number: QTBUG-644
Change-Id: If0635f3bef5138a00a0e77011a70f23d0bffda32
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-01 10:52:32 +00:00
Liang Qi
153e8b49ad Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/network/access/qhttp2protocolhandler_p.h
	src/network/kernel/kernel.pri
	src/network/ssl/qsslkey_qt.cpp
	src/plugins/platforms/cocoa/qcocoascreen.mm
	src/plugins/platforms/windows/accessible/iaccessible2.cpp
	src/plugins/platforms/windows/accessible/iaccessible2.h
	src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
	src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
	src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h
	src/widgets/widgets/qmenu_p.h
	tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/auto/other/qaccessibility/tst_qaccessibility.cpp
	tests/auto/testlib/selftests/expected_cmptest.lightxml
	tests/auto/testlib/selftests/expected_cmptest.teamcity
	tests/auto/testlib/selftests/expected_cmptest.txt
	tests/auto/testlib/selftests/expected_cmptest.xml

Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9
2017-11-23 09:36:03 +01:00