From 65536adbbe2594efb15993c2d8f1ea9c9284a237 Mon Sep 17 00:00:00 2001 From: Anthony Tuininga Date: Wed, 13 Nov 2024 15:46:32 -0700 Subject: [PATCH] Fixed bug calculating property max_identifier_length in thick mode when using older client libraries (#395). --- doc/src/api_manual/connection.rst | 6 +++++- doc/src/release_notes.rst | 9 +++++++++ src/oracledb/impl/thick/connection.pyx | 3 ++- src/oracledb/impl/thick/odpi | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/doc/src/api_manual/connection.rst b/doc/src/api_manual/connection.rst index 323f1ed..76482f4 100644 --- a/doc/src/api_manual/connection.rst +++ b/doc/src/api_manual/connection.rst @@ -760,7 +760,11 @@ Connection Attributes in bytes supported by the database to which the connection has been established. See `Database Object Naming Rules `__. + id=GUID-75337742-67FD-4EC0-985F-741C93D918DA>`__. The value may be + ``None``, 30, or 128. The value ``None`` indicates the size cannot be + reliably determined by python-oracledb, which occurs when using Thick mode + with Oracle Client libraries 12.1 (or older) to connect to Oracle Database + 12.2, or later. .. versionadded:: 2.5.0 diff --git a/doc/src/release_notes.rst b/doc/src/release_notes.rst index 8a1b3a2..0ca67a9 100644 --- a/doc/src/release_notes.rst +++ b/doc/src/release_notes.rst @@ -14,6 +14,15 @@ of python-oracledb), as affecting the optional :ref:`Thick Mode oracledb 2.5.1 (TBD) -------------------- +Thick Mode Changes +++++++++++++++++++ + +#) Fixed bug calculating property :data:`Connection.max_identifier_length` + when using Oracle Client libraries 12.1, or older. The returned value may + now be ``None`` when the size cannot be reliably determined by + python-oracledb, which occurs when using Oracle Client libraries 12.1 (or + older) to connect to Oracle Database 12.2, or later. + (`ODPI-C `__ dependency update). oracledb 2.5.0 (November 2024) ------------------------------ diff --git a/src/oracledb/impl/thick/connection.pyx b/src/oracledb/impl/thick/connection.pyx index 27eab10..2adc5ca 100644 --- a/src/oracledb/impl/thick/connection.pyx +++ b/src/oracledb/impl/thick/connection.pyx @@ -666,7 +666,8 @@ cdef class ThickConnImpl(BaseConnImpl): cdef dpiConnInfo info if dpiConn_getInfo(self._handle, &info) < 0: _raise_from_odpi() - return info.maxIdentifierLength + if info.maxIdentifierLength != 0: + return info.maxIdentifierLength def get_max_open_cursors(self): cdef uint32_t value diff --git a/src/oracledb/impl/thick/odpi b/src/oracledb/impl/thick/odpi index c9be4cc..481ca80 160000 --- a/src/oracledb/impl/thick/odpi +++ b/src/oracledb/impl/thick/odpi @@ -1 +1 @@ -Subproject commit c9be4cceeb004435409379851e13eb7fc50a5c6c +Subproject commit 481ca80958c54ddb3c5d550786964848b1ec5136