File tree Expand file tree Collapse file tree 4 files changed +39
-1
lines changed
src/oracledb/impl/thin/messages Expand file tree Collapse file tree 4 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ Thin Mode Changes
4242 :attr: `DeqOptions.correlation ` for buffered delivery mode.
4343#) Fixed bug when fetching multiple consecutive null values into a :ref: `data
4444 frame <dataframeformat>`.
45+ #) Fixed bug using :ref: `Oracle Advanced Queuing <aqusermanual >` when
46+ attempting to dequeue using an invalid :attr: `DeqOptions.msgid `.
4547
4648Thick Mode Changes
4749++++++++++++++++++
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ cdef class AqDeqMessage(AqBaseMessage):
6767 bytes consumer_name_bytes
6868 bytes correlation_bytes
6969 bytes condition_bytes
70+ bytes msgid_bytes
7071 uint16_t delivery_mode
7172 int deq_flags
7273 self ._write_function_code(buf)
@@ -135,7 +136,10 @@ cdef class AqDeqMessage(AqBaseMessage):
135136 if consumer_name_bytes is not None :
136137 buf.write_bytes_with_length(consumer_name_bytes)
137138 if self .deq_options_impl.msgid:
138- buf.write_bytes(self .deq_options_impl.msgid)
139+ msgid_bytes = self .deq_options_impl.msgid[:16 ]
140+ if len (msgid_bytes) < 16 :
141+ msgid_bytes += bytes(16 - len (msgid_bytes))
142+ buf.write_bytes(msgid_bytes)
139143 if correlation_bytes is not None :
140144 buf.write_bytes_with_length(correlation_bytes)
141145 buf.write_bytes(self .queue_impl.payload_toid)
Original file line number Diff line number Diff line change @@ -482,6 +482,22 @@ def test_7829(self):
482482 self .conn .commit ()
483483 self .assertEqual (msg .payload , value )
484484
485+ def test_7830 (self ):
486+ "7830 - test deq options with msgid > 16 bytes"
487+ queue = self .get_and_clear_queue ("TEST_RAW_QUEUE" )
488+ queue .deqoptions .msgid = b"invalid_msgid_123456789"
489+ queue .deqoptions .wait = oracledb .DEQ_NO_WAIT
490+ with self .assertRaisesFullCode ("ORA-25263" ):
491+ queue .deqone ()
492+
493+ def test_7831 (self ):
494+ "7831 - test deq options with msgid < 16 bytes"
495+ queue = self .get_and_clear_queue ("TEST_RAW_QUEUE" )
496+ queue .deqoptions .msgid = b"short_msgid"
497+ queue .deqoptions .wait = oracledb .DEQ_NO_WAIT
498+ with self .assertRaisesFullCode ("ORA-25263" ):
499+ queue .deqone ()
500+
485501
486502if __name__ == "__main__" :
487503 test_env .run_test_cases ()
Original file line number Diff line number Diff line change @@ -421,6 +421,22 @@ async def test_7925(self):
421421 await self .conn .commit ()
422422 self .assertEqual (msg .payload , value )
423423
424+ async def test_7926 (self ):
425+ "7926 - test deq options with msgid > 16 bytes"
426+ queue = await self .get_and_clear_queue ("TEST_RAW_QUEUE" )
427+ queue .deqoptions .msgid = b"invalid_msgid_123456789"
428+ queue .deqoptions .wait = oracledb .DEQ_NO_WAIT
429+ with self .assertRaisesFullCode ("ORA-25263" ):
430+ await queue .deqone ()
431+
432+ async def test_7927 (self ):
433+ "7927 - test deq options with msgid < 16 bytes"
434+ queue = await self .get_and_clear_queue ("TEST_RAW_QUEUE" )
435+ queue .deqoptions .msgid = b"short_msgid"
436+ queue .deqoptions .wait = oracledb .DEQ_NO_WAIT
437+ with self .assertRaisesFullCode ("ORA-25263" ):
438+ await queue .deqone ()
439+
424440
425441if __name__ == "__main__" :
426442 test_env .run_test_cases ()
You can’t perform that action at this time.
0 commit comments