summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers
Commit message (Collapse)AuthorAgeFilesLines
...
* SQL/IBase: code cleanup part 4/5Christian Ehrlicher2024-06-071-24/+20
| | | | | | | | | Make sure that QByteArray does not detach when not needed and avoid some copies by using QByteArray::fromRawData(). Pick-to: 6.8 Change-Id: I4454a3113c6bd1fe30b404af091f5cc0f904f78a Reviewed-by: Axel Spoerl <[email protected]>
* SQL/IBase: code cleanup part 3/5Christian Ehrlicher2024-06-071-12/+15
| | | | | | | | Pass 'const char *' when the string doesn't get modified. Pick-to: 6.8 Change-Id: I8b2e06b027362debcd81282dc3123235a7e643a3 Reviewed-by: Axel Spoerl <[email protected]>
* SQL/IBase: code cleanup part 2/5Christian Ehrlicher2024-06-071-7/+10
| | | | | | | | | | The lower bit of the sqltype is used to express NULL values and needs therefore masked out. Do this before the acutal operations for better readability/debugability. Pick-to: 6.8 Change-Id: I71ee97f4c38241ccc9804562e2826ce9b53567ba Reviewed-by: Axel Spoerl <[email protected]>
* SQL/IBase: code cleanup part 1/5Christian Ehrlicher2024-06-071-58/+60
| | | | | | | | | | Cleanup the code by replacing repeated access to sqlda->sqlvar[] with a temporary (const) ref to enhance readability and avoid repeated lookups. Pick-to: 6.8 Change-Id: I716812f4446bac7fb3e92bc6fbb099845836624f Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Andreas Bacher <[email protected]>
* SQL/IBase: cache return value of record()Christian Ehrlicher2024-06-051-6/+9
| | | | | | | | | Cache the return value of QIBaseResult::record() to avoid the recreation (e.g. when using QSqlQuery::value(QString) instead index-based ones). Pick-to: 6.8 Change-Id: I88568d99ba96e19ae6b661d058e7709ebc5ef2a2 Reviewed-by: Axel Spoerl <[email protected]>
* SQL/IBase use QT_USE_MSVC_INT128Christian Ehrlicher2024-06-051-1/+1
| | | | | | | | | | ... instead Q_CC_MSVC to be in sync with qlocale_tools_p.h and avoid compiler erros when used with msvc versions not providing int128 support. Pick-to: 6.8 Change-Id: Ia2166a6260a9340a5e5bbca3f46c3b77a9f8d50d Reviewed-by: Axel Spoerl <[email protected]>
* Logging: Add a macro for static logging categoryUlf Hermann2024-06-052-2/+2
| | | | | | | | | | | | Since name clashes between logging categories are so common, having a way to explicitly avoid them is important. So far, we are depending on internals of Q_LOGGING_CATEGORY to place the "static" in the right location. That's less than ideal. Task-number: QTBUG-67692 Change-Id: Ifeda5297d1d1220a57118b3bf7c7310e4ddd4f93 Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* SQL/IBase: add partial support for SQL_INT128 datatypeChristian Ehrlicher2024-06-051-0/+4
| | | | | | | | | | | | The previous patch missed the handling of SQL_INT128 in qIBaseTypeName2(). This amends 373ae6cbd24cf0ddbed453e14b1f683e76c92bb5 Pick-to: 6.8 Change-Id: I646bd5af23c14761195f9c1089dc4cbbe2e94790 Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Andreas Bacher <[email protected]>
* Bump version to 6.9.0Jani Heikkinen2024-06-051-1/+1
| | | | | Change-Id: I6a6f4d4e4c2e4fa8b83078ee5864cc923265ac2e Reviewed-by: Edward Welbourne <[email protected]>
* SQL/IBase: add partial support for SQL_INT128 datatypeChristian Ehrlicher2024-05-251-21/+71
| | | | | | | | | | | | | | | | Implement partial support for SQL_INT128 datatype which is used for DECIMAL/NUMERIC columns with a precision > 18. This support is only available when QT_SUPPORTS_INT128 is defined and for MSVC. Binding values to columns which need SQL_INT128 is supported but numbers given as QString will be converted to doubles even if QSql::HighPrecision is set. [ChangeLog][SQL][IBASE] Added support for SQL_INT128 datatype. Task-number: QTBUG-124575 Change-Id: If3fb1eb0f19dc60f000d163f3bf45da7acb08c87 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Andreas Bacher <[email protected]>
* SQL/IBase: factor out setting numeric valuesChristian Ehrlicher2024-05-251-20/+17
| | | | | | | Factor out setting numeric values for better readability. Change-Id: I8980c63e87934e3bc3777897e9cd42aef17caf51 Reviewed-by: Thiago Macieira <[email protected]>
* SQL/IBase: don't let open() fail when no timezones are availableChristian Ehrlicher2024-05-231-11/+4
| | | | | | | | | | | | When connecting to an old Firebird instence with a Qt Firebird plugin linked against Firebird >= 4 the timezone table is not available and therefore open() will fail. Therefore downgrade the non-existence of this table to a qCInfo(). Fixes: QTBUG-125467 Change-Id: Iae6d110bc2a48b5b90ffb9cb38f3fba60f30770f Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Andreas Bacher <[email protected]>
* QSql/IBase: fix compilationChristian Ehrlicher2024-05-021-0/+1
| | | | | | | | Looks like the CI does not compile the IBase/Firebird plugin so this compile error slipped through. Change-Id: I2e20088e10baa91f2e1e5e2b5656dfb7bdf42896 Reviewed-by: Samuel Gaist <[email protected]>
* SQL/IBase: factor out applying decimal scale into own functionChristian Ehrlicher2024-04-271-37/+51
| | | | | | | | Move the calculation of the decimal scale into own function and preserve HighPrecision string values by not converting them into doubles before. Change-Id: I839923189e9f6b1f8fb9ce234c987423703b79bf Reviewed-by: Axel Spoerl <[email protected]>
* SQL/IBase: print warning in case of unsupported data typeChristian Ehrlicher2024-04-261-1/+6
| | | | | | | | Print a warning when we encounter an unsupported data type. Pick-to: 6.7 6.5 Change-Id: If35ac4dfdf29e555ec406f592c1001b5e16f8ff2 Reviewed-by: Axel Spoerl <[email protected]>
* SQL/ODBC: convert QVariant to QDateTime only onceChristian Ehrlicher2024-04-121-3/+4
| | | | | | | | ... instead three times in a row. Pick-to: 6.7 Change-Id: If08b4c092cfb5b7d224f9a94afb7d395ce2b2eca Reviewed-by: Axel Spoerl <[email protected]>
* SQL/IBase: use categorized loggerChristian Ehrlicher2024-04-121-20/+23
| | | | | | | Use the categorized logger qt.sql.ibase Change-Id: Id7cdc54b8b01ee5af0526e3c522c2511697380d3 Reviewed-by: Axel Spoerl <[email protected]>
* SQL/OCI: use categorized loggerChristian Ehrlicher2024-04-121-40/+38
| | | | | | | Use the categorized logger qt.sql.oci Change-Id: Ib143cfa3136a7382adbabfe4bc421b94e2a25bda Reviewed-by: Axel Spoerl <[email protected]>
* SQL/Mimer: use categorized loggerChristian Ehrlicher2024-04-121-3/+6
| | | | | | | | Use the categorized logger qt.sql.mimer Change-Id: I1b0d149a1a6317eec3b821dee99d952ef1000c28 Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Fredrik Ålund <[email protected]>
* SQL/ODBC: Don't allow default argument for SqlStmtHandleChristian Ehrlicher2024-04-121-1/+1
| | | | | | | | | To avoid usage errors like fixed with 7e5a0b54f0737986b6716bfce0a43eba2e62aae0 Pick-to: 6.7 Change-Id: I33af9721a04e80541c027fa6da8630070a5957ac Reviewed-by: Axel Spoerl <[email protected]>
* QOCICols: fix warning for -Wdangling-referenceDennis Oberst2024-04-111-1/+1
| | | | | | | | .. by playing it safe and taking the QVariant by copy Pick-to: 6.7 6.5 Change-Id: I24e0507a912388b7fb17e838a22e8d4c449bcf5b Reviewed-by: Volker Hilsheimer <[email protected]>
* SQL/ODBC: QODBCDriver::record Unable to allocate handleMark Brand2024-04-051-1/+1
| | | | | | | | | Seems to have been left out by 874f5c1f463cad61f49e0ff7007852a73fd93e7c Pick-to: 6.7 Fixes: QTBUG-123478 Change-Id: Ic028c3786203cbc1c3d7316c1ae22c12a928b170 Reviewed-by: Christian Ehrlicher <[email protected]>
* SQL/ODBC: don't escape a driver stringChristian Ehrlicher2024-04-041-1/+1
| | | | | | | | | | | We must not try to escape a driver string, the user has to make sure that everything is correctly escaped when passing a complete driver string. This fixes a regression from QTBUG-122642. Pick-to: 6.7 Fixes: QTBUG-123444 Change-Id: I43316c7a09060f5c8117fdc3c464d239e37d9cdf Reviewed-by: Mark Brand <[email protected]>
* SQL/ODBC: don't create temporary QStringsChristian Ehrlicher2024-04-041-37/+35
| | | | | | | | | | | | | | ... but use QStringView instead in setConnectionOptions() and the dependent functions. Also remove the (undocumented) ability to pass the connection options in non-uppercase - this was never supported and all other plugins don't support this either. [ChangeLog][SQL][ODBC] All options must now be upper-cased as documented. Lower-cased options are no longer supported. Change-Id: I822db1ddf205c22fe939299c4ab741bbe9b56d65 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Axel Spoerl <[email protected]>
* SQL/SQLite: use categorized loggerChristian Ehrlicher2024-04-041-6/+11
| | | | | | | Use the categorized logger qt.sql.sqlite Change-Id: I70880fca579df56500ddc94a72bc6c616c475e67 Reviewed-by: Axel Spoerl <[email protected]>
* SQL/MySQL: use categorized loggerChristian Ehrlicher2024-04-041-18/+27
| | | | | | | Use the categorized logger qt.sql.mysql Change-Id: I7e6529025dceb81c47571c65b7aea9bd274814e2 Reviewed-by: Axel Spoerl <[email protected]>
* SQL/ODBC: use categorized loggerChristian Ehrlicher2024-04-041-2/+5
| | | | | | | Use the categorized logger qt.sql.odbc Change-Id: I1411e80fa33582857bafdf77baee75b293df56af Reviewed-by: Axel Spoerl <[email protected]>
* Invalid cast when setting parameter index in MimerGet/SetXXXFredrik Ålund2024-04-031-22/+22
| | | | | | | | Change the invalid static_cast<std::int16_t>(i)+1 to the correct static_cast<std::int16_t>(i+1). Change-Id: I5d3e17d29deb2a70fa0d7d7838531a3dc80b4e45 Reviewed-by: Giuseppe D'Angelo <[email protected]>
* Fix data() with long datatype for Mimer SQLFredrik Ålund2024-04-031-1/+1
| | | | | | | | | | | Calling data() for parameters of the type bigint failed in combination with stored procedures with output parameters. Cast the result to qlonglong to fix it. Pick-to: 6.7 6.6 Change-Id: I84ef04ed26821b92ef7c5bcdf12b778e91450e0b Reviewed-by: Giuseppe D'Angelo <[email protected]>
* configure: Fix -system-zlib and -system-sqlite optionsJoerg Bornemann2024-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These options are declared with TYPE enum and a MAPPING that's supposed to control the feature 'system-zlib' or 'system-sqlite'. Since only inputs of type boolean control features now, we need to somehow declare that this non-boolean input controls a feature. We do this by adding the keyword CONTROLS_FEATURE to qt_commandline_option. For example, qt_commandline_option(zlib CONTROLS_FEATURE TYPE enum NAME system-zlib MAPPING system yes qt no ) declares - commandline option "zlib" sets the input "system-zlib", because of the "NAME system-zlib" argument - accepted input values are "system" and "qt", because we have "TYPE enum" and the odd values of MAPPING - those values are translated to yes/no, because of the even values of MAPPING - CONTROLS_FEATURE forces the translated input's type to boolean, and with that it will set the corresponding feature 'system-zlib' Luckily, only qtbase has command line options with MAPPING declared. Change-Id: I82d06cec43ece3b002c8f5dd414c68dc730909af Reviewed-by: Alexandru Croitor <[email protected]>
* SQL/PostgreSQL: use categorized loggerChristian Ehrlicher2024-03-161-22/+26
| | | | | | | Use the categorized logger qt.sql.postgresql Change-Id: I480346cadb879c22874f0af92d6e05d513f25b48 Reviewed-by: Thiago Macieira <[email protected]>
* SQL/PostgreSQL: Make sure the server returns datetime in UTCChristian Ehrlicher2024-03-161-3/+17
| | | | | | | | | | | | | | | | The postgresql server by default returns the datetime in it's local timezone. This works as long as this is the same as on the client. If they are different, the parsing is going wrong.. Therefore let the server return the datetime in UTC. Also do not convert the datetime into local time to be in sync with the MySQL plugin. [ChangeLog][SQL][PostgreSQL] Fixed a bug where a wrong QDateTime might be returned when the PostgreSQL server and the Qt client had different time zones configured. Fixes: QTBUG-115960 Change-Id: I1a6dda69359a34b99ef399b2a54f35c8ba041326 Reviewed-by: Thiago Macieira <[email protected]>
* SQL/PostgreSQL: cleanup usage of QT_CONFIG(datestring)Christian Ehrlicher2024-03-151-24/+15
| | | | | | | | | Creating a QString from a QDate/QTime works even when QT_CONFIG(datestring) is not defined, so no need to ifdef it out. Pick-to: 6.7 Change-Id: Ib3594036f309393b612d3fbf21f51be9c36a9391 Reviewed-by: Thiago Macieira <[email protected]>
* SQL/MySQL: pass UTC date/time stamps to the serverThiago Macieira2024-03-141-4/+25
| | | | | | | | | | | | | | | | | | | The MYSQL_TIME structure doesn't support per-datum timezone and in any case the server would not store it: the TIMESTAMP type is always stored in UTC. So instead let's configure the session time zone to UTC and use QDateTime to convert to/from it. Fixes https://bugs.kde.org/show_bug.cgi?id=483060 [ChangeLog][SQL][MySQL] Fixed a bug in passing QDateTime to be passed as local time to the server, regardless of the QDateTime's time zone setting. This would cause certain timestamps to be rejected by the server, such as a UTC time stamp whose time numerically matched the local timezone's spring forward gap in the transition into Daylight Savings Time. Change-Id: I6818d78a57394e37857bfffd17bbce4ae43e823c Reviewed-by: Christian Ehrlicher <[email protected]>
* SQL/MySQL: merge toMySqlDate (which returned MYSQL_TIME) into exec()Thiago Macieira2024-03-141-33/+25
| | | | | | | | | | | | It was the only place that called it. Makes the code slightly uglier, but removes a function that returned a raw pointer. More importantly, it gets the actual type from QVariant, without relying on it internally converting from QDateTime to QDate and QTime, or failing to do so in some cases. This is going to be needed for the next commit. Pick-to: 6.5 6.6 6.7 Change-Id: I6818d78a57394e37857bfffd17bbcd3f5057eadc Reviewed-by: Christian Ehrlicher <[email protected]>
* SQL/QSqlField: deprecate internal functions setSqlType()/typeID()Christian Ehrlicher2024-03-108-12/+0
| | | | | | | | | These functions set/get the db-specific internal sql type but it's not used in any of the sql plugins since ages. Any external plugin using this for some reason must be ported away until Qt7. Change-Id: Ifb33e9d3be0b80fb4d0979d31436e89ea6a8208b Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* SQL/MySQL: retrieve default column value for QSqlDatabase::record()Christian Ehrlicher2024-03-101-1/+28
| | | | | | | | | | Retrieve the default value (if set) of a column during QSqlDatabase::record() but not for QSqlQuery::record() as it's done for the other drivers which support retrieving the default column value. Fixes: QTBUG-122723 Change-Id: I92e052bfa6d88e019c0151fbcbc1483a65770c55 Reviewed-by: Axel Spoerl <[email protected]>
* SQL/ODBC: sync usage of qSqlWarning()Christian Ehrlicher2024-03-101-40/+55
| | | | | | | | Replace all qWarning() with qSqlWarning() to be able to get additional error/warning output from the handles. Change-Id: Ieaa947fe06216b3d20b20c509080fc409803683b Reviewed-by: Axel Spoerl <[email protected]>
* SQL/SQLite: Silence warning "Unsupported option ''"Friedemann Kleint2024-03-021-1/+1
| | | | | | | | | It shows for example when starting assistant. Amends 3379fd2322d112af4ef7ce75aafe18c27746acae. Pick-to: 6.7 Change-Id: I85196c62ff9d9caaa46a5279c3b965dc28266ba8 Reviewed-by: Christian Ehrlicher <[email protected]>
* SQL/ODBC: cache return value of SQLGetInfo(SQL_IDENTIFIER_CASE)Christian Ehrlicher2024-03-021-39/+33
| | | | | | | | This value does not change over time so no need to retrieve it from the driver for every call. As a drive-by change the enum to an enum class. Change-Id: I25292d724f5173fef7054bb5e7e82e82992e41c6 Reviewed-by: Axel Spoerl <[email protected]>
* SQL/ODBC: escape values in connection stringChristian Ehrlicher2024-03-021-5/+17
| | | | | | | | | | | | | Values in connection strings must be escaped when they - contain a ; -> escape with " - start with ' -> escape with " - start with " -> escape with ' Fixes: QTBUG-122642 Pick-to: 6.7 Change-Id: I1df638194067af5df94a34009e1547886fdf928c Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* SQL/ODBC: use SQL_SUCCEEDED(r)Christian Ehrlicher2024-03-021-33/+33
| | | | | | | | Use SQL_SUCCEEDED(r) instead checking for SQL_SUCCESS and SQL_SUCCESS_WITH_INFO separately on every return. Change-Id: Ic5c0e7d13b4ce117a23bbee9311980146b13ba4d Reviewed-by: Axel Spoerl <[email protected]>
* SQL/ODBC: Add helper class SqlStmtHandleChristian Ehrlicher2024-03-021-68/+68
| | | | | | | | | | Add RAII SqlStmtHandle helper class to make sure the statement handle is properly cleaned up also on early exit. Pick-to: 6.7 Change-Id: I7aba4472be1e2991f395eeb7e43f8dd272336694 Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Andy Shaw <[email protected]>
* SQL/ODBC: Don't assert when no error record is availableChristian Ehrlicher2024-02-291-0/+2
| | | | | | | | | | | | | | When SQLGetDiagRec() does not return an record, the list of DiagRecords might be empty. This will create an assertion when trying to access QList::front() or similar. Therefore we need to check if the list is empty before accessing it. This amends 4ec5c0efc756a39162b43367438fee965c229ae7 Fixes: QTBUG-122073 Pick-to: 6.7 6.6 Change-Id: I6f421d82f9b6fdf84672d755cbbe8d2adec13266 Reviewed-by: Volker Hilsheimer <[email protected]>
* SQL/SQLite: handle option SQLITE_OPEN_NOFOLLOWChristian Ehrlicher2024-02-261-0/+12
| | | | | | | | | | | | | Since SQLite 3.31 there is a new open() option SQLITE_OPEN_NOFOLLOW to disallow a filename with a symlink for security reason. Expose this option to QSQLite via QSQLITE_OPEN_NOFOLLOW. [ChangeLog][SQL][SQLite] Add new option QSQLITE_OPEN_NOFOLLOW to expose open mode SQLITE_OPEN_NOFOLLOW. Pick-to: 6.7 Change-Id: I2d6218bde2bf8b4f1bc36125dffa551b52369072 Reviewed-by: Volker Hilsheimer <[email protected]>
* SQL/ODBC: Remove code duplication - merge SQLFetch/SQLFetchScrollChristian Ehrlicher2024-02-091-41/+14
| | | | | | | | | ... into an own function instead doing the check if fetchScroll is available in every function. Pick-to: 6.7 Change-Id: I8c8a1c8693f667ddf89a660b733e31505427073a Reviewed-by: Andy Shaw <[email protected]>
* SQL/ODBC: avoid code duplicationChristian Ehrlicher2024-02-091-40/+20
| | | | | | | | | ... by moving the adjustment for the table/schema/catalog name into splitTableQualifier(). Pick-to: 6.7 Change-Id: Ia392b1c2e7f29e63ea88c21492f2116eac573b5e Reviewed-by: Andy Shaw <[email protected]>
* SQL/ODBC: remove unneeded qMakeFieldInfo(... QString *errMsg)Christian Ehrlicher2024-02-091-19/+7
| | | | | | | | | This function can be merged with the other overload of qMakeFieldInfo() because no-one uses it except qMakeFieldInfo() itself. Pick-to: 6.7 Change-Id: I7ed07ac0c673801fed9c00c9b0ce1628cfea3837 Reviewed-by: Andy Shaw <[email protected]>
* SQL/OCI: fix QOCIDriver::formatValue()Christian Ehrlicher2024-02-091-1/+1
| | | | | | | | | | | The switch needs to be on QSqlField::metaType() instead the internal QSqlField::typeID() which holds the db-specific type of this field. This amends 7b391c0d2c03d8d25449eca3868cd010d75ff81e. Pick-to: 6.7 6.6 6.5 6.2 Change-Id: Id1d1791826f08adb01cc3da45bf5a66bad288046 Reviewed-by: Andy Shaw <[email protected]>
* Override detection of OS for sqlite3Michał Łoś2024-02-081-0/+5
| | | | | | | | sqlite3 doesn't detect properly VxWorks. Add workaround that hardcodes detected OS to "UNIX". Change-Id: I255bb1af94caf7b15c0bd05a4d4d9df6a076fc22 Reviewed-by: Alexey Edelev <[email protected]>