+2229. [bug] tmark
+ Modified configure.ac to detect versions of MySQL
+ client libary for which MYSQL_OPT_RECONNECT is
+ deprecated and exclude from Kea core, code attempts
+ to set it false.
+ (Gitlab #3311)
+
Kea 2.5.8 (development) released on April 30, 2024
2228. [build] piotrek
$(cat conftest.err)])]
)
+ # Beginning with MySQL 8.0.34 MYSQL_OPT_RECONNNECT is deprecated.
+ # Check if MYSQL_OPT_RECONNNECT is defined.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([#include <mysql.h>
+ auto temp = MYSQL_OPT_RECONNECT;]
+ [])],
+ [AC_MSG_RESULT([checking for MySQL MYSQL_OPT_RECONNNECT... yes])
+ AC_DEFINE([HAVE_MYSQL_OPT_RECONNECT], [1], [MySQL has MYSQL_OPT_RECONNNECT])],
+ [AC_MSG_RESULT([checking for MySQL MYSQL_OPT_RECONNECT... no])])
+
CPPFLAGS=$CPPFLAGS_SAVED
LIBS=$LIBS_SAVED
fi
// Set options for the connection:
//
- // Set options for the connection:
- // Make sure auto_reconnect is OFF! Enabling it leaves us with an unusable
+ int result;
+#ifdef HAS_MYSQL_OPT_RECONNECT
+ // Though still supported by Mariadb (as of 11.5.0), MYSQL_OPT_RECONNECT is
+ // deprecated as of MySQL 8.0.34. Where it is still supported we should
+ // continue to ensure it is off. Enabling it leaves us with an unusable
// connection after a reconnect as among other things, it drops all our
// pre-compiled statements.
my_bool auto_reconnect = MLM_FALSE;
- int result = mysql_options(mysql_, MYSQL_OPT_RECONNECT, &auto_reconnect);
+ result = mysql_options(mysql_, MYSQL_OPT_RECONNECT, &auto_reconnect);
if (result != 0) {
isc_throw(DbOpenError, "unable to set auto-reconnect option: " <<
mysql_error(mysql_));
}
+#endif
// Make sure we have a large idle time window ... say 30 days...
const char *wait_time = "SET SESSION wait_timeout = 30 * 86400";