You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bo...@apache.org on 2008/07/22 08:43:39 UTC
svn commit: r678653 - in /apr/apr-util/trunk: dbd/apr_dbd_mysql.c
include/apr_dbd.h
Author: bojan
Date: Mon Jul 21 23:43:38 2008
New Revision: 678653
URL: http://svn.apache.org/viewvc?rev=678653&view=rev
Log:
Give MySQL DBD driver reconnect option.
PR 45407.
Modified:
apr/apr-util/trunk/dbd/apr_dbd_mysql.c
apr/apr-util/trunk/include/apr_dbd.h
Modified: apr/apr-util/trunk/dbd/apr_dbd_mysql.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_mysql.c?rev=678653&r1=678652&r2=678653&view=diff
==============================================================================
--- apr/apr-util/trunk/dbd/apr_dbd_mysql.c (original)
+++ apr/apr-util/trunk/dbd/apr_dbd_mysql.c Mon Jul 21 23:43:38 2008
@@ -1104,6 +1104,7 @@
{"flags", NULL},
{"fldsz", NULL},
{"group", NULL},
+ {"reconnect", NULL},
{NULL, NULL}
};
unsigned int port = 0;
@@ -1155,6 +1156,11 @@
if (fields[8].value != NULL) {
mysql_options(sql->conn, MYSQL_READ_DEFAULT_GROUP, fields[8].value);
}
+#if MYSQL_VERSION_ID >= 50013
+ if (fields[9].value != NULL) {
+ do_reconnect = atoi(fields[9].value) ? 1 : 0;
+ }
+#endif
#if MYSQL_VERSION_ID >= 50013
/* the MySQL manual says this should be BEFORE mysql_real_connect */
Modified: apr/apr-util/trunk/include/apr_dbd.h
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/apr_dbd.h?rev=678653&r1=678652&r2=678653&view=diff
==============================================================================
--- apr/apr-util/trunk/include/apr_dbd.h (original)
+++ apr/apr-util/trunk/include/apr_dbd.h Mon Jul 21 23:43:38 2008
@@ -126,15 +126,16 @@
* keys, each followed by an equal sign and a value. Such key/value pairs can
* be delimited by space, CR, LF, tab, semicolon, vertical bar or comma.
* @remarks MySQL: the params can have "host", "port", "user", "pass",
- * "dbname", "sock", "flags" "fldsz" and "group" keys, each followed by an
- * equal sign and a value. Such key/value pairs can be delimited by space,
- * CR, LF, tab, semicolon, vertical bar or comma. For now, "flags" can only
- * recognise CLIENT_FOUND_ROWS (check MySQL manual for details). The value
- * associated with "fldsz" determines maximum amount of memory (in bytes) for
- * each of the fields in the result set of prepared statements. By default,
- * this value is 1 MB. The value associated with "group" determines which
- * group from configuration file to use (see MYSQL_READ_DEFAULT_GROUP option
- * of mysql_options() in MySQL manual).
+ * "dbname", "sock", "flags" "fldsz", "group" and "reconnect" keys, each
+ * followed by an equal sign and a value. Such key/value pairs can be
+ * delimited by space, CR, LF, tab, semicolon, vertical bar or comma. For
+ * now, "flags" can only recognise CLIENT_FOUND_ROWS (check MySQL manual for
+ * details). The value associated with "fldsz" determines maximum amount of
+ * memory (in bytes) for each of the fields in the result set of prepared
+ * statements. By default, this value is 1 MB. The value associated with
+ * "group" determines which group from configuration file to use (see
+ * MYSQL_READ_DEFAULT_GROUP option of mysql_options() in MySQL manual).
+ * Reconnect is set to 1 by default (i.e. true).
* @remarks FreeTDS: the params can have "username", "password", "appname",
* "dbname", "host", "charset", "lang" and "server" keys, each followed by an
* equal sign and a value.
Re: svn commit: r678653 - in /apr/apr-util/trunk:
dbd/apr_dbd_mysql.c include/apr_dbd.h
Posted by Bojan Smojver <bo...@rexursive.com>.
On Tue, 2008-07-22 at 16:53 +1000, Bojan Smojver wrote:
> I would really like to backport this one to 1.3.x before 1.3.x.
That should be "before 1.3.3", of course.
--
Bojan
Re: svn commit: r678653 - in /apr/apr-util/trunk:
dbd/apr_dbd_mysql.c include/apr_dbd.h
Posted by Bojan Smojver <bo...@rexursive.com>.
On Tue, 2008-07-22 at 06:43 +0000, bojan@apache.org wrote:
> Give MySQL DBD driver reconnect option.
> PR 45407.
I would really like to backport this one to 1.3.x before 1.3.x. It is
affecting mod_dbd with MySQL driver, when connections go away.
Please review.
--
Bojan