Skip to content

Commit 9f3ef42

Browse files
Restored error message raised when attempting to connect to an 11g
database.
1 parent b7545bb commit 9f3ef42

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

doc/src/release_notes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ oracledb 2.1.1 (TBD)
1313
Thin Mode Changes
1414
+++++++++++++++++
1515

16+
#) Restored error message raised when attempting to connect to an 11g
17+
database.
18+
1619
Thick Mode Changes
1720
++++++++++++++++++
1821

src/oracledb/impl/thin/messages.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,10 @@ cdef class ConnectMessage(Message):
18351835
self.read_redirect_data_len = False
18361836
elif buf._current_packet.packet_type == TNS_PACKET_TYPE_ACCEPT:
18371837
buf.read_uint16(&protocol_version)
1838+
# check if the protocol version supported by the database is high
1839+
# enough; if not, reject the connection immediately
1840+
if protocol_version < TNS_VERSION_MIN_ACCEPTED:
1841+
errors._raise_err(errors.ERR_SERVER_VERSION_NOT_SUPPORTED)
18381842
buf.read_uint16(&protocol_options)
18391843
buf.skip_raw_bytes(20)
18401844
buf.read_uint32(&buf._caps.sdu)

src/oracledb/impl/thin/protocol.pyx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,6 @@ cdef class Protocol(BaseProtocol):
284284
ProtocolMessage protocol_message
285285
AuthMessage auth_message
286286

287-
# check if the protocol version supported by the database is high
288-
# enough; if not, reject the connection immediately
289-
if self._caps.protocol_version < TNS_VERSION_MIN_ACCEPTED:
290-
errors._raise_err(errors.ERR_SERVER_VERSION_NOT_SUPPORTED)
291-
292287
# if we can use OOB, send an urgent message now followed by a reset
293288
# marker to see if the server understands it
294289
if self._caps.supports_oob \
@@ -641,11 +636,6 @@ cdef class BaseAsyncProtocol(BaseProtocol):
641636
ProtocolMessage protocol_message
642637
AuthMessage auth_message
643638

644-
# check if the protocol version supported by the database is high
645-
# enough; if not, reject the connection immediately
646-
if self._caps.protocol_version < TNS_VERSION_MIN_ACCEPTED:
647-
errors._raise_err(errors.ERR_SERVER_VERSION_NOT_SUPPORTED)
648-
649639
# create the messages that need to be sent to the server
650640
protocol_message = conn_impl._create_message(ProtocolMessage)
651641
data_types_message = conn_impl._create_message(DataTypesMessage)

0 commit comments

Comments
 (0)