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 2007/10/19 05:45:36 UTC
svn commit: r586248 - in /apr/apr-util/trunk: dbd/apr_dbd_mysql.c
include/apr_dbd.h
Author: bojan
Date: Thu Oct 18 20:45:36 2007
New Revision: 586248
URL: http://svn.apache.org/viewvc?rev=586248&view=rev
Log:
Add group parameter to MySQL driver
Call mysql_thread_init() explicitly, to avoid segfaults on some systems
Patch by Ian Holsman
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=586248&r1=586247&r2=586248&view=diff
==============================================================================
--- apr/apr-util/trunk/dbd/apr_dbd_mysql.c (original)
+++ apr/apr-util/trunk/dbd/apr_dbd_mysql.c Thu Oct 18 20:45:36 2007
@@ -1091,6 +1091,7 @@
{"sock", NULL},
{"flags", NULL},
{"fldsz", NULL},
+ {"group", NULL},
{NULL, NULL}
};
unsigned int port = 0;
@@ -1139,6 +1140,9 @@
if (fields[7].value != NULL) {
sql->fldsz = atol(fields[7].value);
}
+ if (fields[8].value != NULL) {
+ mysql_options(sql->conn, MYSQL_READ_DEFAULT_GROUP, fields[8].value);
+ }
#if MYSQL_VERSION_ID >= 50013
/* the MySQL manual says this should be BEFORE mysql_real_connect */
@@ -1220,6 +1224,8 @@
static void dbd_mysql_init(apr_pool_t *pool)
{
my_init();
+ mysql_thread_init();
+
/* FIXME: this is a guess; find out what it really does */
apr_pool_cleanup_register(pool, NULL, thread_end, apr_pool_cleanup_null);
}
Modified: apr/apr-util/trunk/include/apr_dbd.h
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/apr_dbd.h?rev=586248&r1=586247&r2=586248&view=diff
==============================================================================
--- apr/apr-util/trunk/include/apr_dbd.h (original)
+++ apr/apr-util/trunk/include/apr_dbd.h Thu Oct 18 20:45:36 2007
@@ -125,13 +125,15 @@
* 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" and "fldsz" 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.
+ * "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 the which
+ * group from configuration file to use (see MYSQL_READ_DEFAULT_GROUP option
+ * of mysql_options() in MySQL manual).
*/
APU_DECLARE(apr_status_t) apr_dbd_open(const apr_dbd_driver_t *driver,
apr_pool_t *pool, const char *params,