Skip to content

Commit a622afa

Browse files
Fixed bug when using temporary LOBs with implicit pooling.
1 parent 8888127 commit a622afa

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

doc/src/release_notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Thin Mode Changes
3737
(`issue 472 <https://github.com/oracle/python-oracledb/issues/472>`__).
3838
#) Fixed bug when connecting to an AC-enabled service
3939
(`issue 476 <https://github.com/oracle/python-oracledb/issues/476>`__).
40+
#) Fixed bug when using temporary LOBs with implicit pooling.
4041

4142
Thick Mode Changes
4243
++++++++++++++++++

src/oracledb/impl/thin/lob.pyx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#------------------------------------------------------------------------------
2-
# Copyright (c) 2020, 2024, Oracle and/or its affiliates.
2+
# Copyright (c) 2020, 2025, Oracle and/or its affiliates.
33
#
44
# This software is dual-licensed to you under the Universal Permissive License
55
# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
@@ -56,8 +56,7 @@ cdef class BaseThinLobImpl(BaseLobImpl):
5656
self._locator = bytes(40)
5757
message = self._conn_impl._create_message(LobOpMessage)
5858
message.operation = TNS_LOB_OP_CREATE_TEMP
59-
message.amount = TNS_DURATION_SESSION
60-
message.send_amount = True
59+
message.dest_length = TNS_DURATION_SESSION
6160
message.source_lob_impl = self
6261
message.source_offset = self.dbtype._csfrm
6362
message.dest_offset = self.dbtype._ora_type_num

src/oracledb/impl/thin/messages/lob_op.pyx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ cdef class LobOpMessage(Message):
3535
cdef:
3636
uint32_t operation
3737
BaseThinLobImpl source_lob_impl
38-
BaseThinLobImpl dest_lob_impl
3938
uint64_t source_offset
4039
uint64_t dest_offset
40+
uint32_t dest_length
4141
int64_t amount
4242
bint send_amount
4343
bint bool_flag
@@ -75,13 +75,9 @@ cdef class LobOpMessage(Message):
7575
num_bytes = len(self.source_lob_impl._locator)
7676
ptr = buf.read_raw_bytes(num_bytes)
7777
self.source_lob_impl._locator = ptr[:num_bytes]
78-
if self.dest_lob_impl is not None:
79-
num_bytes = len(self.dest_lob_impl._locator)
80-
ptr = buf.read_raw_bytes(num_bytes)
81-
self.dest_lob_impl._locator = ptr[:num_bytes]
8278
if self.operation == TNS_LOB_OP_CREATE_TEMP:
8379
buf.skip_ub2() # skip character set
84-
buf.skip_raw_bytes(3) # skip trailing flags, amount
80+
buf.skip_ub1() # skip trailing flags
8581
elif self.send_amount:
8682
buf.read_sb8(&self.amount)
8783
if self.operation in (TNS_LOB_OP_IS_OPEN,
@@ -99,12 +95,8 @@ cdef class LobOpMessage(Message):
9995
else:
10096
buf.write_uint8(1) # source pointer
10197
buf.write_ub4(len(self.source_lob_impl._locator))
102-
if self.dest_lob_impl is None:
103-
buf.write_uint8(0) # dest pointer
104-
buf.write_ub4(0) # dest length
105-
else:
106-
buf.write_uint8(1) # dest pointer
107-
buf.write_ub4(len(self.dest_lob_impl._locator))
98+
buf.write_uint8(0) # dest pointer
99+
buf.write_ub4(self.dest_length)
108100
buf.write_ub4(0) # short source offset
109101
buf.write_ub4(0) # short dest offset
110102
if self.operation == TNS_LOB_OP_CREATE_TEMP:
@@ -132,8 +124,6 @@ cdef class LobOpMessage(Message):
132124
buf.write_uint16be(0)
133125
if self.source_lob_impl is not None:
134126
buf.write_bytes(self.source_lob_impl._locator)
135-
if self.dest_lob_impl is not None:
136-
buf.write_bytes(self.dest_lob_impl._locator)
137127
if self.operation == TNS_LOB_OP_CREATE_TEMP:
138128
if self.source_lob_impl.dbtype._csfrm == CS_FORM_NCHAR:
139129
buf._caps._check_ncharset_id()

0 commit comments

Comments
 (0)