File tree Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ Thin Mode Changes
16
16
#) Fixed bug when calling :meth: `~Connection.gettype() ` with an object type
17
17
name containing ``%ROWTYPE ``
18
18
(`issue 304 <https://github.com/oracle/python-oracledb/issues/304 >`__).
19
+ #) Tightened up code looking for the end of a database request.
19
20
#) Restored error message raised when attempting to connect to Oracle Database
20
21
11g.
21
22
Original file line number Diff line number Diff line change @@ -79,15 +79,6 @@ cdef class Capabilities:
79
79
errors._raise_err(errors.ERR_NCHAR_CS_NOT_SUPPORTED,
80
80
charset_id = self .ncharset_id)
81
81
82
- cdef void _check_supports_end_of_request(self ):
83
- """
84
- Checks whether the end of request flag is sent and sets a boolean to
85
- avoid calculating it each time.
86
- """
87
- if self .ttc_field_version >= TNS_CCAP_FIELD_VERSION_19_1 \
88
- and self .compile_caps[TNS_CCAP_TTC4] & TNS_CCAP_END_OF_REQUEST:
89
- self .supports_end_of_request = True
90
-
91
82
@ cython.boundscheck (False )
92
83
cdef void _init_compile_caps(self ):
93
84
self .ttc_field_version = TNS_CCAP_FIELD_VERSION_MAX
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ cdef enum:
47
47
48
48
# data flags
49
49
cdef enum :
50
+ TNS_DATA_FLAGS_END_OF_REQUEST = 0x2000
50
51
TNS_DATA_FLAGS_EOF = 0x0040
51
52
52
53
# marker types
@@ -740,6 +741,7 @@ cdef enum:
740
741
# accept flags
741
742
cdef enum :
742
743
TNS_ACCEPT_FLAG_FAST_AUTH = 0x10000000
744
+ TNS_ACCEPT_FLAG_HAS_END_OF_REQUEST = 0x02000000
743
745
744
746
# other constants
745
747
cdef enum :
Original file line number Diff line number Diff line change @@ -1847,6 +1847,8 @@ cdef class ConnectMessage(Message):
1847
1847
buf.read_uint32(& flags)
1848
1848
if flags & TNS_ACCEPT_FLAG_FAST_AUTH:
1849
1849
buf._caps.supports_fast_auth = True
1850
+ if flags & TNS_ACCEPT_FLAG_HAS_END_OF_REQUEST:
1851
+ buf._caps.supports_end_of_request = True
1850
1852
buf._caps._adjust_for_protocol(protocol_version, protocol_options)
1851
1853
buf._transport._full_packet_size = True
1852
1854
elif buf._current_packet.packet_type == TNS_PACKET_TYPE_REFUSE:
@@ -1923,7 +1925,6 @@ cdef class DataTypesMessage(Message):
1923
1925
buf.read_uint16(& conv_data_type)
1924
1926
if conv_data_type != 0 :
1925
1927
buf.skip_raw_bytes(4 )
1926
- buf._caps._check_supports_end_of_request()
1927
1928
1928
1929
cdef int _write_message(self , WriteBuffer buf) except - 1 :
1929
1930
cdef:
Original file line number Diff line number Diff line change @@ -60,8 +60,13 @@ cdef class Packet:
60
60
Returns a boolean indicating if the end of request byte is found at the
61
61
end of the packet.
62
62
"""
63
- cdef char * ptr = cpython.PyBytes_AS_STRING(self .buf)
64
- return ptr[self .packet_size - 1 ] == TNS_MSG_TYPE_END_OF_REQUEST
63
+ cdef:
64
+ uint16_t flags
65
+ char * ptr
66
+ ptr = cpython.PyBytes_AS_STRING(self .buf)
67
+ flags = unpack_uint16(< const char_type* > & ptr[PACKET_HEADER_SIZE],
68
+ BYTE_ORDER_MSB)
69
+ return flags & TNS_DATA_FLAGS_END_OF_REQUEST
65
70
66
71
67
72
@cython.final
You can’t perform that action at this time.
0 commit comments