File tree Expand file tree Collapse file tree 5 files changed +14
-6
lines changed Expand file tree Collapse file tree 5 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ oracledb 2.2.1 (TBD)
1717Thin Mode Changes
1818+++++++++++++++++
1919
20+ #) Fixed bug in handling redirect data with small SDU sizes.
21+
2022Thick Mode Changes
2123++++++++++++++++++
2224
Original file line number Diff line number Diff line change @@ -191,8 +191,7 @@ cdef class Buffer:
191191 cdef object read_interval_ym(self )
192192 cdef int read_int32(self , int32_t * value, int byte_order = * ) except - 1
193193 cdef object read_oracle_number(self , int preferred_num_type)
194- cdef inline const char_type* read_raw_bytes(self ,
195- ssize_t num_bytes) except NULL
194+ cdef const char_type* read_raw_bytes(self , ssize_t num_bytes) except NULL
196195 cdef int read_raw_bytes_and_length(self , const char_type ** ptr,
197196 ssize_t * num_bytes) except - 1
198197 cdef int read_sb1(self , int8_t * value) except - 1
Original file line number Diff line number Diff line change @@ -638,8 +638,7 @@ cdef class Buffer:
638638 if ptr != NULL :
639639 return self .parse_oracle_number(ptr, num_bytes, preferred_num_type)
640640
641- cdef inline const char_type* read_raw_bytes(self ,
642- ssize_t num_bytes) except NULL :
641+ cdef const char_type* read_raw_bytes(self , ssize_t num_bytes) except NULL :
643642 """
644643 Returns a pointer to a contiguous buffer containing the specified
645644 number of bytes found in the buffer.
Original file line number Diff line number Diff line change @@ -388,7 +388,7 @@ cdef class MessageWithData(Message):
388388 copied. An array is stored and a pointer to the underlying memory is
389389 used for performance reasons.
390390 """
391- cdef const char_type * ptr = buf._get_raw (num_bytes)
391+ cdef const char_type * ptr = buf.read_raw_bytes (num_bytes)
392392 if self .bit_vector_buf is None :
393393 self .bit_vector_buf = array.array(' B' )
394394 array.resize(self .bit_vector_buf, num_bytes)
@@ -1834,7 +1834,7 @@ cdef class ConnectMessage(Message):
18341834 buf.read_uint16(& self .redirect_data_len)
18351835 self .read_redirect_data_len = True
18361836 buf.wait_for_packets_sync()
1837- redirect_data = buf._get_raw (self .redirect_data_len)
1837+ redirect_data = buf.read_raw_bytes (self .redirect_data_len)
18381838 if self .redirect_data_len > 0 :
18391839 self .redirect_data = \
18401840 redirect_data[:self .redirect_data_len].decode()
Original file line number Diff line number Diff line change @@ -466,6 +466,14 @@ cdef class ReadBuffer(Buffer):
466466 else PY_TYPE_LOB
467467 return cls ._from_impl(lob_impl)
468468
469+ cdef const char_type* read_raw_bytes(self , ssize_t num_bytes) except NULL :
470+ """
471+ Read the specified number of bytes from the packet and return them.
472+ """
473+ self ._chunked_bytes_buf.start_chunked_read()
474+ self ._get_raw(num_bytes, in_chunked_read = True )
475+ return self ._chunked_bytes_buf.end_chunked_read()
476+
469477 cdef int read_rowid(self , Rowid * rowid) except - 1 :
470478 """
471479 Reads a rowid from the buffer and populates the rowid structure.
You can’t perform that action at this time.
0 commit comments