Skip to content

Commit ad6b986

Browse files
Fixed regression with contents of Cursor.description when calling
Cursor.parse() with a query that returns LOBs.
1 parent d2df75b commit ad6b986

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

doc/src/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Common Changes
3535
:ref:`cloud native authentication <tokenauth>` plugins for connections.
3636
Note that an invalid ``auth_type`` parameter will no longer raise an
3737
exception but will simply be ignored.
38+
#) Fixed regression with contents of :data:`Cursor.description` when calling
39+
:meth:`Cursor.parse()` with a query that returns LOBs.
3840
#) Updated the `Jupyter notebook samples <https://github.com/oracle/
3941
python-oracledb/tree/main/samples/notebooks>`__ to cover recent
4042
python-oracledb features.

src/oracledb/impl/base/connection.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ cdef class BaseConnImpl:
223223
cursor_impl.scrollable = scrollable
224224
cursor_impl.arraysize = C_DEFAULTS.arraysize
225225
cursor_impl.prefetchrows = C_DEFAULTS.prefetchrows
226+
cursor_impl.fetch_lobs = C_DEFAULTS.fetch_lobs
227+
cursor_impl.fetch_decimals = C_DEFAULTS.fetch_decimals
226228
return cursor_impl
227229

228230
def create_msg_props_impl(self):

tests/test_4300_cursor_other.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,3 +1059,10 @@ def test_4371(cursor):
10591059
cursor.execute("select :1 from dual", [value], fetch_decimals=True)
10601060
rows = cursor.fetchall()
10611061
assert isinstance(rows[0][0], decimal.Decimal)
1062+
1063+
1064+
def test_4372(cursor):
1065+
"4372 - test cursor.parse() uses oracledb.defaults.fetch_lobs"
1066+
cursor.parse("select to_clob('some_value') from dual")
1067+
fetch_info = cursor.description[0]
1068+
assert fetch_info.type is oracledb.DB_TYPE_CLOB

tests/test_6300_cursor_other_async.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,3 +961,10 @@ async def test_6355(async_cursor):
961961
)
962962
rows = await async_cursor.fetchall()
963963
assert isinstance(rows[0][0], decimal.Decimal)
964+
965+
966+
async def test_6356(async_cursor):
967+
"6356 - test cursor.parse() uses oracledb.defaults.fetch_lobs"
968+
await async_cursor.parse("select to_clob('some_value') from dual")
969+
fetch_info = async_cursor.description[0]
970+
assert fetch_info.type is oracledb.DB_TYPE_CLOB

0 commit comments

Comments
 (0)