Correct calculation of MessageProperties.msgid. · SoniaComp/python-cx_Oracle@438c885 · GitHub
Skip to content

Commit 438c885

Browse files
Correct calculation of MessageProperties.msgid.
1 parent 1347b04 commit 438c885

4 files changed

Lines changed: 9 additions & 28 deletions

File tree

doc/src/api_manual/aq.rst

Lines changed: 3 additions & 2 deletions

doc/src/release_notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Version 8.3 (TBD)
1313
#) Updated embedded ODPI-C to `version 4.3.0
1414
<https://oracle.github.io/odpi/doc/releasenotes.html#
1515
version-4-3-tbd>`__.
16+
#) Corrected calculation of attribute :data:`MessageProperties.msgid`.
1617
#) Binary integer variables now explicitly convert values to integers (since
1718
implicit conversion to integer has become an error in Python 3.10) and
1819
values that are not `int`, `float` or `decimal.Decimal` are explicitly

src/cxoMsgProps.c

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,15 @@ static PyObject *cxoMsgProps_getExpiration(cxoMsgProps *props, void *unused)
182182

183183

184184
//-----------------------------------------------------------------------------
185-
// cxoMsgProps_getOriginalMsgId()
186-
// Get the value of the expiration property.
185+
// cxoMsgProps_getMsgId()
186+
// Get the value of the msgid property.
187187
//-----------------------------------------------------------------------------
188-
static PyObject *cxoMsgProps_getOriginalMsgId(cxoMsgProps *props, void *unused)
188+
static PyObject *cxoMsgProps_getMsgId(cxoMsgProps *props, void *unused)
189189
{
190190
uint32_t valueLength;
191191
const char *value;
192192

193-
if (dpiMsgProps_getOriginalMsgId(props->handle, &value, &valueLength) < 0)
193+
if (dpiMsgProps_getMsgId(props->handle, &value, &valueLength) < 0)
194194
return cxoError_raiseAndReturnNull();
195195
if (!value)
196196
Py_RETURN_NONE;
@@ -285,25 +285,6 @@ static int cxoMsgProps_setExpiration(cxoMsgProps *props, PyObject *valueObj,
285285
}
286286

287287

288-
//-----------------------------------------------------------------------------
289-
// cxoMsgProps_setOriginalMsgId()
290-
// Set the value of the original message id property.
291-
//-----------------------------------------------------------------------------
292-
static int cxoMsgProps_setOriginalMsgId(cxoMsgProps *props, PyObject *valueObj,
293-
void *unused)
294-
{
295-
Py_ssize_t valueLength;
296-
char *value;
297-
298-
if (PyBytes_AsStringAndSize(valueObj, &value, &valueLength) < 0)
299-
return -1;
300-
if (dpiMsgProps_setOriginalMsgId(props->handle, value,
301-
(uint32_t) valueLength) < 0)
302-
return cxoError_raiseAndReturnInt();
303-
return 0;
304-
}
305-
306-
307288
//-----------------------------------------------------------------------------
308289
// cxoMsgProps_setPriority()
309290
// Set the value of the expiration property.
@@ -339,8 +320,7 @@ static PyGetSetDef cxoCalcMembers[] = {
339320
(setter) cxoMsgProps_setExceptionQ, 0, 0 },
340321
{ "expiration", (getter) cxoMsgProps_getExpiration,
341322
(setter) cxoMsgProps_setExpiration, 0, 0 },
342-
{ "msgid", (getter) cxoMsgProps_getOriginalMsgId,
343-
(setter) cxoMsgProps_setOriginalMsgId, 0, 0 },
323+
{ "msgid", (getter) cxoMsgProps_getMsgId, 0, 0, 0 },
344324
{ "priority", (getter) cxoMsgProps_getPriority,
345325
(setter) cxoMsgProps_setPriority, 0, 0 },
346326
{ "state", (getter) cxoMsgProps_getState, 0, 0, 0 },

test/test_2700_aq.py

Lines changed: 0 additions & 1 deletion

0 commit comments

Comments
 (0)