From 7061d2221cafd10912fef453a3fb75906efd207c Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 20 Jul 2017 19:44:39 +0200 Subject: [PATCH] Fix bug #2294 Bacula does not build with MariaDB 10.2 --- bacula/src/cats/mysql.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bacula/src/cats/mysql.c b/bacula/src/cats/mysql.c index 3aa9a668d6..5abfa43901 100644 --- a/bacula/src/cats/mysql.c +++ b/bacula/src/cats/mysql.c @@ -198,6 +198,7 @@ bool BDB_MYSQL::bdb_open_database(JCR *jcr) BDB_MYSQL *mdb = this; bool retval = false; int errstat; + my_bool reconnect = 1; P(mutex); if (mdb->m_connected) { @@ -258,7 +259,7 @@ bool BDB_MYSQL::bdb_open_database(JCR *jcr) bmicrosleep(5,0); } - mdb->m_instance.reconnect = 1; /* so connection does not timeout */ + mysql_options(&mdb->m_instance, MYSQL_OPT_RECONNECT, &reconnect); /* so connection does not timeout */ Dmsg0(50, "mysql_real_connect done\n"); Dmsg3(50, "db_user=%s db_name=%s db_password=%s\n", mdb->m_db_user, mdb->m_db_name, (mdb->m_db_password == NULL) ? "(NULL)" : mdb->m_db_password); -- 2.39.5