Skip to content

Commit a5c0352

Browse files
Thin: ensure that errors that occur during fetch are detected
consistently.
1 parent 21e4a2d commit a5c0352

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

doc/src/release_notes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ oracledb 1.0.1 (TBD)
2525
#) Thin: fixed retry count handling to work in cases where the listener is
2626
running but the service is down
2727
(`issue 3 <https://github.com/oracle/python-oracledb/issues/3>`__).
28-
#) Thin: if an OS error occurs during the creation of a connection to the
28+
#) Thin: if an error occurs during the creation of a connection to the
2929
database, the error is wrapped by DPY-6005 as an instance of
3030
oracledb.ConnectionError.
3131
#) Fixed issue where unconstrained numbers containing integer values would be
3232
fetched as floats when oracledb.defaults.fetch_lobs was set to `False`.
33+
#) Thin: ensure that errors that occur during fetch are detected consistently.
3334

3435

3536
oracledb 1.0.0 (May 2022)

src/oracledb/impl/thin/messages.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ cdef class Message:
156156
buf.read_ub4(&info.num) # error number (extended)
157157
buf.read_ub8(&info.rowcount) # row number (extended)
158158
if info.num != 0:
159+
self.error_occurred = True
159160
info.message = buf.read_str(TNS_CS_IMPLICIT).rstrip()
160161
info.is_warning = False
161162

@@ -717,6 +718,7 @@ cdef class MessageWithData(Message):
717718
if self.error_info.num == TNS_ERR_NO_DATA_FOUND:
718719
self.error_info.num = 0
719720
cursor_impl._more_rows_to_fetch = False
721+
self.error_occurred = False
720722
elif self.error_info.num == TNS_ERR_VAR_NOT_IN_SELECT_LIST:
721723
conn_impl._add_cursor_to_close(cursor_impl._statement)
722724
cursor_impl._statement._cursor_id = 0

src/oracledb/impl/thin/protocol.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ cdef class Protocol:
316316
buf.receive_packet(&message.packet_type)
317317
if message.packet_type == TNS_PACKET_TYPE_MARKER:
318318
self._reset(message)
319-
message.error_occurred = True
320319
elif message.packet_type == TNS_PACKET_TYPE_REFUSE:
321320
self._write_buf._packet_sent = False
322321
buf.skip_raw_bytes(3)

0 commit comments

Comments
 (0)