diff options
author | bojan <bojan@13f79535-47bb-0310-9956-ffa450edef68> | 2008-07-22 06:43:38 +0000 |
---|---|---|
committer | bojan <bojan@13f79535-47bb-0310-9956-ffa450edef68> | 2008-07-22 06:43:38 +0000 |
commit | ec628f93db065b0def42a4096e6c8b32ef583223 (patch) | |
tree | 73457dae9fd4d035739a44b11801c2f964147c23 | |
parent | 0dc4b3ecae0a3add994d4f65b2824e57ac761cfa (diff) | |
download | libapr-util-ec628f93db065b0def42a4096e6c8b32ef583223.tar.gz |
Give MySQL DBD driver reconnect option.
PR 45407.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@678653 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | dbd/apr_dbd_mysql.c | 6 | ||||
-rw-r--r-- | include/apr_dbd.h | 19 |
2 files changed, 16 insertions, 9 deletions
diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index 9203535b..ec1d4e23 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -1104,6 +1104,7 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params, {"flags", NULL}, {"fldsz", NULL}, {"group", NULL}, + {"reconnect", NULL}, {NULL, NULL} }; unsigned int port = 0; @@ -1155,6 +1156,11 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params, 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 */ diff --git a/include/apr_dbd.h b/include/apr_dbd.h index 0e25d024..f30977da 100644 --- a/include/apr_dbd.h +++ b/include/apr_dbd.h @@ -126,15 +126,16 @@ APU_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name, * 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. |