[mysql] MySQL 8 deprecates my_bool

replace my_bool with char in mod_vhostdb_mysql and mod_mysql_vhost
(mysql.h contains: typedef char my_bool; and passes a pointer to it
 as third argument, a (void *), to mysql_options())
personal/stbuehler/fix-fdevent
Glenn Strauss 4 years ago
parent c9a64d94fc
commit 468b3a5b33
  1. 6
      src/mod_mysql_vhost.c
  2. 2
      src/mod_vhostdb_mysql.c

@ -193,7 +193,6 @@ SERVER_FUNC(mod_mysql_vhost_set_defaults) {
/* all have to be set */
if (!(buffer_string_is_empty(s->myuser) ||
buffer_string_is_empty(s->mydb))) {
my_bool reconnect = 1;
if (NULL == (s->mysql = mysql_init(NULL))) {
log_error_write(srv, __FILE__, __LINE__, "s", "mysql_init() failed, exiting...");
@ -202,7 +201,10 @@ SERVER_FUNC(mod_mysql_vhost_set_defaults) {
#if MYSQL_VERSION_ID >= 50013
/* in mysql versions above 5.0.3 the reconnect flag is off by default */
mysql_options(s->mysql, MYSQL_OPT_RECONNECT, &reconnect);
{
char reconnect = 1;
mysql_options(s->mysql, MYSQL_OPT_RECONNECT, &reconnect);
}
#endif
#define FOO(x) (buffer_string_is_empty(s->x) ? NULL : s->x->ptr)

@ -91,7 +91,7 @@ static int mod_vhostdb_dbconf_setup (server *srv, array *opts, void **vdata)
#if MYSQL_VERSION_ID >= 50013
/* in mysql versions above 5.0.3 the reconnect flag is off by default */
{
my_bool reconnect = 1;
char reconnect = 1;
mysql_options(dbconn, MYSQL_OPT_RECONNECT, &reconnect);
}
#endif

Loading…
Cancel
Save