From: Kern Sibbald Date: Thu, 20 Jul 2017 17:44:39 +0000 (+0200) Subject: Fix bug #2294 Bacula does not build with MariaDB 10.2 X-Git-Tag: Release-9.0.2~15 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7061d2221cafd10912fef453a3fb75906efd207c;p=bacula%2Fbacula Fix bug #2294 Bacula does not build with MariaDB 10.2 --- 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);