Blame net-snmp-5.7.3-mariadb102.patch
|
|
cd6759e |
diff -urNp old/apps/snmptrapd_sql.c new/apps/snmptrapd_sql.c
|
|
|
cd6759e |
--- old/apps/snmptrapd_sql.c 2017-07-18 09:44:00.655109694 +0200
|
|
|
cd6759e |
+++ new/apps/snmptrapd_sql.c 2017-07-19 12:51:14.836148821 +0200
|
|
|
cd6759e |
@@ -54,6 +54,7 @@
|
|
|
cd6759e |
#include <my_sys.h>
|
|
|
cd6759e |
#include <mysql.h>
|
|
|
cd6759e |
#include <errmsg.h>
|
|
|
cd6759e |
+#include <mysql_version.h>
|
|
|
cd6759e |
|
|
|
cd6759e |
netsnmp_feature_require(container_fifo)
|
|
|
cd6759e |
|
|
|
cd6759e |
@@ -437,6 +438,7 @@ netsnmp_mysql_init(void)
|
|
|
cd6759e |
return -1;
|
|
|
cd6759e |
}
|
|
|
cd6759e |
|
|
|
cd6759e |
+#if MYSQL_VERSION_ID < 100000
|
|
|
cd6759e |
#ifdef HAVE_BROKEN_LIBMYSQLCLIENT
|
|
|
cd6759e |
my_init();
|
|
|
cd6759e |
#else
|
|
|
cd6759e |
@@ -445,6 +447,7 @@ netsnmp_mysql_init(void)
|
|
|
cd6759e |
|
|
|
cd6759e |
/** load .my.cnf values */
|
|
|
cd6759e |
load_defaults ("my", _sql.groups, ¬_argc, ¬_argv);
|
|
|
cd6759e |
+#endif
|
|
|
cd6759e |
for(i=0; i < not_argc; ++i) {
|
|
|
cd6759e |
if (NULL == not_argv[i])
|
|
|
cd6759e |
continue;
|
|
|
cd6759e |
@@ -542,6 +545,10 @@ netsnmp_mysql_init(void)
|
|
|
cd6759e |
return -1;
|
|
|
cd6759e |
}
|
|
|
cd6759e |
|
|
|
cd6759e |
+#if MYSQL_VERSION_ID > 100000
|
|
|
cd6759e |
+ mysql_options(_sql.conn, MYSQL_READ_DEFAULT_GROUP, "snmptrapd");
|
|
|
cd6759e |
+#endif
|
|
|
cd6759e |
+
|
|
|
cd6759e |
/** try to connect; we'll try again later if we fail */
|
|
|
cd6759e |
(void) netsnmp_mysql_connect();
|
|
|
cd6759e |
|