user [email protected]
usertags 1137169 python3.15
tags 1137169 patch
thanks

Hi!

While rebuilding the python related packages against the Python 3.15rc2
version I ran into this FTBFS [1].

To fix this, I've added a patch to support odpi-c 6.

I've applied these fixes in the sandbox [2] to verify that it builds
successfully, these should be applied in Debian to get the package back
to a healthy state.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4653068/
[2]: https://debusine.debian.net/debian/r-python-python3.15/

--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
Description: Fix compatibility with ODPI-C >= 5.0 and 6.0
Author: Maximiliano Curia <[email protected]>
Forwarded: not-needed

Index: python-cx-oracle/src/cxoConnection.c
===================================================================
--- python-cx-oracle.orig/src/cxoConnection.c
+++ python-cx-oracle/src/cxoConnection.c
@@ -1014,12 +1014,19 @@ static PyObject *cxoConnection_begin(cxo
         return NULL;
 
     // begin the distributed transaction
-    Py_BEGIN_ALLOW_THREADS
-    status = dpiConn_beginDistribTrans(conn->handle, formatId, transactionId,
-            transactionIdLength, branchId, branchIdLength);
-    Py_END_ALLOW_THREADS
-    if (status < 0)
-        return cxoError_raiseAndReturnNull();
+    if (formatId >= 0) {
+        dpiXid xid;
+        xid.formatId = formatId;
+        xid.globalTransactionId = transactionId;
+        xid.globalTransactionIdLength = transactionIdLength;
+        xid.branchQualifier = branchId;
+        xid.branchQualifierLength = branchIdLength;
+        Py_BEGIN_ALLOW_THREADS
+        status = dpiConn_tpcBegin(conn->handle, &xid, 0, DPI_TPC_BEGIN_NEW);
+        Py_END_ALLOW_THREADS
+        if (status < 0)
+            return cxoError_raiseAndReturnNull();
+    }
 
     Py_RETURN_NONE;
 }
@@ -1039,7 +1046,7 @@ static PyObject *cxoConnection_prepare(c
 
     // perform the prepare
     Py_BEGIN_ALLOW_THREADS
-    status = dpiConn_prepareDistribTrans(conn->handle, &commitNeeded);
+    status = dpiConn_tpcPrepare(conn->handle, NULL, &commitNeeded);
     Py_END_ALLOW_THREADS
     if (status < 0)
         return cxoError_raiseAndReturnNull();
Index: python-cx-oracle/src/cxoSodaDatabase.c
===================================================================
--- python-cx-oracle.orig/src/cxoSodaDatabase.c
+++ python-cx-oracle/src/cxoSodaDatabase.c
@@ -211,7 +211,7 @@ static PyObject *cxoSodaDatabase_getColl
 {
     static char *keywordList[] = { "startName", "limit", NULL };
     PyObject *startName, *result, *temp;
-    dpiSodaCollNames collNames;
+    dpiStringList collNames;
     cxoBuffer startNameBuffer;
     uint32_t limit, i, flags;
     const char *encoding;
@@ -240,11 +240,11 @@ static PyObject *cxoSodaDatabase_getColl
         return cxoError_raiseAndReturnNull();
 
     // transform results into a Python list
-    result = PyList_New(collNames.numNames);
+    result = PyList_New(collNames.numStrings);
     if (!result)
         return NULL;
-    for (i = 0; i < collNames.numNames; i++) {
-        temp = PyUnicode_Decode(collNames.names[i], collNames.nameLengths[i],
+    for (i = 0; i < collNames.numStrings; i++) {
+        temp = PyUnicode_Decode(collNames.strings[i], collNames.stringLengths[i],
                 encoding, NULL);
         if (!temp) {
             Py_DECREF(result);
@@ -252,7 +252,7 @@ static PyObject *cxoSodaDatabase_getColl
         }
         PyList_SET_ITEM(result, i, temp);
     }
-    if (dpiSodaDb_freeCollectionNames(db->handle, &collNames) < 0) {
+    if (dpiContext_freeStringList(cxoDpiContext, &collNames) < 0) {
         Py_DECREF(result);
         return cxoError_raiseAndReturnNull();
     }

Reply via email to