aboutsummaryrefslogtreecommitdiffstats
path: root/main/pmacct/mariadb.patch
blob: ded2d0faf41af822f94f9d88cb7baa369e75d280 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff --git a/src/mysql_plugin.c b/src/mysql_plugin.c
index d2503e7..d477270 100644
--- a/src/mysql_plugin.c
+++ b/src/mysql_plugin.c
@@ -668,8 +668,9 @@ void MY_DB_Connect(struct DBdesc *db, char *host)
   MYSQL *dbptr = db->desc;
 
   if (!db->fail) {
+    my_bool reconnect = 1;
     mysql_init(db->desc);
-    dbptr->reconnect = TRUE;
+    mysql_options(db->desc, MYSQL_OPT_RECONNECT, &reconnect);
     if (!mysql_real_connect(db->desc, host, config.sql_user, config.sql_passwd, config.sql_db, 0, NULL, 0)) {
       sql_db_fail(db);
       MY_get_errmsg(db);
@@ -768,5 +769,9 @@ void MY_init_default_values(struct insert_data *idata)
 
 void MY_mysql_get_version()
 {
+#ifdef MARIADB_CLIENT_VERSION_STR
+  printf("MySQL %s\n", MARIADB_CLIENT_VERSION_STR);
+#else
   printf("MySQL %s\n", MYSQL_SERVER_VERSION);
+#endif
 }