summaryrefslogtreecommitdiff
path: root/dbd
diff options
context:
space:
mode:
authorniq <niq@13f79535-47bb-0310-9956-ffa450edef68>2009-11-20 17:35:23 +0000
committerniq <niq@13f79535-47bb-0310-9956-ffa450edef68>2009-11-20 17:35:23 +0000
commit9076e76d58795ead88055c22cffefc920ccdf486 (patch)
tree1f585f324993d2c7fb3503e7f9742b24b23d32a6 /dbd
parentdf89058c7b57345ca4d8c6d1a3cf7c2e8167ff5a (diff)
downloadlibapr-9076e76d58795ead88055c22cffefc920ccdf486.tar.gz
Support connecttimeout, readtimeout and writetimeout MySQL options
PR 48251 Submitted by Marko Kevac git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@882650 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dbd')
-rw-r--r--dbd/apr_dbd_mysql.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c
index 482b82a96..a54204cf9 100644
--- a/dbd/apr_dbd_mysql.c
+++ b/dbd/apr_dbd_mysql.c
@@ -1122,7 +1122,12 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params,
{"flags", NULL},
{"fldsz", NULL},
{"group", NULL},
+#if MYSQL_VERSION_ID >= 50013
{"reconnect", NULL},
+ {"connecttimeout", NULL},
+ {"readtimeout", NULL},
+ {"writetimeout", NULL},
+#endif
{NULL, NULL}
};
unsigned int port = 0;
@@ -1178,6 +1183,18 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params,
if (fields[9].value != NULL) {
do_reconnect = atoi(fields[9].value) ? 1 : 0;
}
+ if (fields[10].value != NULL) {
+ mysql_options(sql->conn, MYSQL_OPT_CONNECT_TIMEOUT,
+ atoi(fields[10].value));
+ }
+ if (fields[11].value != NULL) {
+ mysql_options(sql->conn, MYSQL_OPT_READ_TIMEOUT,
+ atoi(fields[11].value));
+ }
+ if (fields[12].value != NULL) {
+ mysql_options(sql->conn, MYSQL_OPT_WRITE_TIMEOUT,
+ atoi(fields[12].value));
+ }
#endif
#if MYSQL_VERSION_ID >= 50013