summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/oci/qsql_oci.cpp
Commit message (Collapse)AuthorAgeFilesLines
* SQL/OCI: do not shadow QSqlCachedResultPrivate::sqlChristian Ehrlicher2025-04-231-54/+54
| | | | | | | | | | | Rename QOCIResultPrivate::sql to QOCIResultPrivate::stmtp to avoid shadowing of the sql member from base class. Remove some useless casts as a drive-by. Pick-to: 6.9 Task-number: QTBUG-136024 Change-Id: I2a5951991039c4de7aecc29f9161dede7b4f3473 Reviewed-by: Volker Hilsheimer <[email protected]>
* SQL/OCI: Fix usage of QOCIResult::d_ptrChristian Ehrlicher2025-04-231-1/+2
| | | | | | | | | | | | | The refactoring in 82681fd8a2af1113da5bd13875ba71c1efd45afb added a d_ptr of type QOCIResultPrivate. This shadowed the d_ptr from QSqlCachedResult and an unitialized QOCIResult::d_ptr variable which in the end made the whole plugin unusable. Fix it by removing the unneeded d_ptr member. Pick-to: 6.9 Fixes: QTBUG-136024 Change-Id: I5ecacba8079eadbfae25a32720b43b4465c096d8 Reviewed-by: Volker Hilsheimer <[email protected]>
* SQL/OCI: misc cleanupChristian Ehrlicher2024-08-251-46/+34
| | | | | | | | | | | | | | Do some cleanup: - use qsizetype instead int - use default member init instead in ctor - remove unneeded functions - make a getter const This is a follow-up of 7005630a9b735f2e59e3345fee0305e0277c0208- Pick-to: 6.8 Change-Id: Ibb02bd93a130c5d60bf431608666a5ad1fe71ead Reviewed-by: Volker Hilsheimer <[email protected]>
* SQL/OCI: use OCIBindByPos2 instead OCIBindByPosChristian Ehrlicher2024-08-251-61/+61
| | | | | | | | | | | Use OCIBindByPos2 instead OCIBindByPos where it was not yet changed to allow lengths > 2^31 (and avoid unneeded casts). This is a follow-up of 7005630a9b735f2e59e3345fee0305e0277c0208. Pick-to: 6.8 Change-Id: I8b6efdfdb0fb349043e9c84ceba17e008882f584 Reviewed-by: Volker Hilsheimer <[email protected]>
* SQL/OCI: Compile with MSVC/64bitChristian Ehrlicher2024-08-221-21/+21
| | | | | | | | | Make the oci driver compilable with MSVC 2022 / 64bit. One more reason to get those drivers checked within the CI. Pick-to: 6.8 6.7 6.5 Change-Id: Iec07adcd4cafde5e028ea306fb88e635a22e2234 Reviewed-by: Volker Hilsheimer <[email protected]>
* OCI: misc code tidies and fixesDennis Oberst2024-06-281-3/+4
| | | | | | | | | | | | | | | | | | | | | | In it's current state the plugin is not buildable. This patch tries to address that by fixing those issues. They include: - Drag QOCIResultPrivate into the namespace and forward declare as class. It is defined as class and this should stay in sync. - Mark the overwritten members with 'override'. - add missing declaration for 'fetchNext' - Make the pimpl a proper Qt-dPtr by using Q_DECLARE_PRIVATE and rename it into 'd_ptr' so that we can use the 'Q_D' macro. - Remove the function call to 'isCursor'. This bool is member variable of the class. - Remove a '+' in front of 'internal_prepare' definition. - Remove the 'QOCIDriverPrivate' argument to the ctor. The initial one didn't had it and no other definition was provided. Amends: 82681fd8a2af1113da5bd13875ba71c1efd45afb Change-Id: I5b5042730b0decb440795bbb627c2cacc098594e Reviewed-by: Christian Ehrlicher <[email protected]>
* OCI: allow accessing results of PL/SQL procedure calls returning a REF CURSORVolker Hilsheimer2024-06-191-48/+53
| | | | | | | | | | | | Move the QOCIResult implementation of QSqlCachedResult into the private qsql_oci_p.h header, and register it as a meta type that we can pass through QVariant. Add a field that indicates whether that results represents a cursor variable, and bind it to the statement handle if so. Fixes: QTBUG-166 Fixes: QTBUG-44643 Change-Id: Iafbf5474ad7efc6d24eb52a5c5a1b3d2b6842387 Reviewed-by: Andy Shaw <[email protected]>
* Straighten out various logging categoriesUlf Hermann2024-06-191-1/+1
| | | | | | | | | | | | Either make them static or declare them in a header. We want them to be static wherever possible, in order to reduce the number of visible symbols. If they can't be static, however, they should at least be declared in only one place. Task-number: QTBUG-67692 Change-Id: I6f3b596ed4f0adc9873dd0a5f54f055a991a6207 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Volker Hilsheimer <[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]>
* 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/QSqlField: deprecate internal functions setSqlType()/typeID()Christian Ehrlicher2024-03-101-1/+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/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]>
* SQL plugins: add moc includesChristian Ehrlicher2023-07-191-0/+2
| | | | | Change-Id: I9ed4b63fd02b4a6fc5f4b614466590cd099609e2 Reviewed-by: Andy Shaw <[email protected]>
* Remove the manual undef of the min/max macros, or def NOMINMAXAmir Masoud Abdol2023-06-081-7/+0
| | | | | | | | | | We now add NOMINMAX to PlatformCommonInternal target which will be linked to everything else, so min/max will not be defined upon the inclusion of `windows.h`, or other headers. Pick-to: 6.5 6.6 Change-Id: I10016720dac7ce015e929885b7368ee86d8b6918 Reviewed-by: Alexandru Croitor <[email protected]>
* SQL/OCI: add maximumIdentifierLength()Christian Ehrlicher2023-03-171-0/+7
| | | | | | | | A table name or identifier must not be longer than 30 (< Oracle 12.2) or 128 bytes (sadly not characters). Change-Id: I49192afaf908e12f5cfd20c754640b6117b03a71 Reviewed-by: Volker Hilsheimer <[email protected]>
* SQL/OCI: Compile with QT_NO_CAST_FROM_ASCIIChristian Ehrlicher2023-03-121-1/+1
| | | | | | | | Don't know why this even went through the ci. Pick-to: 6.5 Change-Id: I9f0d1cee0c600c98f5b71bdd10f8f0260e43afcf Reviewed-by: Volker Hilsheimer <[email protected]>
* SQL: small optimization for SQLDriver::escapeIdentifier()Christian Ehrlicher2023-02-281-1/+1
| | | | | | | | 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 <[email protected]>
* SQL/OCI: use QDateTime::toString("ttt")Christian Ehrlicher2023-02-281-10/+1
| | | | | | | | | | | Use QDateTime::toString("ttt") which is available since Qt6.5 instead own implementation Pick-to: 6.5 Fixes: QTBUG-111275 Change-Id: I41676d3a327c5aaabdeb4f54b9d169e228c482e1 Reviewed-by: Edward Welbourne <[email protected]> Reviewed-by: Andy Shaw <[email protected]>
* SQL/OCI: Correctly calculate utc offset string when icu is not availableChristian Ehrlicher2023-02-271-2/+11
| | | | | | | | | | | | | When ICU is not available, QTimeZone::displayName() does not return a valid timezone offset string so the OCI driver will get a wrong utc offset string and inserting a QDateTime will go wrong. Fix it by creating the utc offset string by ourself (toOffsetString() inside qdatetime.cpp is static and therefore not accessible for us). Pick-to: 6.5 6.4 6.2 5.15 Fixes: QTBUG-111275 Change-Id: Ib724d760688614e162246e1e028ee5e004cc9477 Reviewed-by: Volker Hilsheimer <[email protected]>
* SQL/OCI: Fix QSQLDriver::record() when tablename is a synonymChristian Ehrlicher2023-02-221-3/+2
| | | | | | | | | | | Fix the statement when the tablename is a synonym by not appending the where clause for the table name to the initial statement used for tables and synonyms later on. Pick-to: 6.5 6.4 6.2 5.15 Fixes: QTBUG-111339 Change-Id: Ie18a858427d124e80462048b1a9c5e2afa327546 Reviewed-by: Volker Hilsheimer <[email protected]>
* Support connecting Oracle DB as system userJohannes Oikarinen2022-12-221-9/+18
| | | | | | | | Adding support to different authentication modes to Oracle DB. Adjust the connection string parsing a little bit as a drive-by. Change-Id: I24ed70ed5085f22ba58eff70caa685579d31c96f Reviewed-by: Andy Shaw <[email protected]>
* SQL/OCI: replace deprecated QDateTime() ctorChristian Ehrlicher2022-12-191-1/+1
| | | | | Change-Id: I0d36f036a9814e85f4606644e0fd8801e76ffccf Reviewed-by: Andy Shaw <[email protected]>
* SQL/OCI: fix compilationChristian Ehrlicher2022-10-141-1/+2
| | | | | | | | | | | Fix compilation error introduced with 917b4d3802f3c2102021610cbf977403a3d4c21a and add a missing override Pick-to: 6.4 Fixes: QTBUG-107544 Change-Id: I53571a0a113dc0f1e65f8773e66c02c1764739ee Reviewed-by: Ivan Solovev <[email protected]> Reviewed-by: Sze Howe Koh <[email protected]>
* Put code related to timezone functionality under QT_CONFIG(timezone)Tatiana Borisova2022-08-181-0/+2
| | | | | | Pick-to: 6.4 6.3 Change-Id: I0d1573dbb4ae4f9740fc19546950ae4316aa4c0c Reviewed-by: Edward Welbourne <[email protected]>
* Fix typos in docs and commentsKai Köhne2022-06-151-1/+1
| | | | | | | | | Found by codespell Pick-to: 6.4 Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb Reviewed-by: Nicholas Bennett <[email protected]> Reviewed-by: Edward Welbourne <[email protected]>
* 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 <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Sql: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-04-191-2/+2
| | | | | | Task-number: QTBUG-98434 Change-Id: Ia621f9d937649dda41a7b0d13a61e6f1397f6dde Reviewed-by: Volker Hilsheimer <[email protected]>
* Sql: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-191-57/+56
| | | | | | Task-number: QTBUG-98434 Change-Id: Ie12ca82fd912617eabe4f602c08914f12878cb32 Reviewed-by: Volker Hilsheimer <[email protected]>
* Sql: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-191-30/+29
| | | | | | | | | | | 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 <[email protected]>
* Adapt SQL drivers to Qt 6 change of QVariant::isNullVolker Hilsheimer2022-01-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]>
* Revert "Don't allocate an OCIDateTime object unless we're going to use it"Edward Welbourne2021-12-061-22/+7
| | | | | | | | | This reverts commit 064c3d35e6809672323e8d912e9140ddd0ad48cd. Reason for revert: Causes crashes on querying. Better to endure the non-NULL representations of null QDateTime values. Change-Id: I33dd3b95ab35d8e3accb864aec13d21764b1270d Reviewed-by: Andy Shaw <[email protected]>
* Close leak of QOCIDateTime objectEdward Welbourne2021-12-021-0/+1
| | | | | | | | | | | Noticed while reviewing usage of this type. The code has a whole TempStorage class to take care of keeping allocated memory live until we're done with it, explicitly including date-time objects as a special case, but neglected to use it in one place. Pick-to: 6.2 5.15 Change-Id: Ic94c56d67dda6dc3ee36a025a2e0149f6b2a1837 Reviewed-by: Andy Shaw <[email protected]>
* Don't allocate an OCIDateTime object unless we're going to use itEdward Welbourne2021-11-301-7/+22
| | | | | | | | | | | | | | | | | | | The QOCIDateTime destructor carefully checks that dateTime is non-null before tidying it away, but the constructor allocated it independently of whether it was used, leaving it in a still-not-constructed state if the date-time it was to represent was invalid. Only allocate if the date-time is valid; and check against null when an OCIDateTime is being converted back to QDateTime. Add warnings if either allocation or construction fails. Incidentally use static_cast<> instead of C-casting (and split a long line) in the other place that allocates an OCIDateTime descriptor. Pick-to: 6.2 5.15 Task-number: QTBUG-98471 Change-Id: Idd5531d9f7101878802cb9a3a016d3fd80903543 Reviewed-by: Andy Shaw <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* Tidy up in OCI driver codeEdward Welbourne2021-06-221-36/+42
| | | | | | | | | | | | | Use nullptr instead of 0 for null pointers. Compare OCIHandleAlloc() return values to OCI_SUCCESS rather than 0. Initialize instance variables in the class where possible, rather than in the constructor. Conform to coding style o long lines and braces. Assert pointers are null before allocating and overwriting them, so we might have a chance of catching leaks. Change-Id: Ia885ec18f46de5219a51fb6f9f23f474b3046585 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Andy Shaw <[email protected]>
* Move tidy-up of private to its own destructorEdward Welbourne2021-06-221-8/+4
| | | | | | | | | | | QOCIResult::~QOCIResult() was doing part of the tidy-up for QOCIResultPrivate, whose own destructor took care of the rest. So move that part to the private, where it makes more sense. Also correct an error message in part of the private's existing tidy-up and eliminate a needless local variable. Change-Id: I09a51c72afd7a30bcee7f6127c59d703650f1c41 Reviewed-by: Andy Shaw <[email protected]>
* Fix potential double-free in QSqlCachedResult::cleanup()Edward Welbourne2021-06-221-1/+3
| | | | | | | | | | | If d->sql is non-null, it gets freed; later in the same function, it gets reallocated, unless the query is empty, in which case the now-freed value was still recorded, so that later clean-up might find it and mistakenly think it needs to be freed again. Clear when freeing. Pick-to: 6.2 6.1 Change-Id: I8d37d2ba1fcaa320916eaf30dceaa720bbf62f38 Reviewed-by: Andy Shaw <[email protected]>
* Fix leak of transaction context handle in QSql's OCI driverEdward Welbourne2021-06-221-11/+21
| | | | | | | | | | | | | | Transaction handles were allocated but nowhere freed. Thanks to Stefan Latsch for pointing this out and suggesting the fix. Make the handle yet another member of QOCIDriverPrivate so that close() can free it. At the same time, also free the service context handle d->svc when failing do open(); and shuffle the order of frees to be the reverse of the order of allocations. Fixes: QTBUG-94246 Pick-to: 6.2 6.1 5.15 Change-Id: I45818ada6d884b06028056d28635390a300e2def Reviewed-by: Andy Shaw <[email protected]>
* OCI: Fix the compilation of the pluginAndy Shaw2020-12-131-5/+6
| | | | | | Pick-to: 6.0 Change-Id: I9637bab6cc217d4fd9692f6745b4f14db6ffb259 Reviewed-by: Christian Ehrlicher <[email protected]>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-3/+3
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <[email protected]> Reviewed-by: hjk <[email protected]>
* Deprecate QVariant::TypeLars Knoll2020-10-231-173/+171
| | | | | | | | | 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Friedemann Kleint <[email protected]>
* Remove QVariant(int type, void *data, ...) constructorLars Knoll2020-08-151-3/+2
| | | | | | | | It was marked internal anyway. Use the constructor taking a QMetaType instead. Change-Id: I15b9cd0911aac063a0f0fe0352fa2c84b7f7c691 Reviewed-by: Lars Knoll <[email protected]>
* Replace Qt CONSTEXPR defines with constexprAllan Sandfeld Jensen2020-08-141-1/+1
| | | | | | | | Both normal and relaxed constexpr are required by our new minimum of C++17. Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744 Reviewed-by: Sona Kurazyan <[email protected]>
* Use QList instead of QVector in pluginsJarek Kobus2020-07-061-21/+21
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic86f4a3000592a1c9ae62e4a83f4fe39832a6b24 Reviewed-by: Friedemann Kleint <[email protected]>
* Fix compilation of thee OCI driverLars Knoll2020-04-241-1/+1
| | | | | | | Amends change befd198c15b7a2b95f539372d2557063b6b397a6 Change-Id: I11cc116d31fa1f71acd9579e60a6b265811def1e Reviewed-by: Samuel Gaist <[email protected]>
* Remove QRegExp usage from the the OCI pluginLars Knoll2020-03-171-4/+8
| | | | | | Change-Id: I95009b5bc6f9ce4356e707e07c5cb7346aaf9245 Reviewed-by: Samuel Gaist <[email protected]> Reviewed-by: Maurice Kalinowski <[email protected]>
* 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 <[email protected]>
* oci: Use OCIBindByPos2 to accommodate data longer than USHRT_MAXAndy Shaw2018-04-061-3/+3
| | | | | | | | 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 <[email protected]>
* SQL plugins: Fix warnings about deprecated constructor of QSqlErrorFriedemann Kleint2018-01-101-1/+2
| | | | | | | | Use the constructor taking a string and convert number unless it is -1. Change-Id: I18d1ba2c8e0d3f4af01b7955863967f75051746b Reviewed-by: Andy Shaw <[email protected]>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-231-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9