All of lore.kernel.org
 help / color / mirror / Atom feed
From: <mingli.yu@windriver.com>
To: <raj.khem@gmail.com>, <randy.macleod@windriver.com>,
	<openembedded-devel@lists.openembedded.org>
Subject: [meta-oe][PATCH 2/2] libdbd-mysql-perl: fix do_compile failure
Date: Mon, 4 Mar 2019 21:28:59 -0800	[thread overview]
Message-ID: <20190305052859.14220-2-mingli.yu@windriver.com> (raw)
In-Reply-To: <20190305052859.14220-1-mingli.yu@windriver.com>

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

After mariadb upgrade to 10.3.13, there comes
below do_compile failure for libdbd-mysql-perl:
| dbdimp.c: In function 'mysql_dr_connect':
| dbdimp.c:2000:13: error: 'MYSQL' {aka 'struct st_mysql'} has no member named 'reconnect'
|        result->reconnect=0;

Backport a patch to fix it.

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 .../0001-Use-API-function-for-reconnect.patch | 53 +++++++++++++++++++
 .../perl/libdbd-mysql-perl_4.043.bb           |  1 +
 2 files changed, 54 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/perl/libdbd-mysql-perl/0001-Use-API-function-for-reconnect.patch

diff --git a/meta-oe/recipes-devtools/perl/libdbd-mysql-perl/0001-Use-API-function-for-reconnect.patch b/meta-oe/recipes-devtools/perl/libdbd-mysql-perl/0001-Use-API-function-for-reconnect.patch
new file mode 100644
index 000000000..60d88c3d1
--- /dev/null
+++ b/meta-oe/recipes-devtools/perl/libdbd-mysql-perl/0001-Use-API-function-for-reconnect.patch
@@ -0,0 +1,53 @@
+From edb6b202b7e233864aa5dd84532646c50097b0b8 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Mon, 4 Mar 2019 00:49:17 -0800
+Subject: [PATCH] Use API function for reconnect
+
+For configuring reconnect functionality use standard API function
+MYSQL_OPT_RECONNECT instead of direct modification of internal structures
+which does not work for MariaDB. Fixes compilation with MariaDB 10.2.6+.
+
+Upstream-Status: Backport [https://github.com/perl5-dbi/DBD-mysql/commit/0b1884f4153d3de0a91bae4d3b3cc1771ffdf4f3]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ dbdimp.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/dbdimp.c b/dbdimp.c
+index 9b8b313..3bed213 100644
+--- a/dbdimp.c
++++ b/dbdimp.c
+@@ -1979,6 +1979,16 @@ MYSQL *mysql_dr_connect(
+ 
+     if (result)
+     {
++      /*
++        we turn off Mysql's auto reconnect and handle re-connecting ourselves
++        so that we can keep track of when this happens.
++      */
++#if MYSQL_VERSION_ID >= 50013
++      my_bool reconnect = FALSE;
++      mysql_options(result, MYSQL_OPT_RECONNECT, &reconnect);
++#else
++      result->reconnect = 0;
++#endif
+ #if MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION
+       /* connection succeeded. */
+       /* imp_dbh == NULL when mysql_dr_connect() is called from mysql.xs
+@@ -1992,12 +2002,6 @@ MYSQL *mysql_dr_connect(
+           imp_dbh->async_query_in_flight = NULL;
+       }
+ #endif
+-
+-      /*
+-        we turn off Mysql's auto reconnect and handle re-connecting ourselves
+-        so that we can keep track of when this happens.
+-      */
+-      result->reconnect=0;
+     }
+     else {
+       /* 
+-- 
+2.17.1
+
diff --git a/meta-oe/recipes-devtools/perl/libdbd-mysql-perl_4.043.bb b/meta-oe/recipes-devtools/perl/libdbd-mysql-perl_4.043.bb
index bd8ba780a..e185f48f7 100644
--- a/meta-oe/recipes-devtools/perl/libdbd-mysql-perl_4.043.bb
+++ b/meta-oe/recipes-devtools/perl/libdbd-mysql-perl_4.043.bb
@@ -15,6 +15,7 @@ DEPENDS += "libdbi-perl-native libmysqlclient"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=d0a06964340e5c0cde88b7af611f755c"
 
 SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MI/MICHIELB/DBD-mysql-${PV}.tar.gz \
+           file://0001-Use-API-function-for-reconnect.patch \
 "
 
 SRC_URI[md5sum] = "4a00dd7f1c057931147c65dfc4901c36"
-- 
2.17.1



  reply	other threads:[~2019-03-05  5:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05  5:28 [meta-oe][PATCH 1/2] mariadb: Upgrade to 10.3.13 mingli.yu
2019-03-05  5:28 ` mingli.yu [this message]
2019-03-05 18:26 ` Khem Raj
2019-03-06  4:29   ` Yu, Mingli
2019-03-06  5:35     ` Khem Raj
2019-03-06  5:40       ` Khem Raj
2019-03-06  6:05         ` Yu, Mingli
2019-03-06  6:04       ` Yu, Mingli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190305052859.14220-2-mingli.yu@windriver.com \
    --to=mingli.yu@windriver.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    --cc=randy.macleod@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.