]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix bug #2294 Bacula does not build with MariaDB 10.2
authorKern Sibbald <kern@sibbald.com>
Thu, 20 Jul 2017 17:44:39 +0000 (19:44 +0200)
committerKern Sibbald <kern@sibbald.com>
Thu, 20 Jul 2017 17:44:39 +0000 (19:44 +0200)
bacula/src/cats/mysql.c

index 3aa9a668d634dbd05445e73f807eb00a0fb05acb..5abfa43901b3ef96c895abf89cb8e5ba53aecdc2 100644 (file)
@@ -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);