[packages/python-mysql-connector] Rel 2; python 3.10 support
arekm
arekm at pld-linux.org
Thu Apr 28 16:24:07 CEST 2022
commit 49338774cddf6d1dbf3075390e3436fa3d2ee72a
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Apr 28 16:23:06 2022 +0200
Rel 2; python 3.10 support
py10.patch | 60 +++++++++++++++++++++++++++++++++++++++++++++
python-mysql-connector.spec | 4 ++-
2 files changed, 63 insertions(+), 1 deletion(-)
---
diff --git a/python-mysql-connector.spec b/python-mysql-connector.spec
index cef54d8..b6d210b 100644
--- a/python-mysql-connector.spec
+++ b/python-mysql-connector.spec
@@ -13,7 +13,7 @@ Name: python-%{pname}
# check documentation to see which version is GA (we don't want devel releases)
# https://dev.mysql.com/downloads/connector/python/
Version: 8.0.23
-Release: 1
+Release: 2
License: GPL v2
Group: Libraries/Python
# Source0: http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-%{version}-src.tar.gz
@@ -22,6 +22,7 @@ Source0: https://pypi.debian.net/mysql-connector-python/mysql-connector-python-%
Patch0: force-capi.patch
Patch1: tests.patch
Patch2: build.patch
+Patch3: py10.patch
URL: http://dev.mysql.com/doc/connector-python/en/
BuildRequires: mysql-devel
BuildRequires: protobuf-devel >= 3.0.0
@@ -78,6 +79,7 @@ biblioteki MySQL-a, ani żadna kompilacja.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%build
export MYSQLXPB_PROTOC=%{_bindir}/protoc
diff --git a/py10.patch b/py10.patch
new file mode 100644
index 0000000..dff0c88
--- /dev/null
+++ b/py10.patch
@@ -0,0 +1,60 @@
+commit 72cd03112f6ba581a0c16cda40490154b661460c
+Author: Nuno Mariz <nuno.mariz at oracle.com>
+Date: Wed Sep 29 15:43:13 2021 +0100
+
+ WL#14813: Add support for Python 3.10
+
+diff --git a/src/mysql_capi.c b/src/mysql_capi.c
+index 0c1c6c0..b196488 100644
+--- a/src/mysql_capi.c
++++ b/src/mysql_capi.c
+@@ -28,6 +28,8 @@
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#define PY_SSIZE_T_CLEAN 1
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <time.h>
+@@ -2116,7 +2116,8 @@ PyObject*
+ MySQL_query(MySQL *self, PyObject *args, PyObject *kwds)
+ {
+ PyObject *buffered= NULL, *raw= NULL, *raw_as_string= NULL;
+- int res= 0, stmt_length;
++ int res= 0;
++ Py_ssize_t stmt_length;
+ char *stmt= NULL;
+ static char *kwlist[]=
+ {
+diff --git a/src/mysqlxpb/mysqlxpb.cc b/src/mysqlxpb/mysqlxpb.cc
+index 30cdcc8..c2b37e7 100644
+--- a/src/mysqlxpb/mysqlxpb.cc
++++ b/src/mysqlxpb/mysqlxpb.cc
+@@ -28,6 +28,8 @@
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#define PY_SSIZE_T_CLEAN 1
++
+ #include "python_cast.h"
+ #include "python.h"
+ #include "mysqlx/mysqlx.pb.h"
+@@ -791,7 +793,7 @@ static PyObject* ParseMessage(PyObject* self, PyObject* args) {
+ PyObject* result = NULL;
+ const char* type_name;
+ const char* data;
+- int data_size;
++ Py_ssize_t data_size;
+
+ if (PyArg_ParseTuple(args, "ss#", &type_name, &data, &data_size))
+ result = ParseMessageImpl(type_name, data, data_size);
+@@ -849,7 +851,7 @@ static PyObject* ParseServerMessage(PyObject* self, PyObject* args) {
+ PyObject* result = NULL;
+ int type;
+ const char* message_data;
+- int message_data_size;
++ Py_ssize_t message_data_size;
+
+ if (PyArg_ParseTuple(args, "is#", &type, &message_data, &message_data_size))
+ {
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-mysql-connector.git/commitdiff/49338774cddf6d1dbf3075390e3436fa3d2ee72a
More information about the pld-cvs-commit
mailing list