mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2025-12-21 21:17:37 -08:00
Closes: https://github.com/gentoo/gentoo/pull/15083 Closes: https://bugs.gentoo.org/693392 Package-Manager: Portage-2.3.96, Repoman-2.3.22 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
36 lines
1.0 KiB
Diff
36 lines
1.0 KiB
Diff
--- a/src/mysql.c
|
|
+++ b/src/mysql.c
|
|
@@ -196,6 +196,7 @@
|
|
int retval;
|
|
sql_server_t *server = &conf.sql.server;
|
|
unsigned int port;
|
|
+ my_bool reconnect = 1;
|
|
|
|
DENTER
|
|
|
|
@@ -238,8 +239,9 @@
|
|
DSRETURN (NSS_UNAVAIL)
|
|
}
|
|
ci.valid = ntrue;
|
|
- ci.link.reconnect = 0; /* Safety: We can't let MySQL assume socket is
|
|
- still valid; see _nss_mysql_validate_socket */
|
|
+ /* Safety: We can't let MySQL assume socket is still valid;
|
|
+ see _nss_mysql_validate_socket */
|
|
+ mysql_options(&ci.link, MYSQL_OPT_RECONNECT, &reconnect);
|
|
DSRETURN (NSS_SUCCESS)
|
|
}
|
|
_nss_mysql_log (LOG_ALERT, "Connection to server '%s' failed: %s",
|
|
--- a/src/nss_mysql.h
|
|
+++ b/src/nss_mysql.h
|
|
@@ -72,6 +72,10 @@ typedef nss_status_t NSS_STATUS;
|
|
/* Default initializers */
|
|
#define DEF_TIMEOUT 3
|
|
|
|
+#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 80001
|
|
+#define my_bool bool
|
|
+#endif
|
|
+
|
|
#ifdef DEBUG
|
|
void _nss_mysql_debug (char *fmt, ...);
|
|
#define DEBUG_FILE "/tmp/libnss-mysql-debug.log"
|