From 60f07511327e481751a9e69ee96e12865781fa26 Mon Sep 17 00:00:00 2001 From: HarpyWar <harpywar@gmail.com> Date: Sun, 24 May 2020 19:33:24 +0300 Subject: [PATCH] fix for support mysql 8.x https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html --- src/bnetd/sql_mysql.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bnetd/sql_mysql.cpp b/src/bnetd/sql_mysql.cpp index bc9d732..fc08171 100644 --- a/src/bnetd/sql_mysql.cpp +++ b/src/bnetd/sql_mysql.cpp @@ -172,7 +172,14 @@ namespace pvpgn // mysql->reconnect = 1; #endif #if MYSQL_VERSION_ID >= 50019 +#if MYSQL_VERSION_ID < 80001 my_bool my_true = true; +#endif +#if MYSQL_VERSION_ID >= 80001 + // Since 8.0.1 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 change from my_bool to bool means that the mysql.h header file now requires a C++ or C99 compiler to compile. + bool my_true = true; +#endif if (mysql_options(mysql, MYSQL_OPT_RECONNECT, &my_true)){ eventlog(eventlog_level_warn, __FUNCTION__, "Failed to turn on MYSQL_OPT_RECONNECT."); }