Compare pre-8 documentation (e.g. 5.5 
https://dev.mysql.com/doc/refman/5.5/en/c-api-data-structures.html ) to mysql 
8.0 documentation 
https://dev.mysql.com/doc/refman/8.0/en/c-api-data-structures.html

For 8 it says:
my_bool: A boolean type, for values that are true (nonzero) or false (zero). 
The my_bool type was used before MySQL 8.0. As of MySQL 8.0, use the bool or 
int C type instead.
NOTE: The change from my_bool to bool means that the mysql.h header file 
requires a C++ or C99 compiler to compile.

So maybe dbpool_mysql.c can do with a #if MYSQL_VERSION_ID check? e.g.

#if MYSQL_VERSION_ID >= 80000
typedef int my_bool;
#endif

Werner



Werner Coetzee
C Developer
werner.coet...@clickatell.com
+27 (21) 910 7700
From: devel <devel-boun...@kannel.org> On Behalf Of Hillel Bilman
Sent: 02 August 2019 16:30
To: Alexander Malysh <amal...@kannel.org>
Cc: Kannel Devel <devel@kannel.org>
Subject: Mysql 8.x will not compile with latest Kannel

Hi Alex,

The server I'm using has:
Mysql 8.0.17
Centos 7.x
Kannel  svn-r5278M (latest version from svn)

Latest Kannel SVN will not compile with Mysql 8.0.17.
This error with Mysql 8.x was reported in redmine 08/18/2018  
https://redmine.kannel.org/issues/782<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredmine.kannel.org%2Fissues%2F782&data=02%7C01%7C%7C0d7a493199de4c4ae61408d717560036%7Cf05b82000f184302889e9f6703297586%7C0%7C0%7C637003530455590653&sdata=S%2FjJrklB%2BM%2FtVaIQ9bU51KrWit7baFk7LzyrnyLf5bA%3D&reserved=0>
But there does not seem to be any reported solution.

Any help is appreciated to be able to compile Kannel.

Steps using to compile Kannel:

svn co 
https://svn.kannel.org/gateway/trunk/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsvn.kannel.org%2Fgateway%2Ftrunk%2F&data=02%7C01%7C%7C0d7a493199de4c4ae61408d717560036%7Cf05b82000f184302889e9f6703297586%7C0%7C0%7C637003530455600647&sdata=jXRnV%2Blvm8ThzHynnpyo1PFsSzUcr8OdCCDphFmoOFc%3D&reserved=0>
  gateway

cd gateway
./bootstrap.sh
./configure --with-defaults=speed --with-mysql  --enable-start-stop-daemon 
--enable-ssl  --disable-localtime  --enable-cookies
make;make install

Configuring for Kannel gateway version svn-r5278M ...
 ..
Showing the database section with the two WARNINGs:
Configuring DB support ...
checking whether to compile with MySQL support... searching
checking for mysql_config... /bin/mysql_config
checking mysql version... 8.0.17
checking mysql reentrant libs... -L/usr/lib64/mysql -lmysqlclient -lpthread -lm 
-lrt -lssl -lcrypto -ldl
checking for mysql_init in -lmysqlclient_r... no
checking mysql libs... -L/usr/lib64/mysql -lmysqlclient -lpthread -lm -lrt 
-lssl -lcrypto -ldl
checking for mysql_init in -lmysqlclient... yes
checking mysql includes... -I/usr/include/mysql
checking mysql/mysql.h usability... yes
checking mysql/mysql.h presence... no
configure: WARNING: mysql/mysql.h: accepted by the compiler, rejected by the 
preprocessor!
configure: WARNING: mysql/mysql.h: proceeding with the compiler's result
checking for mysql/mysql.h... yes
checking mysql/mysql_version.h usability... yes
checking mysql/mysql_version.h presence... yes
checking for mysql/mysql_version.h... yes
checking for mysql_stmt_init in -lmysqlclient_r... no
checking for mysql_stmt_init in -lmysqlclient... yes
checking whether to compile with MySQL support... yes
checking whether to compile with LibSDB support... disabled
checking whether to compile with SQLite2 support... disabled
checking whether to compile with SQLite3 support... disabled
checking whether to compile with Oracle support... disabled
checking whether to compile with PostgresSQL support... disabled
checking whether to compile with Redis support... disabled
checking whether to compile with FreeTDS Ct-Lib support... disabled
checking whether to compile with Cassandra support... disabled

root@eco007-truservcomm-jhb1-001 /home/kannel/gateway $ make
make  all-recursive
make[1]: Entering directory `/home/kannel/gateway'
Making all in gwlib
make[2]: Entering directory `/home/kannel/gateway/gwlib'
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H 
-I. -I..     -g -O2 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE 
-D_LARGE_FILES= -I/usr/include/libxml2 -I/usr/include/openssl 
-I/usr/include/mysql -MT dbpool.lo -MD -MP -MF .deps/dbpool.Tpo -c -o dbpool.lo 
dbpool.c
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -g -O2 
-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_LARGE_FILES= 
-I/usr/include/libxml2 -I/usr/include/openssl -I/usr/include/mysql -MT 
dbpool.lo -MD -MP -MF .deps/dbpool.Tpo -c dbpool.c  -fPIC -DPIC -o 
.libs/dbpool.o
In file included from gwlib.h:83:0,
                 from dbpool.c:70:
dbpool_mysql.c: In function 'mysql_select':
dbpool_mysql.c:248:48: error: 'my_bool' undeclared (first use in this function)
             bind[i].is_null = gw_malloc(sizeof(my_bool));
                                                ^
gwmem.h:122:43: note: in definition of macro 'gw_malloc'
 #define gw_malloc(size) (gw_native_malloc(size))
                                           ^
dbpool_mysql.c:248:48: note: each undeclared identifier is reported only once 
for each function it appears in
             bind[i].is_null = gw_malloc(sizeof(my_bool));
                                                ^
gwmem.h:122:43: note: in definition of macro 'gw_malloc'
 #define gw_malloc(size) (gw_native_malloc(size))
                                           ^
make[2]: *** [dbpool.lo] Error 1
make[2]: Leaving directory `/home/kannel/gateway/gwlib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kannel/gateway'
make: *** [all] Error 2

root@eco007-truservcomm-jhb1-001 /home/kannel/gateway $ rpm -qa|grep mysql
mysql-community-common-8.0.17-1.el7.x86_64
mysql-community-server-8.0.17-1.el7.x86_64
mysql-community-libs-8.0.17-1.el7.x86_64
mysql-community-libs-compat-8.0.17-1.el7.x86_64
mysql80-community-release-el7-3.noarch
mysql-community-client-8.0.17-1.el7.x86_64
mysql-community-devel-8.0.17-1.el7.x86_64

Reply via email to