diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2019-03-06 01:12:58 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-03-07 09:33:45 -0800 |
commit | 5173929d7f974943110fc28814c49931e14a81c5 (patch) | |
tree | 3afe163462f360ef7d39564b408418946f9862ad /meta-oe/recipes-dbs | |
parent | 14bf885618c426b018a6af8ff6cd7160d3fc1747 (diff) | |
download | meta-openembedded-5173929d7f974943110fc28814c49931e14a81c5.tar.gz |
mysql-python: fix compilation with MariaDB 10.3.13
Use standard API function MYSQL_OPT_RECONNECT
instead of direct modification of internal structures
which does not work for MariaDB to fix below compile
issue.
| _mysql.c: In function '_mysql_ConnectionObject_ping':
| _mysql.c:2005:41: error: 'MYSQL' {aka 'struct st_mysql'} has no member named 'reconnect'
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-dbs')
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch | 34 | ||||
-rw-r--r-- | meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb | 4 |
2 files changed, 37 insertions, 1 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch b/meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch new file mode 100644 index 000000000..173241ea5 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 45436592aa64308b2ab46f84c6107c6d7de0a3ec Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Wed, 6 Mar 2019 00:16:17 -0800 | ||
4 | Subject: [PATCH] _mysql.c: fix compilation with MariaDB 10.3.13 | ||
5 | |||
6 | Use standard API function MYSQL_OPT_RECONNECT | ||
7 | instead of direct modification of internal structures | ||
8 | which does not work for MariaDB. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
13 | --- | ||
14 | _mysql.c | 9 ++++++++- | ||
15 | 1 file changed, 8 insertions(+), 1 deletion(-) | ||
16 | |||
17 | --- a/_mysql.c | ||
18 | +++ b/_mysql.c | ||
19 | @@ -2002,7 +2002,14 @@ _mysql_ConnectionObject_ping( | ||
20 | int r, reconnect = -1; | ||
21 | if (!PyArg_ParseTuple(args, "|I", &reconnect)) return NULL; | ||
22 | check_connection(self); | ||
23 | - if ( reconnect != -1 ) self->connection.reconnect = reconnect; | ||
24 | + if ( reconnect != -1 ) { | ||
25 | +#if MYSQL_VERSION_ID >= 50013 | ||
26 | + my_bool recon = reconnect; | ||
27 | + mysql_options(&self->connection, MYSQL_OPT_RECONNECT, &recon); | ||
28 | +#else | ||
29 | + self->connection.reconnect = reconnect; | ||
30 | +#endif | ||
31 | + } | ||
32 | Py_BEGIN_ALLOW_THREADS | ||
33 | r = mysql_ping(&(self->connection)); | ||
34 | Py_END_ALLOW_THREADS | ||
diff --git a/meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb b/meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb index ac0df4f06..f2faec1c1 100644 --- a/meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb +++ b/meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb | |||
@@ -8,7 +8,9 @@ DEPENDS = "mysql5" | |||
8 | 8 | ||
9 | SRCNAME = "MySQL-python" | 9 | SRCNAME = "MySQL-python" |
10 | 10 | ||
11 | SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip" | 11 | SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip \ |
12 | file://0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch \ | ||
13 | " | ||
12 | SRC_URI[md5sum] = "654f75b302db6ed8dc5a898c625e030c" | 14 | SRC_URI[md5sum] = "654f75b302db6ed8dc5a898c625e030c" |
13 | SRC_URI[sha256sum] = "811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74" | 15 | SRC_URI[sha256sum] = "811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74" |
14 | 16 | ||