Skip to content

Commit 94874ea

Browse files
Fixed bug when warning message is encountered during connect (#171).
1 parent 7eb9be4 commit 94874ea

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/src/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Thin Mode Changes
1515

1616
#) Fixed bug when SQL is executed after first being parsed with Oracle
1717
Database 23c.
18+
#) Fixed bug when warning message is encountered during connect
19+
(`issue 171 <https://github.com/oracle/python-oracledb/issues/171>`__).
1820

1921
Common Changes
2022
++++++++++++++

src/oracledb/impl/thin/messages.pyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,13 @@ cdef class Message:
252252
cdef int _process_warning_info(self, ReadBuffer buf) except -1:
253253
cdef:
254254
_OracleErrorInfo info = self.error_info
255-
const char_type *ptr
256255
uint16_t num_bytes, temp16
257256
buf.read_ub2(&temp16) # error number
258257
info.num = temp16
259258
buf.read_ub2(&num_bytes) # length of error message
260259
buf.skip_ub2() # flags
261260
if info.num != 0 and num_bytes > 0:
262-
ptr = buf.read_raw_bytes(num_bytes)
263-
info.message = ptr[:num_bytes].decode().rstrip()
261+
info.message = buf.read_str(TNS_CS_IMPLICIT).rstrip()
264262
info.is_warning = True
265263

266264
cdef int _write_function_code(self, WriteBuffer buf) except -1:

0 commit comments

Comments
 (0)