perl-DBD-mysql/perl-DBD-mysql-4.043-Fix-build-failures-for-MariaDB.patch

39 lines
1.1 KiB
Diff
Raw Normal View History

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> /* For MYSQL_VERSION_ID */
#include <errmsg.h> /* Comes with MySQL-devel */