Skip to content

Commit 6ae3e6e

Browse files
Fixed bug resulting in an inability to connect to 23ai databases which
have fast authentication disabled.
1 parent 4ebd8c9 commit 6ae3e6e

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

doc/src/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Thin Mode Changes
2020
#) Fixed bug resulting in a segfault when a closed cursor is bound as a REF
2121
CURSOR
2222
(`issue 368 <https://github.com/oracle/python-oracledb/issues/368>`__).
23+
#) Fixed bug resulting in an inability to connect to 23ai databases which have
24+
fast authentication disabled.
2325

2426
Thick Mode Changes
2527
++++++++++++++++++

src/oracledb/impl/thin/capabilities.pyx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ cdef class Capabilities:
6969
if server_caps[TNS_CCAP_FIELD_VERSION] < self.ttc_field_version:
7070
self.ttc_field_version = server_caps[TNS_CCAP_FIELD_VERSION]
7171
self.compile_caps[TNS_CCAP_FIELD_VERSION] = self.ttc_field_version
72-
if self.ttc_field_version < TNS_CCAP_FIELD_VERSION_23_4 \
73-
and self.supports_end_of_response:
74-
self.compile_caps[TNS_CCAP_TTC4] ^= TNS_CCAP_END_OF_RESPONSE
75-
self.supports_end_of_response = False
7672

7773
@cython.boundscheck(False)
7874
cdef void _adjust_for_server_runtime_caps(self, bytearray server_caps):

src/oracledb/impl/thin/protocol.pyx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ cdef class Protocol(BaseProtocol):
287287
DataTypesMessage data_types_message
288288
FastAuthMessage fast_auth_message
289289
ProtocolMessage protocol_message
290+
bint supports_end_of_response
290291
AuthMessage auth_message
291292

292293
# if we can use OOB, send an urgent message now followed by a reset
@@ -311,10 +312,15 @@ cdef class Protocol(BaseProtocol):
311312
fast_auth_message.auth_message = auth_message
312313
self._process_message(fast_auth_message)
313314

314-
# otherwise, do the normal authentication
315+
# otherwise, do the normal authentication; disable end of response for
316+
# the first two messages as the server does not send an end of response
317+
# for these messages
315318
else:
319+
supports_end_of_response = self._caps.supports_end_of_response
320+
self._caps.supports_end_of_response = False
316321
self._process_message(protocol_message)
317322
self._process_message(data_types_message)
323+
self._caps.supports_end_of_response = supports_end_of_response
318324
self._process_message(auth_message)
319325

320326
# send authorization message a second time, if needed, to respond to
@@ -637,6 +643,7 @@ cdef class BaseAsyncProtocol(BaseProtocol):
637643
DataTypesMessage data_types_message
638644
FastAuthMessage fast_auth_message
639645
ProtocolMessage protocol_message
646+
bint supports_end_of_response
640647
AuthMessage auth_message
641648

642649
# create the messages that need to be sent to the server
@@ -654,10 +661,15 @@ cdef class BaseAsyncProtocol(BaseProtocol):
654661
fast_auth_message.auth_message = auth_message
655662
await self._process_message(fast_auth_message)
656663

657-
# otherwise, do the normal authentication
664+
# otherwise, do the normal authentication; disable end of response for
665+
# the first two messages as the server does not send an end of response
666+
# for these messages
658667
else:
668+
supports_end_of_response = self._caps.supports_end_of_response
669+
self._caps.supports_end_of_response = False
659670
await self._process_message(protocol_message)
660671
await self._process_message(data_types_message)
672+
self._caps.supports_end_of_response = supports_end_of_response
661673
await self._process_message(auth_message)
662674

663675
# send authorization message a second time, if needed, to respond to

0 commit comments

Comments
 (0)