Created attachment 490622 [details] build.log In dev-db/mariadb-10.2.8 most *.h files moved from: /usr/include/mysql directory to /usr/include/mysql/server directory; /usr/include/mysql/mysql directory to /usr/include/server/mysql directory; /usr/include/mysql/mysql/psi directory to /usr/include/server/mysql/psi directory. In this case net-snmp with installed mariadb-10.2.8 failed to build. also I applied patch from https://bugs.gentoo.org/show_bug.cgi?id=627588
Why does this happen? mysql_config does not appear to reflect this change. Is that an oversight or should I patch net-snmp to look for both my_global.h and server/my_global.h in the include paths?
(In reply to Jeroen Roovers from comment #1) > Why does this happen? mysql_config does not appear to reflect this change. > Is that an oversight or should I patch net-snmp to look for both my_global.h > and server/my_global.h in the include paths? This is only the first file from 'not found community'. I created this symlinks for a successful build of net-snmp: in /usr/include/mysql: byte_order_generic_x86_64.h -> server/byte_order_generic_x86_64.h little_endian.h -> server/little_endian.h m_ctype.h -> server/m_ctype.h m_string.h -> server/m_string.h my_alloc.h -> server/my_alloc.h my_attribute.h -> server/my_attribute.h my_byteorder.h -> server/my_byteorder.h my_compiler.h -> server/my_compiler.h my_config.h -> server/my_config.h my_dbug.h -> server/my_dbug.h my_decimal_limits.h -> server/my_decimal_limits.h my_global.h -> server/my_global.h my_pthread.h -> server/my_pthread.h mysql_time.h -> server/mysql_time.h mysql_version.h -> server/mysql_version.h my_sys.h -> server/my_sys.h my_valgrind.h -> server/my_valgrind.h typelib.h -> server/typelib.h in /usr/include/mysql/mysql plugin_ftparser.h -> ../server/mysql/plugin_ftparser.h plugin.h -> ../server/mysql/plugin.h service_base64.h -> ../server/mysql/service_base64.h service_debug_sync.h -> ../server/mysql/service_debug_sync.h service_encryption.h -> ../server/mysql/service_encryption.h service_encryption_scheme.h -> ../server/mysql/service_encryption_scheme.h service_kill_statement.h -> ../server/mysql/service_kill_statement.h service_logger.h -> ../server/mysql/service_logger.h service_md5.h -> ../server/mysql/service_md5.h service_my_crypt.h -> ../server/mysql/service_my_crypt.h service_my_print_error.h -> ../server/mysql/service_my_print_error.h service_my_snprintf.h -> ../server/mysql/service_my_snprintf.h service_progress_report.h -> ../server/mysql/service_progress_report.h services.h -> ../server/mysql/services.h service_sha1.h -> ../server/mysql/service_sha1.h service_sha2.h -> ../server/mysql/service_sha2.h service_thd_alloc.h -> ../server/mysql/service_thd_alloc.h service_thd_autoinc.h -> ../server/mysql/service_thd_autoinc.h service_thd_error_context.h -> ../server/mysql/service_thd_error_context.h service_thd_rnd.h -> ../server/mysql/service_thd_rnd.h service_thd_specifics.h -> ../server/mysql/service_thd_specifics.h service_thd_timezone.h -> ../server/mysql/service_thd_timezone.h service_thd_wait.h -> ../server/mysql/service_thd_wait.h in /usr/include/mysql/mysql/psi mysql_thread.h -> ../../server/mysql/psi/mysql_thread.h psi.h -> ../../server/mysql/psi/psi.h As far as I understood, this is Gentoo specific location of mysql headers for mariadb-10.2.8. Upstream mariadb release from 10.2.7 to 10.2.8 does not has any changes in /usr/lib/mysql location.
(In reply to Jeroen Roovers from comment #1) > Why does this happen? mysql_config does not appear to reflect this change. > Is that an oversight or should I patch net-snmp to look for both my_global.h > and server/my_global.h in the include paths? AFAIK, this is to indicate something that is beyond the client API and should not be used. I will ask in #maria in Freenode when I get the chance. (Others are welcome to do the same) (In reply to Vladimir B. Vinogradov from comment #2) > As far as I understood, this is Gentoo specific location of mysql headers > for mariadb-10.2.8. > Upstream mariadb release from 10.2.7 to 10.2.8 does not has any changes in > /usr/lib/mysql location. This is incorrect, MariaDB upstream made this include directory change in 10.2.8, not Gentoo.
apps/snmptrapd_sql.c has too many includes for MariaDB 10.2 #include <my_global.h> #include <my_sys.h> #include <mysql.h> #include <errmsg.h> should be reduced to #include <mysql.h> #include <errmsg.h> but I'll have to verify this with previous MySQL/MariaDB versions.
Created attachment 490772 [details, diff] mysql-headers.patch Thanks to an existing autotools macro to define HAVE_BROKEN_LIBMYSQLCLIENT, this attached patch should work for all versions. The only apparent reasoning for my_global.h and my_sys.h is the MY_INIT macro from my_sys.h which simply sets a program name for error messages and calls my_init(). When the HAVE_BROKEN_LIBMYSQLCLIENT is set, it just calls my_init() which is in mysql.h. I don't know the full value of setting my_progname in a 3rd party lib/program is yet. But it should be no worse for wear to exclude unnecessary includes when macros will not be called in any case. Tested on MySQL 5.6 and MariaDB 10.2. Other versions should behave as they did before.
(In reply to Brian Evans from comment #5) > Created attachment 490772 [details, diff] [details, diff] > mysql-headers.patch Thanks. Fixed without revision bump.