diff options
author | Tobias Scherbaum <dertobi123@gentoo.org> | 2008-05-03 19:27:22 +0000 |
---|---|---|
committer | Tobias Scherbaum <dertobi123@gentoo.org> | 2008-05-03 19:27:22 +0000 |
commit | 378edaa7bfb049188da3e0c645f183c2543d1e94 (patch) | |
tree | bf384f591272be27914946b0815e90749a133a73 /net-dns | |
parent | filtered jikes (diff) | |
download | gentoo-2-378edaa7bfb049188da3e0c645f183c2543d1e94.tar.gz gentoo-2-378edaa7bfb049188da3e0c645f183c2543d1e94.tar.bz2 gentoo-2-378edaa7bfb049188da3e0c645f183c2543d1e94.zip |
Fix dlz/mysql5 autoreconnect, patch by Nicolas Brousse, #180720
(Portage version: 2.1.5_rc6)
Diffstat (limited to 'net-dns')
-rw-r--r-- | net-dns/bind/ChangeLog | 6 | ||||
-rw-r--r-- | net-dns/bind/bind-9.4.2.ebuild | 6 | ||||
-rw-r--r-- | net-dns/bind/files/bind-dlzmysql5-reconnect.patch | 59 |
3 files changed, 69 insertions, 2 deletions
diff --git a/net-dns/bind/ChangeLog b/net-dns/bind/ChangeLog index 191703873a62..2add80e9637c 100644 --- a/net-dns/bind/ChangeLog +++ b/net-dns/bind/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-dns/bind # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.186 2008/05/03 18:27:44 dertobi123 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.187 2008/05/03 19:27:21 dertobi123 Exp $ + + 03 May 2008; Tobias Scherbaum <dertobi123@gentoo.org> + +files/bind-dlzmysql5-reconnect.patch, bind-9.4.2.ebuild: + Fix dlz/mysql5 autoreconnect, patch by Nicolas Brousse, #180720 03 May 2008; Tobias Scherbaum <dertobi123@gentoo.org> -bind-9.2.7.ebuild, -bind-9.3.3.ebuild: diff --git a/net-dns/bind/bind-9.4.2.ebuild b/net-dns/bind/bind-9.4.2.ebuild index f23b907287ed..1d415b1363fb 100644 --- a/net-dns/bind/bind-9.4.2.ebuild +++ b/net-dns/bind/bind-9.4.2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.4.2.ebuild,v 1.1 2008/05/03 18:21:35 dertobi123 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.4.2.ebuild,v 1.2 2008/05/03 19:27:21 dertobi123 Exp $ inherit eutils libtool autotools toolchain-funcs flag-o-matic @@ -57,6 +57,10 @@ src_unpack() { use dlz && epatch "${FILESDIR}"/${PN}-9.4.0-dlzbdb-close_cursor.patch + # bind fails to reconnect to MySQL5 databases, bug #180720, patch by Nicolas Brousse + # (http://www.shell-tips.com/2007/09/04/bind-950-patch-dlz-mysql-5-for-auto-reconnect/) + use dlz && use mysql && epatch ${FILESDIR}/bind-dlzmysql5-reconnect.patch + # should be installed by bind-tools sed -e "s:nsupdate ::g" -i "${S}"/bin/Makefile.in diff --git a/net-dns/bind/files/bind-dlzmysql5-reconnect.patch b/net-dns/bind/files/bind-dlzmysql5-reconnect.patch new file mode 100644 index 000000000000..b854b9583f16 --- /dev/null +++ b/net-dns/bind/files/bind-dlzmysql5-reconnect.patch @@ -0,0 +1,59 @@ +--- bind-9.5.0a6.orig/contrib/dlz/drivers/dlz_mysql_driver.c 2007-02-06 06:44:26.000000000 +0100 ++++ bind-9.5.0a6/contrib/dlz/drivers/dlz_mysql_driver.c 2007-09-04 23:57:57.000000000 +0200 +@@ -92,6 +92,25 @@ + */ + + /*% ++ * Factorize the mysql_ping for adding a log error message ++ */ ++static isc_result_t ++mysqldrv_ping(dbinstance_t *dbi) { ++ int pres = 0; ++ ++ pres = mysql_ping(dbi->dbconn); ++ if ( pres != 0 ) { ++ isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, ++ DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1), ++ "\nMySQL Ping Error : %s (%i)\n", ++ mysql_error(dbi->dbconn), ++ mysql_errno(dbi->dbconn)); ++ return (ISC_R_FAILURE); ++ } ++ return (ISC_R_SUCCESS); ++} ++ ++/*% + * Allocates memory for a new string, and then constructs the new + * string by "escaping" the input string. The new string is + * safe to be used in queries. This is necessary because we cannot +@@ -225,6 +244,8 @@ + } + + ++ mysqldrv_ping(dbi); ++ + /* + * was a zone string passed? If so, make it safe for use in + * queries. +@@ -324,7 +345,7 @@ + qres = mysql_query((MYSQL *) dbi->dbconn, querystring); + if (qres == 0) + break; +- for (j=0; mysql_ping((MYSQL *) dbi->dbconn) != 0 && j < 4; j++) ++ for (j=0; mysqldrv_ping(dbi) != 0 && j < 4; j++) + ; + } + +@@ -923,6 +944,12 @@ + pass = getParameterValue(argv[1], "pass="); + socket = getParameterValue(argv[1], "socket="); + ++ if(mysql_options((MYSQL *) dbi->dbconn, MYSQL_OPT_RECONNECT, "1")) { ++ isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, ++ DNS_LOGMODULE_DLZ, ISC_LOG_ERROR, ++ "Could not set database reconnect option"); ++ } ++ + for (j=0; dbc == NULL && j < 4; j++) + dbc = mysql_real_connect((MYSQL *) dbi->dbconn, host, + user, pass, dbname, port, socket, |