Index: include/apr_dbd.h =================================================================== --- include/apr_dbd.h (revision 678367) +++ include/apr_dbd.h (working copy) @@ -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. Index: dbd/apr_dbd_mysql.c =================================================================== --- dbd/apr_dbd_mysql.c (revision 678367) +++ dbd/apr_dbd_mysql.c (working copy) @@ -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 */