diff options
author | guilhem@mysql.com <> | 2005-02-04 13:53:16 +0100 |
---|---|---|
committer | guilhem@mysql.com <> | 2005-02-04 13:53:16 +0100 |
commit | cb23d3d064d1fa9e69571298c3dccf4c292f6a06 (patch) | |
tree | 6a2153ee002a819b545f9cd4c809edf7466923a1 /include/mysql.h | |
parent | 68aefd155c511923b0727ad8975f85d2e76de742 (diff) | |
download | mariadb-git-cb23d3d064d1fa9e69571298c3dccf4c292f6a06.tar.gz |
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.
Diffstat (limited to 'include/mysql.h')
-rw-r--r-- | include/mysql.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/mysql.h b/include/mysql.h index 58c314207c1..b87b865608e 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); |