qt5base-lts/tests/auto/sql/kernel
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
..
qsql tst_qsql.cpp: Remove deprecated module include 2016-11-25 09:55:21 +00:00
qsqldatabase sqlite: Fix QSqlError handling when opening/closing database 2018-09-13 18:18:47 +00:00
qsqldriver OCI: Match the constraints on the index_name column 2017-11-15 06:40:45 +00:00
qsqlerror Add move special member functions to QSqlError 2017-04-28 12:50:34 +00:00
qsqlfield QSqlField: Add a means to see what the tablename is for a given field 2017-07-12 09:01:50 +00:00
qsqlquery Remove a reference to a no longer used database server 2018-05-16 14:40:19 +00:00
qsqlrecord QSqlField: Add a means to see what the tablename is for a given field 2017-07-12 09:01:50 +00:00
qsqlresult Updated license headers 2016-01-21 18:55:18 +00:00
qsqlthread Fix invalid placeholder name in tst_qsqlthread.cpp 2017-08-23 12:48:32 +00:00
kernel.pro SQL: Change in QSqlResultPrivate::positionalToNamedBinding() 2012-12-10 21:23:35 +01:00