Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Sep 2018 17:22:59 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 231345] net-mgmt/pmacct does not compile with MariaDB when MySQL support is selected
Message-ID:  <bug-231345-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231345

            Bug ID: 231345
           Summary: net-mgmt/pmacct does not compile with MariaDB when
                    MySQL support is selected
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch-ready
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: pi@FreeBSD.org
          Reporter: Antonio.Trindade@gmail.com
             Flags: maintainer-feedback?(pi@FreeBSD.org)
          Assignee: pi@FreeBSD.org

As per the subject, net-mgmt/pmacct (port version 1.7.0 revision 0) does not
compile when MySQL support is selected and, instead of MySQL, MariaDB 10.3 =
is
installed.

The compilation aborts with the following errors:
mysql_plugin.c:672:12: error: no member named 'reconnect' in 'struct st_mys=
ql'
    dbptr->reconnect =3D TRUE;
    ~~~~~  ^
mysql_plugin.c:771:24: error: use of undeclared identifier
'MYSQL_SERVER_VERSION'; did you mean 'MYSQL_OPT_TLS_VERSION'?
  printf("MySQL %s\n", MYSQL_SERVER_VERSION);
                       ^~~~~~~~~~~~~~~~~~~~
                       MYSQL_OPT_TLS_VERSION
/usr/local/include/mysql/mysql.h:207:5: note: 'MYSQL_OPT_TLS_VERSION' decla=
red
here
    MYSQL_OPT_TLS_VERSION,
    ^

I already have a solution and made a patch.
The patch is the following:
File patch-src_mysql_plugin.c:
--- src/mysql_plugin.c.orig     2017-10-20 16:56:19 UTC
+++ src/mysql_plugin.c
@@ -668,8 +668,9 @@ void MY_DB_Connect(struct DBdesc *db, ch
   MYSQL *dbptr =3D db->desc;

   if (!db->fail) {
+    my_bool reconnect =3D 1;
     mysql_init(db->desc);
-    dbptr->reconnect =3D 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 inser

 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
 }

Thus, this bug report is just a request for incorporation of this patch in =
the
ports tree.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-231345-7788>