Fix for new version of MariaDB 10.2 (bug #1470196)

This commit is contained in:
Jitka Plesnikova 2017-07-14 14:40:04 +02:00
parent 2fb65c0eb5
commit 2fd4382d13
2 changed files with 81 additions and 1 deletions

View File

@ -0,0 +1,74 @@
From 60d57caa60ee925b3596c45c461ae260a2550502 Mon Sep 17 00:00:00 2001
From: Jitka Plesnikova <jplesnik@redhat.com>
Date: Fri, 14 Jul 2017 14:13:50 +0200
Subject: [PATCH] Fix build failures for MariaDB 10.2
---
dbdimp.c | 7 +++++++
dbdimp.h | 1 +
mysql.xs | 4 ++--
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dbdimp.c b/dbdimp.c
index 9b8b313..fa628b0 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -1979,6 +1979,9 @@ MYSQL *mysql_dr_connect(
if (result)
{
+#if MYSQL_VERSION_ID >= 50013
+ my_bool reconnect= 1;
+#endif
#if MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION
/* connection succeeded. */
/* imp_dbh == NULL when mysql_dr_connect() is called from mysql.xs
@@ -1997,7 +2000,11 @@ MYSQL *mysql_dr_connect(
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
+ mysql_options(result, MYSQL_OPT_RECONNECT, &reconnect);
+#else
result->reconnect=0;
+#endif
}
else {
/*
diff --git a/dbdimp.h b/dbdimp.h
index 935256e..3a5fcaa 100644
--- a/dbdimp.h
+++ b/dbdimp.h
@@ -20,6 +20,7 @@
#include <DBIXS.h> /* installed by the DBI module */
#include <mysql.h> /* Comes with MySQL-devel */
#include <mysqld_error.h> /* Comes MySQL */
+#include <mysql_version.h> /* Comes with MySQL-devel */
#include <errmsg.h> /* Comes with MySQL-devel */
diff --git a/mysql.xs b/mysql.xs
index 13c6a57..bb3622b 100644
--- a/mysql.xs
+++ b/mysql.xs
@@ -790,7 +790,7 @@ dbd_mysql_get_info(dbh, sql_info_type)
D_imp_dbh(dbh);
IV type = 0;
SV* retsv=NULL;
-#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709
+#if MYSQL_VERSION_ID >= 50709
/* MariaDB 10 is not MySQL source level compatible so this only applies to MySQL*/
IV buffer_len;
#endif
@@ -822,7 +822,7 @@ dbd_mysql_get_info(dbh, sql_info_type)
retsv = newSVpvn("`", 1);
break;
case SQL_MAXIMUM_STATEMENT_LENGTH:
-#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709
+#if MYSQL_VERSION_ID >= 50709
/* MariaDB 10 is not MySQL source level compatible so this
only applies to MySQL*/
/* mysql_get_option() was added in mysql 5.7.3 */
--
2.9.4

View File

@ -1,6 +1,6 @@
Name: perl-DBD-MySQL Name: perl-DBD-MySQL
Version: 4.043 Version: 4.043
Release: 1%{?dist} Release: 2%{?dist}
Summary: A MySQL interface for Perl Summary: A MySQL interface for Perl
Group: Development/Libraries Group: Development/Libraries
License: GPL+ or Artistic License: GPL+ or Artistic
@ -8,6 +8,8 @@ URL: http://search.cpan.org/dist/DBD-mysql/
Source0: http://www.cpan.org/authors/id/M/MI/MICHIELB/DBD-mysql-%{version}.tar.gz Source0: http://www.cpan.org/authors/id/M/MI/MICHIELB/DBD-mysql-%{version}.tar.gz
# Fix for CVE-2017-10788 # Fix for CVE-2017-10788
Patch0: DBD-mysql-4.043-Fix-use-after-free-after-calling-mysql_stmt_close.patch.txt Patch0: DBD-mysql-4.043-Fix-use-after-free-after-calling-mysql_stmt_close.patch.txt
# Fix for new version of MariaDB 10.2
Patch1: DBD-mysql-4.043-Fix-build-failures-for-MariaDB-10.2.patch
BuildRequires: mariadb, mariadb-devel, zlib-devel BuildRequires: mariadb, mariadb-devel, zlib-devel
BuildRequires: coreutils BuildRequires: coreutils
BuildRequires: findutils BuildRequires: findutils
@ -43,6 +45,7 @@ management system.
%prep %prep
%setup -q -n DBD-mysql-%{version} %setup -q -n DBD-mysql-%{version}
%patch0 -p1 %patch0 -p1
%patch1 -p1
# Correct file permissions # Correct file permissions
find . -type f | xargs chmod -x find . -type f | xargs chmod -x
@ -70,6 +73,9 @@ find %{buildroot} -type f -name '*.bs' -empty -delete
%{_mandir}/man3/*.3* %{_mandir}/man3/*.3*
%changelog %changelog
* Thu Jul 13 2017 Jitka Plesnikova <jplesnik@redhat.com> - 4.043-2
- Fix for new version of MariaDB 10.2 (bug #1470196)
* Fri Jun 30 2017 Jitka Plesnikova <jplesnik@redhat.com> - 4.043-1 * Fri Jun 30 2017 Jitka Plesnikova <jplesnik@redhat.com> - 4.043-1
- 4.043 bump - 4.043 bump
- Fixed CVE-2017-10788 (bug #1467600) - Fixed CVE-2017-10788 (bug #1467600)