From cb23d3d064d1fa9e69571298c3dccf4c292f6a06 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Fri, 4 Feb 2005 13:53:16 +0100 Subject: [PATCH] Proposal to fix this problem: when using libmysqlclient, you must call mysql_server_end() to nicely free memory at the end of your program; it however sounds weird to call a function named *SERVER_end* when you're the CLIENT (you're not ending the server, you're ending your ability to talk to servers). So here I add two defines which should be more generic names. This was longly discussed with Konstantin, Serg, Brian. The problem started from a post on valgrind-users list: http://sourceforge.net/mailarchive/forum.php?thread_id=5778035&forum_id=32038 ; our manual mentions these functions only for libmysqld API so needs some fixing, and then we can close BUG#8099 and BUG#6149. --- include/mysql.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/mysql.h b/include/mysql.h index 58c314207c..b87b865608 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -337,6 +337,17 @@ typedef struct st_mysql_parameters */ int STDCALL mysql_server_init(int argc, char **argv, char **groups); void STDCALL mysql_server_end(void); +/* + mysql_server_init/end need to be called when using libmysqld or + libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so + you don't need to call it explicitely; but you need to call + mysql_server_end() to free memory). The names are a bit misleading + (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general + names which suit well whether you're using libmysqld or libmysqlclient. We + intend to promote these aliases over the mysql_server* ones. +*/ +#define mysql_library_init mysql_server_init +#define mysql_library_end mysql_server_end MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void); -- 2.30.9