List:Internals« Previous MessageNext Message »
From:paul Date:February 10 2005 6:22pm
Subject:bk commit - mysqldoc tree (paul:1.2511)
View as plain text  
Below is the list of changes that have just been committed into a local
mysqldoc repository of paul. When paul does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.2511 05/02/10 12:22:41 paul@stripped +1 -0
  Document mysql_library_{init,end}(). (Bug #6149)

  Docs/manual.texi
    1.2323 05/02/10 12:19:43 paul@stripped +82 -7
    Document mysql_server_{init,end}(). (Bug #6149)

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	paul
# Host:	kite-hub.kitebird.com
# Root:	/src/extern/MySQL/bk/mysqldoc

--- 1.2322/Docs/manual.texi	2005-02-10 11:05:57 -06:00
+++ 1.2323/Docs/manual.texi	2005-02-10 12:19:43 -06:00
@@ -80517,6 +80517,28 @@
 @code{mysql_init()} allocates a new object, it will be freed when
 @code{mysql_close()} is called to close the connection.
 
+To avoid a memory leak, use the following procedure, which should be done
+whether the host program is linked with the @code{libmysqlclient} or
+@code{libmysqld} library:
+
+@itemize @bullet
+
+@item
+Call @code{mysql_library_init()} before the first call to @code{mysql_init()}
+
+@item
+Call @code{mysql_library_end()} after the host program has closed any open
+connections and is done using the MySQL C API.
+
+@item
+If you like, the call to @code{mysql_library_init()} may be omitted,
+because @code{mysql_init()} will invoke it automatically as necessary.
+
+@end itemize
+
+@xref{mysql_library_init,  , @code{mysql_library_init()}}.
+@xref{mysql_library_end,  , @code{mysql_library_end()}}.
+
 @subsubheading Return Values
 
 An initialized @code{MYSQL*} handle.  @code{NULL} if there was
@@ -84226,6 +84248,7 @@
 call @code{mysql_thread_init()} for this thread.
 
 This is automatically called by @code{mysql_init()},
+@code{mysql_library_init()},
 @code{mysql_server_init()} and @code{mysql_connect()}.
 
 @subsubheading Return Values
@@ -84287,21 +84310,57 @@
 @node C Embedded Server func, C API problems, C Thread functions, C
 @subsection C API Embedded Server Function Descriptions
 
-You must use the following functions if you want to allow your
-application to be linked against the embedded MySQL server library.
+If you want to allow your application to be linked against the embedded
+MySQL server library, you must use the @code{mysql_server_init()} and
+@code{mysql_server_end()} functions.
 @xref{libmysqld}.
 
-If the program is linked with @code{-lmysqlclient} instead of
-@code{-lmysqld}, these functions do nothing.  This makes it
-possible to choose between using the embedded MySQL server and
-a standalone server without modifying any code.
+However, to avoid a memory leak, even programs that are linked with
+@code{-lmysqlclient} rather than @code{-lmysqld} should include calls
+to begin and end use of the library.  As of MySQL 4.1.10 and 5.0.3, the
+@code{mysql_library_init()} and @code{mysql_library_end()} functions can be
+used to do this. These actually are @code{#define} symbols that make them
+equivalent to @code{mysql_server_init()} and @code{mysql_server_end()}, but
+the names more clearly indicate that they should be called when beginning
+and ending use of a MySQL C API library no matter whether the host program
+uses @code{libmysqlclient} or @code{libmysqld}.  For more information, see
+@ref{mysql_init,  , @code{mysql_init()}}.
 
 @menu
+* mysql_library_init::          @code{mysql_library_init()}
+* mysql_library_end::           @code{mysql_library_end()}
 * mysql_server_init::           @code{mysql_server_init()}
 * mysql_server_end::            @code{mysql_server_end()}
 @end menu
 
-@node mysql_server_init, mysql_server_end, C Embedded Server func, C Embedded Server func
+
+@node mysql_library_init, mysql_library_end, C Embedded Server func, C Embedded Server func
+@subsubsection @code{mysql_library_init()}
+
+@findex @code{mysql_library_init()}
+
+@code{int mysql_library_init(int argc, char **argv, char **groups)}
+
+@subsubheading Description
+
+This is a synonym for the @code{mysql_server_init()} function.
+It was added in MySQL 4.1.10 and 5.0.3.
+
+
+@node mysql_library_end, mysql_server_init, mysql_library_init, C Embedded Server func
+@subsubsection @code{mysql_library_end()}
+
+@findex @code{mysql_library_end()}
+
+@code{void mysql_library_end(void)}
+
+@subsubheading Description
+
+This is a synonym for the @code{mysql_server_end()} function.
+It was added in MySQL 4.1.10 and 5.0.3.
+
+
+@node mysql_server_init, mysql_server_end, mysql_library_end, C Embedded Server func
 @subsubsection @code{mysql_server_init()}
 
 @findex @code{mysql_server_init()}
@@ -96049,6 +96108,14 @@
 Functionality added or changed:
 @itemize @bullet
 @item
+Added @code{mysql_library_init()} and @code{mysql_library_end()} as
+synonyms for the @code{mysql_server_init()} and @code{mysql_server_end()}
+C API functions.  @code{mysql_library_init()} and @code{mysql_library_end()}
+are @code{#define} symbols, but the names more clearly indicate that they
+should be called when beginning and ending use of a MySQL C API
+library no matter whether the host program uses @code{libmysqlclient}
+or @code{libmysqld}. (Bug #6149)
+@item
 @code{SHOW COLUMNS} now displays @code{NO} rather than blank in the
 @code{Null} output column if the corresponding table column cannot be
 @code{NULL}.
@@ -96944,6 +97011,14 @@
 
 Functionality added or changed:
 @itemize @bullet
+@item
+Added @code{mysql_library_init()} and @code{mysql_library_end()} as
+synonyms for the @code{mysql_server_init()} and @code{mysql_server_end()}
+C API functions.  @code{mysql_library_init()} and @code{mysql_library_end()}
+are @code{#define} symbols, but the names more clearly indicate that they
+should be called when beginning and ending use of a MySQL C API
+library no matter whether the host program uses @code{libmysqlclient}
+or @code{libmysqld}. (Bug #6149)
 @item
 The server now issues a warning when @code{lower_case_table_names=2} and the
 data directory is on a case-sensitive filesystem, just as when
Thread
bk commit - mysqldoc tree (paul:1.2511)paul10 Feb