[Bug 231345] net-mgmt/pmacct does not compile with MariaDB when MySQL support is selected
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Thu Sep 13 17:23:02 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231345
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 at FreeBSD.org
Reporter: Antonio.Trindade at gmail.com
Flags: maintainer-feedback?(pi at FreeBSD.org)
Assignee: pi at 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_mysql'
dbptr->reconnect = 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' declared
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 = 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 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.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list