Blame SOURCES/DBD-mysql-4.043-Fix-build-failures-for-MariaDB-10.2.patch

08312d
From 051748825e77172677d9e3b319b870c3c0a70a38 Mon Sep 17 00:00:00 2001
08312d
From: Jitka Plesnikova <jplesnik@redhat.com>
08312d
Date: Fri, 14 Jul 2017 14:13:50 +0200
08312d
Subject: [PATCH] Fix build failures for MariaDB 10.2
08312d
MIME-Version: 1.0
08312d
Content-Type: text/plain; charset=UTF-8
08312d
Content-Transfer-Encoding: 8bit
08312d
08312d
<mariadb_version.h> does not exist in mariadb-5.5.26. Do not include
08312d
it explicitly. Instead rely on including <mysql.h> that transitively
08312d
includes <mariadb_version.h> or <mysql_version.h>. This makes this
08312d
patch more portable.
08312d
08312d
Signed-off-by: Petr Písař <ppisar@redhat.com>
08312d
---
08312d
 dbdimp.c | 7 +++++++
08312d
 mysql.xs | 4 ++--
08312d
 2 files changed, 9 insertions(+), 2 deletions(-)
08312d
08312d
# Fixed in 4.045
08312d
#diff --git a/dbdimp.c b/dbdimp.c
08312d
#index 71251da..97fa9c4 100644
08312d
#--- a/dbdimp.c
08312d
#+++ b/dbdimp.c
08312d
#@@ -2104,6 +2104,9 @@ MYSQL *mysql_dr_connect(
08312d
# 
08312d
#     if (result)
08312d
#     {
08312d
#+#if MYSQL_VERSION_ID >= 50013
08312d
#+       my_bool reconnect= 1;
08312d
#+#endif
08312d
# #if MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION
08312d
#       /* connection succeeded. */
08312d
#       /* imp_dbh == NULL when mysql_dr_connect() is called from mysql.xs
08312d
#@@ -2122,7 +2125,11 @@ MYSQL *mysql_dr_connect(
08312d
#         we turn off Mysql's auto reconnect and handle re-connecting ourselves
08312d
#         so that we can keep track of when this happens.
08312d
#       */
08312d
#+#if MYSQL_VERSION_ID >= 50013
08312d
#+      mysql_options(result, MYSQL_OPT_RECONNECT, &reconnect);
08312d
#+#else
08312d
#       result->reconnect=0;
08312d
#+#endif
08312d
#     }
08312d
#     else {
08312d
#       /* 
08312d
diff --git a/mysql.xs b/mysql.xs
08312d
index 60cf9c6..750c763 100644
08312d
--- a/mysql.xs
08312d
+++ b/mysql.xs
08312d
@@ -787,7 +787,7 @@ dbd_mysql_get_info(dbh, sql_info_type)
08312d
     D_imp_dbh(dbh);
08312d
     IV type = 0;
08312d
     SV* retsv=NULL;
08312d
-#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709
08312d
+#if MYSQL_VERSION_ID >= 50709
08312d
 /* MariaDB 10 is not MySQL source level compatible so this only applies to MySQL*/
08312d
     IV buffer_len;
08312d
 #endif 
08312d
@@ -819,7 +819,7 @@ dbd_mysql_get_info(dbh, sql_info_type)
08312d
 	    retsv = newSVpvn("`", 1);
08312d
 	    break;
08312d
 	case SQL_MAXIMUM_STATEMENT_LENGTH:
08312d
-#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709
08312d
+#if MYSQL_VERSION_ID >= 50709
08312d
         /* MariaDB 10 is not MySQL source level compatible so this
08312d
            only applies to MySQL*/
08312d
 	    /* mysql_get_option() was added in mysql 5.7.3 */
08312d
-- 
08312d
2.13.6
08312d