apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r586254 - in /apr/apr-util/branches/1.2.x: dbd/apr_dbd_mysql.c include/apr_dbd.h
Date Fri, 19 Oct 2007 03:57:26 GMT
Author: bojan
Date: Thu Oct 18 20:57:25 2007
New Revision: 586254

URL: http://svn.apache.org/viewvc?rev=586254&view=rev
Log:
Backport r586248 and r586253 from the trunk
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/branches/1.2.x/dbd/apr_dbd_mysql.c
    apr/apr-util/branches/1.2.x/include/apr_dbd.h

Modified: apr/apr-util/branches/1.2.x/dbd/apr_dbd_mysql.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/dbd/apr_dbd_mysql.c?rev=586254&r1=586253&r2=586254&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/dbd/apr_dbd_mysql.c (original)
+++ apr/apr-util/branches/1.2.x/dbd/apr_dbd_mysql.c Thu Oct 18 20:57:25 2007
@@ -610,6 +610,7 @@
         {"sock", NULL},
         {"flags", NULL},
         {"fldsz", NULL},
+        {"group", NULL},
         {NULL, NULL}
     };
     unsigned int port = 0;
@@ -653,6 +654,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 */
@@ -734,6 +738,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/branches/1.2.x/include/apr_dbd.h
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/include/apr_dbd.h?rev=586254&r1=586253&r2=586254&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/include/apr_dbd.h (original)
+++ apr/apr-util/branches/1.2.x/include/apr_dbd.h Thu Oct 18 20:57:25 2007
@@ -79,13 +79,15 @@
  *  function as a filename to be opened (check SQLite3 documentation for more
  *  details).
  *  @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 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,



Mime
View raw message