[ARGUS] argus-clients and mysql8
Carter Bullard
carter at qosient.com
Sat Aug 8 08:04:00 EDT 2020
Hey Andreas,
Thanks !!!!! Since we do need to have some backward compatibility, and a lot of sites use old mysql … if this works for you, I’d go down the road of adding a ./include/argus_mysql.h file and use that in place of mysql.h …. And let that file do the corrections ...
What do you think ??
-— contents of ./include/argus_mysql.h
#ifndef ARGUS_MYSQL_H
#define ARGUS_MYSQL_H
#ifdef ARGUS_MYSQL
# ifdef HAVE_STDBOOL_H
# include <stdbool.h>
# endif
# include <mysql.h>
# if !defined(my_bool)
# define my_bool bool
# endif
# endif /* ARGUS_MYSQL*/
#endif /* ARGUS_MYSQL_H */
-— end contents
Hope all is most excellent !!!
Carter
> On Aug 7, 2020, at 1:02 PM, Andreas Hasenack <andreas at canonical.com> wrote:
>
> Hi there,
>
> in Ubuntu we have been carrying a workaround/patch for a mysql8 build
> problem. Mysql8 removed the my_bool definition[1]:
> """
> Incompatible Change: The my_bool type is no longer used in MySQL
> source code. Any third-party code that used this type to represent C
> boolean variables should use the bool or int C type instead.
> """
>
> The patch is:
> --- a/examples/ramysql/rasql.c
> +++ b/examples/ramysql/rasql.c
> @@ -57,6 +57,7 @@
> #include <rasplit.h>
>
> #include <mysql.h>
> +typedef bool my_bool;
>
> char *RaDatabase = NULL;
> char **RaTables = NULL;
> diff --git a/examples/ramysql/rasqlinsert.c b/examples/ramysql/rasqlinsert.c
> index 2772c9c..6c4d37c 100644
> --- a/examples/ramysql/rasqlinsert.c
> +++ b/examples/ramysql/rasqlinsert.c
> @@ -71,6 +71,7 @@ int ArgusTotalSelectSQLStatements = 0;
> #include <sys/socket.h>
>
> #include <mysql.h>
> +typedef bool my_bool;
>
> char *RaDatabase = NULL;
> char **RaTables = NULL;
> diff --git a/examples/ramysql/rasqltimeindex.c
> b/examples/ramysql/rasqltimeindex.c
> index 16cbdfe..8fd81b6 100644
> --- a/examples/ramysql/rasqltimeindex.c
> +++ b/examples/ramysql/rasqltimeindex.c
> @@ -54,6 +54,7 @@
> #include <sys/socket.h>
>
> #include <mysql.h>
> +typedef bool my_bool;
>
> #include <rasqltimeindex.h>
>
>
> As I said, it's just a workaround, because it's reintroducing the
> removed typedef. Upstream should probably use a proper new type.
>
> Cheers!
>
>
> 1. https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html
>
More information about the argus
mailing list