summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QSQL/ODBC: fix regression (trailing NUL)Marc Mutz2 days1-2/+2
| | | | | | | | | | | | | | | | | | | When we fixed the callers of toSQLTCHAR() to use the result's size() instead of the input's (which differ, if sizeof(SQLTCHAR) != 2), we exposed callers to the append(0), which changes the size() of the result QVLA. Callers that don't rely on NUL-termination (all?) now saw an additional training NUL. Fix by not NUL-terminating, and changing the only user of SQL_NTS to use an explicit length. Amends 4c445ef0bae8b36ec4a742552f0ebd81a1a90723 and 46af1fe49f7f419dc1b3231de9860e2da0ea48f8. Done-with: Christian Ehrlicher <ch.ehrlicher@gmx.de> Pick-to: 6.5 6.5.0 6.4 6.2 5.15 Change-Id: I6210b77e9417f46294df94cb32ab4134af8dc4c2 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* SQL/ODBC: add another check to detect unicode availability in driverChristian Ehrlicher11 days1-1/+12
| | | | | | | | | | | | | | | | | | Since ODBC does not have a direct way finding out if unicode is supported by the underlying driver the ODBC plugin does some checks. As a last resort a sql statement is executed which returns a string. But even this may fail because the select statement has no FROM part which is rejected by at least Oracle does not allow. Therefore add another query which is correct for Oracle & DB2 as a workaround. The question why the first three statements to check for unicode availability fail is still open but can't be checked since I've no access to an oracle database. Pick-to: 6.5 Fixes: QTBUG-96616 Fixes: QTBUG-102958 Change-Id: I8ec0115bbfbfc40852bcfb8e94b4b4ad3e395b37 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* SQL/ODBC: Return all native error codesChristian Ehrlicher2023-03-071-78/+76
| | | | | | | | | | | | | | ODBC can (similar to DB2) return more than one native error code for an error but only the last one was recorded which may made the error diagnostic more complicated. Therefore return a concatenated list of native error codes the way it's done for DB2. [ChangeLog][SQL][ODBC] QSqlError::errorCode() might return a semicolon separated list of native error codes. Fixes: QTBUG-45087 Change-Id: I70d02adeb33e72897f13e0c72fbbd2c60f307e2f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* SQL: small optimization for SQLDriver::escapeIdentifier()Christian Ehrlicher2023-02-281-3/+4
| | | | | | | | Avoid a memmove (and replace it with a memcpy) by not using QString::prepend() but create a completely new string object instead. Change-Id: Ibdb4a9c6b15b96f1743d47e158ff0fb9b2048221 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* SQL/ODBC: add handling for SQL_SS_TIME2Christian Ehrlicher2023-02-101-0/+6
| | | | | | | | | | MSSql Server sometimes returns SQL_SS_TIME2 instead SQL_TIME. Since this value is non-standard, we have to define it by ourself. Pick-to: 5.15 6.2 6.4 6.5 Fixes: QTBUG-109206 Change-Id: I40a4b32590d877ebfdc4b2f1d9080d8cdb2ae7a5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* ODBC/SQL: Fix usage of SQLGetDataChristian Ehrlicher2023-02-071-94/+49
| | | | | | | | | | | SQLGetData was called with a nullptr for the output buffer to determine the buffer length which is not allowed. Fix it by passing a valid buffer with a buffer size of 0. Fixes: QTBUG-70362 Fixes: QTBUG-110803 Change-Id: I4d547383100714901a4e2ca3b4777326cfab12fe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* SQL/ODBC: optimize QVarLengthArray usageChristian Ehrlicher2023-02-071-23/+16
| | | | | | | | | Optimize the QVarLengthArray usage by passing the prealloc size and directly initializing the allocated memory instead using a memset where needed. Change-Id: I61c6f9387fae63ae0c62ee1e87d3b3a7430369b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* SQL/ODBC: misc cleanup for fromSQLTCHAR()Christian Ehrlicher2023-02-071-19/+13
| | | | | | | | Change fromSQLTCHAR() to honor the fact that we know the size of SQLTCHAR during compile time. Change-Id: I1cebf2550be7228980083703e143c7577e8ad377 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* SQL/ODBC: Pass correct length to SQLColAttribute()Christian Ehrlicher2023-02-041-3/+8
| | | | | | | | | This ensures the tst_QSqlQuery::record() test passes when checking the tablename. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I146f9f627ea366c6813af61ce48b930ca1041b15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* SQL/ODBC: misc cleanupChristian Ehrlicher2023-02-041-56/+49
| | | | | | | | | | | Cleanup the codebase a little bit: - move loop variable into for scope - use utils functions instead homebrew - avoid use of const_cast<> - simplify splitTableQualifier() Change-Id: I6962f01c94a6b4e0e38ad1b229cdf6e8b3308c78 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* SQL/ODBC: optimize toSQLTCHAR() - avoid an unneeded copyChristian Ehrlicher2023-02-041-27/+16
| | | | | | | | Avoid an unneeded copy in toSQLTCHAR() when sizeof(SQLTCHAR) == 1 or 4 by directly writing the encoded data into the QVarLengthArray. Change-Id: Ic4180343764fa1ca175a9cdd444c5359d664c754 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* SQL/ODBC: fix some users of toSQLTCHAR() to not assume identical UTF-8/16/32 ↵Marc Mutz2023-02-021-71/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | string lengths We already fixed the implementation of toSQLTCHAR() in 66767eea46bea0f19f8ae5ad6ebc641d86867701 to not assume that a UTF-8 or UTF-32-encoded string has the same number of code points as the equivalent UTF-16 string, but it turns out that users of the function, as well as other code, also failed to account for this. This patch fixes callers of toSQLTCHAR() to use const auto encoded = toSQLTCHAR(s); ~~~ use encoded.data(), encoded.size() ~~~ (except we can't make `encoded` const, because the SQL API isn't const-correct and takes void* instead of const void*) instead of the anti-pattern ~~~ use toSQLTCHAR(s).data(), s.size() ~~~ As a drive-by: - Extract Method qt_string_SQLSetConnectAttr() - skipping an unneeded .utf16() call (a NUL-terminated string is not required for calling toSQLTCHAR()) - de-duplicate some code in exec() - and make a comment there slightly more informative - replace - NULL with nullptr - size() == 0 with isEmpty() - C-style with constructor-style casts Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I3696381d0a93af8861ce2b7915f212d9e5e9a243 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* ODBC SQL driver: fix conversion of QByteArray to QVLA<SQLTCHAR>Marc Mutz2023-02-011-4/+5
| | | | | | | | | | | | | | | | | | | The QByteArray is assumed to contain an SQLTCHAR string (so, either UTF-8, UTF-16 or UTF-32-encoded). Only in the UTF-8 case would the size of the byte array be the same as the size of the SQLTCHAR string in codepoints, yet the size in bytes is what the code passed to the QVLA<SQLTCHAR> append() call, causing it to read past the QByteArray buffer in the UTF-16 and UTF-32 cases. Fix by properly calculating the string size from the size-in-bytes and then memcpy()ing into the QVLA. We use memcpy() and not QVLA::append(T*, n) because the QByteArray buffer need not be aligned on an alignof(SQLTCHAR) boundary (certainly not since it gained the prepend "optimization"). Pick-to: 6.5 6.4 6.2 5.15 Change-Id: If3838c3dee89e6aca65541242642315b8e1fa6b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* ODBC SQL driver: deal with different sizes of SQLTCHAR correctlyMarc Mutz2023-01-251-14/+30
| | | | | | | | | | | | | | | | | | Neither the UTF-32, nor the UTF-8 recoding of a UTF-16 string is necessarily of the same length as the input. The UTF-32 version may be shorter, if surrogate pairs were encountered. The UTF-8 version will be longer whenever the string contains non-US-ASCII characters. Split toSQLTCHAR() into three functions, templated on sizeof(SQLTCHAR), and use QVLA's range-append instead of manual memcpy()s. This patch specifically doesn't use constexpr-if, as that's not available until C++17, which Qt 5 doesn't require. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I0bfcb66eb321598908ef00ac34c888fdbccf9316 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QODBC: fix handling NULL values for stringsChristian Ehrlicher2022-10-011-16/+11
| | | | | | | | | | | | | Qt6 added a slight behavior change in QVariant - an empty QString in a QVariant no longer results in QVariant::isNull(). This created an issue that qGetStringData() could no longer return a NULL value. On the other side, NULL values in Qt5 could not be distinguished to an empty string which we now can. Fixes: QTBUG-106607 Pick-to: 6.2 Change-Id: Iddc6f7e8b97f5abc136bbbfd02d175b80152ac90 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QODBC: correctly fill cache when index() is calledChristian Ehrlicher2022-09-281-1/+1
| | | | | | | | | | QODBCResult::isNull() incorrectly checked for the validity of the internal row cache which lead to wrong results when the requested column was not yet cached. Pick-to: 6.4 6.2 5.15 Change-Id: Ic7dcc2117e6f05b63c83f21c6a84ba7e0bda2b2d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Sql: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-191-79/+81
| | | | | | Task-number: QTBUG-98434 Change-Id: Ie12ca82fd912617eabe4f602c08914f12878cb32 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Sql: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-191-16/+16
| | | | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Change-Id: I03477e645a94948cac3e3e2abca52aa4e3e2efff Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Adapt SQL drivers to Qt 6 change of QVariant::isNullVolker Hilsheimer2022-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In Qt 5, QVariant::isNull returned true if either the variant didn't contain a value, or if the value was of a nullable type where the type's isNull member function returned true. In Qt 6, QVariant::isNull only returns true for variants that don't contain a value; if the value contained is e.g. a null-QString or QDateTime, then QVariant::isNull returns false. This change requires a follow up in the SQL drivers, which must still treat null-values the same as null-variants, lest they write data into the data base. Add a static helper to QSqlResultPrivate that implements isNull-checking of variants that contain a nullable type relevant for Sql, and add a test case to the QSqlQuery test that exercises that code. Pick-to: 6.2 6.3 Fixes: QTBUG-99408 Fixes: QTBUG-98471 Change-Id: I08b74a33aa3235c37d974f182da1f2bdcfd8217e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port some fallthrough comments to Q_FALLTHROUGHGiuseppe D'Angelo2021-06-131-2/+2
| | | | | Change-Id: I70dd492d5c8d198589bfd642db63182cf17b133f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QODBC: Preserve the whole value when using HighPrecisionAndy Shaw2021-01-141-1/+2
| | | | | | | | | | | | Some ODBC drivers do not properly handle SQL_NO_DATA and therefore decimal values returned with HighPrecision are cut off because the decimal point is not taken into account. Fixes: QTBUG-73286 Pick-to: 6.0 5.15 5.12 Change-Id: I905c947b4d0266a3245d5735300300ca00f77480 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Sql ODBC driver: add direct support for float and short datatypeChristian Ehrlicher2021-01-101-4/+49
| | | | | | | | | | | | | This patch adds native support for SQL_REAL (float) and SQL_SMALLINT (short). Previously those datatypes were mapped to double and integer. [ChangeLog][QtSql] The ODBC driver now properly maps QMetaType::Float to real sql datatype and QMetaType::Short to smallint Fixes: QTBUG-8963 Fixes: QTBUG-57279 Change-Id: Ifec4c609734dbe6165c1ebdadb461c2aae47ba78 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-12/+12
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Deprecate QVariant::TypeLars Knoll2020-10-231-37/+37
| | | | | | | | | It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-071-4/+4
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Deprecate QVariant::Type uses in QSqlFieldLars Knoll2020-08-151-29/+29
| | | | | | | | 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>
* Remove QVariant(int type, void *data, ...) constructorLars Knoll2020-08-151-2/+2
| | | | | | | | It was marked internal anyway. Use the constructor taking a QMetaType instead. Change-Id: I15b9cd0911aac063a0f0fe0352fa2c84b7f7c691 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix some MSVC int conversion warningsFriedemann Kleint2020-07-171-4/+5
| | | | | | | | | | | | | | | | | | | | | | | kernel\qmetaobjectbuilder.cpp(1279): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data kernel\qmetaobjectbuilder.cpp(1432): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data sax\qxml.cpp(1275): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data text\qfontsubset.cpp(920): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qfontsubset.cpp(920): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data text\qtextengine.cpp(2664): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2665): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2706): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2707): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data itemviews\qbsptree.cpp(60): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) kernel\qprintengine_win.cpp(1558): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data qsql_odbc.cpp(804): warning C4267: 'argument': conversion from 'size_t' to 'SQLINTEGER', possible loss of data qsql_odbc.cpp(822): warning C4267: 'argument': conversion from 'size_t' to 'SQLINTEGER', possible loss of data qsql_odbc.cpp(1585): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data qsql_odbc.cpp(1602): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data qwindowsmime.cpp(770): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data windows\qwindowsmime.cpp(770): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data Change-Id: I04fbe17b9782f4c2704933fc005449b1e992475e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QList instead of QVector in pluginsJarek Kobus2020-07-061-6/+6
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic86f4a3000592a1c9ae62e4a83f4fe39832a6b24 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Sweep of int-ish → char-ish types near calls to QString::fromU*()Marc Mutz2020-05-121-2/+2
| | | | | | | | | | | | The fromUtf16(ushort*) and fromUcs4(uint*) overloads are going to be deprecated. Use the newer fromUtf16(char16_t*) and fromUcs4(char32_t*) overloads. As a drive-by, use std::end()/std::size() where applicable. Change-Id: I5a93e38cae4a2e33d49c90d06c5f14f7cb7ce90c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix warning in qsql_odbc.cpp when building with MSVC2017Mitch Curtis2020-03-201-1/+1
| | | | | | | | qsql_odbc.cpp(1589): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data Change-Id: Ib36fda3e3b21bdbc8b343ae5136542dfcf3c1065 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use qsizetype for size related methods in QVarlengthArrayLars Knoll2020-03-141-2/+2
| | | | | Change-Id: Ib94b9a4e6e17da21f592e71a36fd1b97d42dfe62 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-111-1/+1
|\ | | | | | | Change-Id: Ibee5acec72a1a1769d4bc5f23f56c7dc8d4cf3cb
| * QtSql/ODBC: allow table names with unicode charsChristian Ehrlicher2020-03-071-1/+1
| | | | | | | | | | | | | | | | | | The ODBC driver did not properly decode table names with unicode chars. Fix it by explicitly passing the unicode flag to qGetStringData(). Fixes: QTBUG-82401 Change-Id: Id6eb44cc85ce196ea97d0d6aef1cd573fa033970 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-031-1/+1
|\ \ | |/ | | | | Change-Id: If36d96c0fef3de5ab6503977501c55c62a2ecc97
| * SQL: Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-281-1/+1
| | | | | | | | | | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: Ia4c698df60648c85c8e6132641e5ea7bc553129a Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-261-41/+35
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/bearermonitor/CMakeLists.txt examples/network/CMakeLists.txt src/corelib/tools/qlinkedlist.h src/sql/kernel/qsqldriver_p.h src/sql/kernel/qsqlresult_p.h src/widgets/kernel/qwidget.cpp src/widgets/kernel/qwidget_p.h tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/tools/moc/allmocs_baseline_in.json Change-Id: I21a3c34570ae79ea9d30107fae71759d7eac17d9
| * QtSql: cleanup QSqlDriverPrivate and QSqlResultPrivateChristian Ehrlicher2020-02-191-41/+35
| | | | | | | | | | | | | | | | Cleanup QSqlDriverPrivate/QSqlResultPrivate and their derived classes in ODBC, MySql, PostgreSQL and SQLite. Change-Id: I52e69c00cf981b81dde7c3a0370f86f06ef756bb Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | QtSql: remove compat SQL plugin namesChristian Ehrlicher2020-02-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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 wip/cmakeAlexandru Croitor2020-01-291-3/+3
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: src/corelib/Qt5CoreConfigExtras.cmake.in src/corelib/Qt5CoreMacros.cmake src/dbus/Qt5DBusConfigExtras.cmake.in src/widgets/Qt5WidgetsConfigExtras.cmake.in Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
| * Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-191-5/+5
|\ \ | |/ | | | | Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
| * QODBC: Fix crash when a prepared statement is deleted after the db was removedChristian Ehrlicher2019-10-151-5/+5
| | | | | | | | | | | | | | | | | | | | 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 commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-161-1/+1
|\ \ | |/ | | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
| * Fix a couple of unused QStringsSergio Martins2018-12-101-1/+1
| | | | | | | | | | | | | | | | | | This is needed so we can add Q_WARN_UNUSED to QString. The xcb one might even be a bug. Change-Id: Ia2d2563bdd10aa747014410df4990597969f4634 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Fix Windows buildAlexandru Croitor2019-03-181-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | - Fix qmake build - Fix QtNetwork moc-ing, by including the moc files inside the cpp files - Fix sql odbc plugin by including QT_PLUGIN define - Fix Boostrap to link against the Platform target, to get the correct Unicode and WIN64 defines. - Fix vulkan headers to be found - Fix freetype bzip and png unresolved symbols / linker issues when building minimal platform plugin (also need to make sure to use the vcpkg toolchain instead of CMAKE_PREFIX_PATH because then find_package is overridden, which does magic to properly propagate static library dependencies). - Fix qfilesystementry test not to be built without private tests feature (it led to undefined symbols issues). - Make sure to remove QT_NO_CAST_TO_ASCII define when building QtCore, so that the qstringbuilder3 test builds successfully. Task-number: QTBUG-74140 Change-Id: I353d08392b604d55f8e62cdd8696d1e19a3c084a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* ODBC: Correctly check if the field is within the fieldCache rangeAndy Shaw2018-09-131-1/+1
| | | | | | | | | This was found while running the ODBC tests. tst_QSqlQuery::isNull() accounts for this already. Change-Id: Idf99a85396d7aa4e69b89467f873b105ef946f7f Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* ODBC: Remove the trailing \0 in the case of a non unicode stringAndy Shaw2018-09-111-3/+6
| | | | | | | | | | | | | | Some ODBC drivers, such as old Informix ODBC drivers will incorrectly include a trailing \0 in a string when this should not exist. For unicode strings this was already accounted for, but for non-unicode ones this was not covered. The change also fixes up the comments a bit to make this clearer and also added one for the unicode case. Task-number: QTBUG-62406 Change-Id: Id932a58d9e5fdff2f4d1aacf8cc9fdaeb34f95f4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* SQL plugins: Fix warnings about deprecated constructor of QSqlErrorFriedemann Kleint2018-01-101-2/+4
| | | | | | | | Use the constructor taking a string and convert number unless it is -1. Change-Id: I18d1ba2c8e0d3f4af01b7955863967f75051746b Reviewed-by: Andy Shaw <andy.shaw@qt.io>