All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] mysql-python: fix compilation with MariaDB 10.3.13
@ 2019-03-06  9:12 mingli.yu
  2019-03-07 15:29 ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: mingli.yu @ 2019-03-06  9:12 UTC (permalink / raw)
  To: raj.khem, openembedded-devel

From: Mingli Yu <mingli.yu@windriver.com>

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>
---
 ...ompilation-with-MariaDB-with-10.3.13.patch | 39 +++++++++++++++++++
 .../recipes-dbs/mysql/mysql-python_1.2.5.bb   |  4 +-
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch

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..b816618c7
--- /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,39 @@
+From 45436592aa64308b2ab46f84c6107c6d7de0a3ec Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Wed, 6 Mar 2019 00:16:17 -0800
+Subject: [PATCH] _mysql.c: 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.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ _mysql.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/_mysql.c b/_mysql.c
+index f081346..2262e9e 100644
+--- a/_mysql.c
++++ b/_mysql.c
+@@ -2002,7 +2002,14 @@ _mysql_ConnectionObject_ping(
+ 	int r, reconnect = -1;
+ 	if (!PyArg_ParseTuple(args, "|I", &reconnect)) return NULL;
+ 	check_connection(self);
+-	if ( reconnect != -1 ) self->connection.reconnect = reconnect;
++	if ( reconnect != -1 ) {
++             #if MYSQL_VERSION_ID >= 50013
++		 my_bool recon = reconnect;
++		 mysql_options(&self->connection, MYSQL_OPT_RECONNECT, &recon);
++             #else
++                 self->connection.reconnect = reconnect;
++             #endif
++        }
+ 	Py_BEGIN_ALLOW_THREADS
+ 	r = mysql_ping(&(self->connection));
+ 	Py_END_ALLOW_THREADS
+-- 
+2.17.1
+
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"
 
 SRCNAME = "MySQL-python"
 
-SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip"
+SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip \
+           file://0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch \
+"
 SRC_URI[md5sum] = "654f75b302db6ed8dc5a898c625e030c"
 SRC_URI[sha256sum] = "811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74"
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [meta-oe][PATCH] mysql-python: fix compilation with MariaDB 10.3.13
  2019-03-06  9:12 [meta-oe][PATCH] mysql-python: fix compilation with MariaDB 10.3.13 mingli.yu
@ 2019-03-07 15:29 ` Khem Raj
  2019-03-08  2:50   ` Yu, Mingli
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2019-03-07 15:29 UTC (permalink / raw)
  To: Mingli Yu; +Cc: openembeded-devel

Applying patch 0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch
patching file _mysql.c
Hunk #1 FAILED at 2002 (different line endings).
1 out of 1 hunk FAILED -- saving rejects to file _mysql.c.rej

On Wed, Mar 6, 2019 at 1:12 AM <mingli.yu@windriver.com> wrote:
>
> From: Mingli Yu <mingli.yu@windriver.com>
>
> 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>
> ---
>  ...ompilation-with-MariaDB-with-10.3.13.patch | 39 +++++++++++++++++++
>  .../recipes-dbs/mysql/mysql-python_1.2.5.bb   |  4 +-
>  2 files changed, 42 insertions(+), 1 deletion(-)
>  create mode 100644 meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch
>
> 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..b816618c7
> --- /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,39 @@
> +From 45436592aa64308b2ab46f84c6107c6d7de0a3ec Mon Sep 17 00:00:00 2001
> +From: Mingli Yu <mingli.yu@windriver.com>
> +Date: Wed, 6 Mar 2019 00:16:17 -0800
> +Subject: [PATCH] _mysql.c: 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.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> +---
> + _mysql.c | 9 ++++++++-
> + 1 file changed, 8 insertions(+), 1 deletion(-)
> +
> +diff --git a/_mysql.c b/_mysql.c
> +index f081346..2262e9e 100644
> +--- a/_mysql.c
> ++++ b/_mysql.c
> +@@ -2002,7 +2002,14 @@ _mysql_ConnectionObject_ping(
> +       int r, reconnect = -1;
> +       if (!PyArg_ParseTuple(args, "|I", &reconnect)) return NULL;
> +       check_connection(self);
> +-      if ( reconnect != -1 ) self->connection.reconnect = reconnect;
> ++      if ( reconnect != -1 ) {
> ++             #if MYSQL_VERSION_ID >= 50013
> ++               my_bool recon = reconnect;
> ++               mysql_options(&self->connection, MYSQL_OPT_RECONNECT, &recon);
> ++             #else
> ++                 self->connection.reconnect = reconnect;
> ++             #endif
> ++        }
> +       Py_BEGIN_ALLOW_THREADS
> +       r = mysql_ping(&(self->connection));
> +       Py_END_ALLOW_THREADS
> +--
> +2.17.1
> +
> 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"
>
>  SRCNAME = "MySQL-python"
>
> -SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip"
> +SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip \
> +           file://0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch \
> +"
>  SRC_URI[md5sum] = "654f75b302db6ed8dc5a898c625e030c"
>  SRC_URI[sha256sum] = "811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74"
>
> --
> 2.17.1
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-oe][PATCH] mysql-python: fix compilation with MariaDB 10.3.13
  2019-03-07 15:29 ` Khem Raj
@ 2019-03-08  2:50   ` Yu, Mingli
  2019-03-08  3:44     ` Yu, Mingli
  0 siblings, 1 reply; 5+ messages in thread
From: Yu, Mingli @ 2019-03-08  2:50 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel



On 2019年03月07日 23:29, Khem Raj wrote:
> Applying patch 0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch
> patching file _mysql.c
> Hunk #1 FAILED at 2002 (different line endings).
> 1 out of 1 hunk FAILED -- saving rejects to file _mysql.c.rej

Hi Khem,

It's strange that I can't reproduce the Hunk issue as you mentioned 
while I pull the commit[5173929d7 mysql-python: fix compilation with 
MariaDB 10.3.13] from master-next.

Does this issue still exist in your env?

Thanks,

>
> On Wed, Mar 6, 2019 at 1:12 AM <mingli.yu@windriver.com> wrote:
>>
>> From: Mingli Yu <mingli.yu@windriver.com>
>>
>> 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>
>> ---
>>   ...ompilation-with-MariaDB-with-10.3.13.patch | 39 +++++++++++++++++++
>>   .../recipes-dbs/mysql/mysql-python_1.2.5.bb   |  4 +-
>>   2 files changed, 42 insertions(+), 1 deletion(-)
>>   create mode 100644 meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch
>>
>> 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..b816618c7
>> --- /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,39 @@
>> +From 45436592aa64308b2ab46f84c6107c6d7de0a3ec Mon Sep 17 00:00:00 2001
>> +From: Mingli Yu <mingli.yu@windriver.com>
>> +Date: Wed, 6 Mar 2019 00:16:17 -0800
>> +Subject: [PATCH] _mysql.c: 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.
>> +
>> +Upstream-Status: Pending
>> +
>> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>> +---
>> + _mysql.c | 9 ++++++++-
>> + 1 file changed, 8 insertions(+), 1 deletion(-)
>> +
>> +diff --git a/_mysql.c b/_mysql.c
>> +index f081346..2262e9e 100644
>> +--- a/_mysql.c
>> ++++ b/_mysql.c
>> +@@ -2002,7 +2002,14 @@ _mysql_ConnectionObject_ping(
>> +       int r, reconnect = -1;
>> +       if (!PyArg_ParseTuple(args, "|I", &reconnect)) return NULL;
>> +       check_connection(self);
>> +-      if ( reconnect != -1 ) self->connection.reconnect = reconnect;
>> ++      if ( reconnect != -1 ) {
>> ++             #if MYSQL_VERSION_ID >= 50013
>> ++               my_bool recon = reconnect;
>> ++               mysql_options(&self->connection, MYSQL_OPT_RECONNECT, &recon);
>> ++             #else
>> ++                 self->connection.reconnect = reconnect;
>> ++             #endif
>> ++        }
>> +       Py_BEGIN_ALLOW_THREADS
>> +       r = mysql_ping(&(self->connection));
>> +       Py_END_ALLOW_THREADS
>> +--
>> +2.17.1
>> +
>> 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"
>>
>>   SRCNAME = "MySQL-python"
>>
>> -SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip"
>> +SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip \
>> +           file://0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch \
>> +"
>>   SRC_URI[md5sum] = "654f75b302db6ed8dc5a898c625e030c"
>>   SRC_URI[sha256sum] = "811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74"
>>
>> --
>> 2.17.1
>>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-oe][PATCH] mysql-python: fix compilation with MariaDB 10.3.13
  2019-03-08  2:50   ` Yu, Mingli
@ 2019-03-08  3:44     ` Yu, Mingli
  2019-03-08  4:33       ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Yu, Mingli @ 2019-03-08  3:44 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel

BTW, what's the patch version on your system?

On my system:
---------------------------------------------------------
$ patch --version
GNU patch 2.7.5
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
Copyright (C) 1988 Larry Wall

License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Larry Wall and Paul Eggert
---------------------------------------------------------

Thanks,


On 2019年03月08日 10:50, Yu, Mingli wrote:
>
>
> On 2019年03月07日 23:29, Khem Raj wrote:
>> Applying patch
>> 0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch
>> patching file _mysql.c
>> Hunk #1 FAILED at 2002 (different line endings).
>> 1 out of 1 hunk FAILED -- saving rejects to file _mysql.c.rej
>
> Hi Khem,
>
> It's strange that I can't reproduce the Hunk issue as you mentioned
> while I pull the commit[5173929d7 mysql-python: fix compilation with
> MariaDB 10.3.13] from master-next.
>
> Does this issue still exist in your env?
>
> Thanks,
>
>>
>> On Wed, Mar 6, 2019 at 1:12 AM <mingli.yu@windriver.com> wrote:
>>>
>>> From: Mingli Yu <mingli.yu@windriver.com>
>>>
>>> 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>
>>> ---
>>>   ...ompilation-with-MariaDB-with-10.3.13.patch | 39 +++++++++++++++++++
>>>   .../recipes-dbs/mysql/mysql-python_1.2.5.bb   |  4 +-
>>>   2 files changed, 42 insertions(+), 1 deletion(-)
>>>   create mode 100644
>>> meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch
>>>
>>>
>>> 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..b816618c7
>>> --- /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,39 @@
>>> +From 45436592aa64308b2ab46f84c6107c6d7de0a3ec Mon Sep 17 00:00:00 2001
>>> +From: Mingli Yu <mingli.yu@windriver.com>
>>> +Date: Wed, 6 Mar 2019 00:16:17 -0800
>>> +Subject: [PATCH] _mysql.c: 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.
>>> +
>>> +Upstream-Status: Pending
>>> +
>>> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>>> +---
>>> + _mysql.c | 9 ++++++++-
>>> + 1 file changed, 8 insertions(+), 1 deletion(-)
>>> +
>>> +diff --git a/_mysql.c b/_mysql.c
>>> +index f081346..2262e9e 100644
>>> +--- a/_mysql.c
>>> ++++ b/_mysql.c
>>> +@@ -2002,7 +2002,14 @@ _mysql_ConnectionObject_ping(
>>> +       int r, reconnect = -1;
>>> +       if (!PyArg_ParseTuple(args, "|I", &reconnect)) return NULL;
>>> +       check_connection(self);
>>> +-      if ( reconnect != -1 ) self->connection.reconnect = reconnect;
>>> ++      if ( reconnect != -1 ) {
>>> ++             #if MYSQL_VERSION_ID >= 50013
>>> ++               my_bool recon = reconnect;
>>> ++               mysql_options(&self->connection,
>>> MYSQL_OPT_RECONNECT, &recon);
>>> ++             #else
>>> ++                 self->connection.reconnect = reconnect;
>>> ++             #endif
>>> ++        }
>>> +       Py_BEGIN_ALLOW_THREADS
>>> +       r = mysql_ping(&(self->connection));
>>> +       Py_END_ALLOW_THREADS
>>> +--
>>> +2.17.1
>>> +
>>> 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"
>>>
>>>   SRCNAME = "MySQL-python"
>>>
>>> -SRC_URI =
>>> "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip"
>>>
>>> +SRC_URI =
>>> "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip
>>> \
>>> +
>>> file://0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch \
>>> +"
>>>   SRC_URI[md5sum] = "654f75b302db6ed8dc5a898c625e030c"
>>>   SRC_URI[sha256sum] =
>>> "811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74"
>>>
>>> --
>>> 2.17.1
>>>
>>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-oe][PATCH] mysql-python: fix compilation with MariaDB 10.3.13
  2019-03-08  3:44     ` Yu, Mingli
@ 2019-03-08  4:33       ` Khem Raj
  0 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2019-03-08  4:33 UTC (permalink / raw)
  To: Yu, Mingli; +Cc: openembeded-devel



On 3/7/19 7:44 PM, Yu, Mingli wrote:
> BTW, what's the patch version on your system?
> 

It was failing across multiple machines. So the patch that reached 
patchwork was definitely corrupt.

I use git am to apply the patches from mbox folders. I have fixed this 
locally.

I have fixed it and is available on master-next

> On my system:
> ---------------------------------------------------------
> $ patch --version
> GNU patch 2.7.5
> Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
> Copyright (C) 1988 Larry Wall
> 
> License GPLv3+: GNU GPL version 3 or later 
> <http://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Written by Larry Wall and Paul Eggert
> ---------------------------------------------------------
> 
> Thanks,
> 
> 
> On 2019年03月08日 10:50, Yu, Mingli wrote:
>>
>>
>> On 2019年03月07日 23:29, Khem Raj wrote:
>>> Applying patch
>>> 0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch
>>> patching file _mysql.c
>>> Hunk #1 FAILED at 2002 (different line endings).
>>> 1 out of 1 hunk FAILED -- saving rejects to file _mysql.c.rej
>>
>> Hi Khem,
>>
>> It's strange that I can't reproduce the Hunk issue as you mentioned
>> while I pull the commit[5173929d7 mysql-python: fix compilation with
>> MariaDB 10.3.13] from master-next.
>>
>> Does this issue still exist in your env?
>>
>> Thanks,
>>
>>>
>>> On Wed, Mar 6, 2019 at 1:12 AM <mingli.yu@windriver.com> wrote:
>>>>
>>>> From: Mingli Yu <mingli.yu@windriver.com>
>>>>
>>>> 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>
>>>> ---
>>>>   ...ompilation-with-MariaDB-with-10.3.13.patch | 39 
>>>> +++++++++++++++++++
>>>>   .../recipes-dbs/mysql/mysql-python_1.2.5.bb   |  4 +-
>>>>   2 files changed, 42 insertions(+), 1 deletion(-)
>>>>   create mode 100644
>>>> meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch 
>>>>
>>>>
>>>>
>>>> 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..b816618c7
>>>> --- /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,39 @@
>>>> +From 45436592aa64308b2ab46f84c6107c6d7de0a3ec Mon Sep 17 00:00:00 2001
>>>> +From: Mingli Yu <mingli.yu@windriver.com>
>>>> +Date: Wed, 6 Mar 2019 00:16:17 -0800
>>>> +Subject: [PATCH] _mysql.c: 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.
>>>> +
>>>> +Upstream-Status: Pending
>>>> +
>>>> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>>>> +---
>>>> + _mysql.c | 9 ++++++++-
>>>> + 1 file changed, 8 insertions(+), 1 deletion(-)
>>>> +
>>>> +diff --git a/_mysql.c b/_mysql.c
>>>> +index f081346..2262e9e 100644
>>>> +--- a/_mysql.c
>>>> ++++ b/_mysql.c
>>>> +@@ -2002,7 +2002,14 @@ _mysql_ConnectionObject_ping(
>>>> +       int r, reconnect = -1;
>>>> +       if (!PyArg_ParseTuple(args, "|I", &reconnect)) return NULL;
>>>> +       check_connection(self);
>>>> +-      if ( reconnect != -1 ) self->connection.reconnect = reconnect;
>>>> ++      if ( reconnect != -1 ) {
>>>> ++             #if MYSQL_VERSION_ID >= 50013
>>>> ++               my_bool recon = reconnect;
>>>> ++               mysql_options(&self->connection,
>>>> MYSQL_OPT_RECONNECT, &recon);
>>>> ++             #else
>>>> ++                 self->connection.reconnect = reconnect;
>>>> ++             #endif
>>>> ++        }
>>>> +       Py_BEGIN_ALLOW_THREADS
>>>> +       r = mysql_ping(&(self->connection));
>>>> +       Py_END_ALLOW_THREADS
>>>> +--
>>>> +2.17.1
>>>> +
>>>> 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"
>>>>
>>>>   SRCNAME = "MySQL-python"
>>>>
>>>> -SRC_URI =
>>>> "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip" 
>>>>
>>>>
>>>> +SRC_URI =
>>>> "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip 
>>>>
>>>> \
>>>> +
>>>> file://0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch \
>>>> +"
>>>>   SRC_URI[md5sum] = "654f75b302db6ed8dc5a898c625e030c"
>>>>   SRC_URI[sha256sum] =
>>>> "811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74"
>>>>
>>>> -- 
>>>> 2.17.1
>>>>
>>>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-08  4:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06  9:12 [meta-oe][PATCH] mysql-python: fix compilation with MariaDB 10.3.13 mingli.yu
2019-03-07 15:29 ` Khem Raj
2019-03-08  2:50   ` Yu, Mingli
2019-03-08  3:44     ` Yu, Mingli
2019-03-08  4:33       ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.