1 |
From 051748825e77172677d9e3b319b870c3c0a70a38 Mon Sep 17 00:00:00 2001 |
2 |
From: Jitka Plesnikova <jplesnik@redhat.com> |
3 |
Date: Fri, 14 Jul 2017 14:13:50 +0200 |
4 |
Subject: [PATCH] Fix build failures for MariaDB 10.2 |
5 |
MIME-Version: 1.0 |
6 |
Content-Type: text/plain; charset=UTF-8 |
7 |
Content-Transfer-Encoding: 8bit |
8 |
|
9 |
<mariadb_version.h> does not exist in mariadb-5.5.26. Do not include |
10 |
it explicitly. Instead rely on including <mysql.h> that transitively |
11 |
includes <mariadb_version.h> or <mysql_version.h>. This makes this |
12 |
patch more portable. |
13 |
|
14 |
Signed-off-by: Petr Písař <ppisar@redhat.com> |
15 |
--- |
16 |
dbdimp.c | 7 +++++++ |
17 |
mysql.xs | 4 ++-- |
18 |
2 files changed, 9 insertions(+), 2 deletions(-) |
19 |
|
20 |
diff --git a/dbdimp.c b/dbdimp.c |
21 |
index 71251da..97fa9c4 100644 |
22 |
--- a/dbdimp.c |
23 |
+++ b/dbdimp.c |
24 |
@@ -1979,6 +1979,9 @@ MYSQL *mysql_dr_connect( |
25 |
|
26 |
if (result) |
27 |
{ |
28 |
+#if MYSQL_VERSION_ID >= 50013 |
29 |
+ my_bool reconnect= 1; |
30 |
+#endif |
31 |
#if MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION |
32 |
/* connection succeeded. */ |
33 |
/* imp_dbh == NULL when mysql_dr_connect() is called from mysql.xs |
34 |
@@ -1997,7 +2000,11 @@ MYSQL *mysql_dr_connect( |
35 |
we turn off Mysql's auto reconnect and handle re-connecting ourselves |
36 |
so that we can keep track of when this happens. |
37 |
*/ |
38 |
+#if MYSQL_VERSION_ID >= 50013 |
39 |
+ mysql_options(result, MYSQL_OPT_RECONNECT, &reconnect); |
40 |
+#else |
41 |
result->reconnect=0; |
42 |
+#endif |
43 |
} |
44 |
else { |
45 |
/* |
46 |
diff --git a/mysql.xs b/mysql.xs |
47 |
index 60cf9c6..750c763 100644 |
48 |
--- a/mysql.xs |
49 |
+++ b/mysql.xs |
50 |
@@ -787,7 +787,7 @@ dbd_mysql_get_info(dbh, sql_info_type) |
51 |
D_imp_dbh(dbh); |
52 |
IV type = 0; |
53 |
SV* retsv=NULL; |
54 |
-#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709 |
55 |
+#if MYSQL_VERSION_ID >= 50709 |
56 |
/* MariaDB 10 is not MySQL source level compatible so this only applies to MySQL*/ |
57 |
IV buffer_len; |
58 |
#endif |
59 |
@@ -819,7 +819,7 @@ dbd_mysql_get_info(dbh, sql_info_type) |
60 |
retsv = newSVpvn("`", 1); |
61 |
break; |
62 |
case SQL_MAXIMUM_STATEMENT_LENGTH: |
63 |
-#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709 |
64 |
+#if MYSQL_VERSION_ID >= 50709 |
65 |
/* MariaDB 10 is not MySQL source level compatible so this |
66 |
only applies to MySQL*/ |
67 |
/* mysql_get_option() was added in mysql 5.7.3 */ |
68 |
-- |
69 |
2.13.6 |
70 |
|