diff --git a/1164.patch b/1164.patch new file mode 100644 index 0000000..0f0c3e7 --- /dev/null +++ b/1164.patch @@ -0,0 +1,41 @@ +From 302cd2b4b101990483ee30dee6473890d0095e99 Mon Sep 17 00:00:00 2001 +From: Augusto Caringi +Date: Thu, 20 Jul 2017 15:07:16 +0200 +Subject: [PATCH] db_mysql: fix build against MariaDB 10.2 + +Fixes the following build error while building against MariaDB 10.2 +library: + +my_con.c: In function 'db_mysql_connect': +my_con.c:68:10: error: 'MYSQL {aka struct st_mysql}' has no member named +'reconnect' +ptr->con->reconnect = 0; + ^~ + +In this new version of the library the reconnect field was moved to +another struct. Setting it through API seems to be a better approach. +--- + modules/db_mysql/my_con.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules/db_mysql/my_con.c b/modules/db_mysql/my_con.c +index ba1a7379b..d93287304 100644 +--- a/modules/db_mysql/my_con.c ++++ b/modules/db_mysql/my_con.c +@@ -34,6 +34,7 @@ extern struct tls_domain *tls_dom; + + int db_mysql_connect(struct my_con* ptr) + { ++ my_bool reconnect = 0; + /* if connection already in use, close it first*/ + if (ptr->init) + mysql_close(ptr->con); +@@ -81,7 +82,7 @@ int db_mysql_connect(struct my_con* ptr) + return -1; + } + /* force no auto reconnection */ +- ptr->con->reconnect = 0; ++ mysql_options(ptr->con, MYSQL_OPT_RECONNECT, &reconnect); + + LM_DBG("connection type is %s\n", mysql_get_host_info(ptr->con)); + LM_DBG("protocol version is %d\n", mysql_get_proto_info(ptr->con)); diff --git a/opensips.spec b/opensips.spec index 8d11550..ce2f8ac 100644 --- a/opensips.spec +++ b/opensips.spec @@ -5,7 +5,7 @@ Summary: Open Source SIP Server Name: opensips Version: 2.2.3 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ Group: System Environment/Daemons Source0: https://github.com/%{name}/%{name}/archive/%{version}/%{name}-%{version}.tar.gz @@ -27,6 +27,10 @@ Patch11: opensips-0011-Finalize-OpenSSL-1.1.0-migration.patch # Don't setup our own CFLAGS Patch12: opensips-0012-Dont-try-modifying-CFLAGS.patch +# Fix build with MariaDB 10.2 +# https://patch-diff.githubusercontent.com/raw/OpenSIPS/opensips/pull/1164 +Patch13: 1164.patch + URL: https://opensips.org BuildRequires: expat-devel @@ -1348,6 +1352,9 @@ useradd -r -g %{name} -d %{_localstatedir}/run/%{name} -s /sbin/nologin \ %doc docdir/README.xmpp %changelog +* Thu Jul 20 2017 Adam Williamson - 2.2.3-4 +- Rebuild against MariaDB 10.2 + * Sun Jun 04 2017 Jitka Plesnikova - 2.2.3-3 - Perl 5.26 rebuild