bacula/bacula-9.0.1-mariadb-reconnect.patch

21 lines
843 B
Diff
Raw Normal View History

2017-07-21 06:33:51 +00:00
diff -Naur bacula-9.0.1.old/src/cats/mysql.c bacula-9.0.1/src/cats/mysql.c
--- bacula-9.0.1.old/src/cats/mysql.c 2017-07-20 16:36:43.811177322 +0200
+++ bacula-9.0.1/src/cats/mysql.c 2017-07-20 16:37:19.029850574 +0200
@@ -198,6 +198,7 @@
BDB_MYSQL *mdb = this;
bool retval = false;
int errstat;
+ my_bool reconnect= 1;
P(mutex);
if (mdb->m_connected) {
@@ -258,7 +259,7 @@
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);