Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/oracledb/impl/thin/messages/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,20 @@ cdef class Message:
if num_bytes > 0:
binary_value = buf.read_bytes()
buf.read_ub2(&keyword_num) # keyword num
# `text_value` and `binary_value` start as None and are assigned
# only when the corresponding length is non-zero. Some servers
# send keyword pairs with zero-length payloads (observed on
# ALTER PLUGGABLE DATABASE OPEN / CLOSE in 19c — #587), so guard
# the decode/use of each value before applying it.
if keyword_num == TNS_KEYWORD_NUM_CURRENT_SCHEMA:
self.conn_impl._current_schema = text_value.decode()
if text_value is not None:
self.conn_impl._current_schema = text_value.decode()
elif keyword_num == TNS_KEYWORD_NUM_EDITION:
self.conn_impl._edition = text_value.decode()
if text_value is not None:
self.conn_impl._edition = text_value.decode()
elif keyword_num == TNS_KEYWORD_NUM_TRANSACTION_ID:
self._update_sessionless_txn_state(binary_value)
if binary_value is not None:
self._update_sessionless_txn_state(binary_value)

cdef int _process_message(self, ReadBuffer buf,
uint8_t message_type) except -1:
Expand Down