Commit e5e7cd8e authored by unknown's avatar unknown

Proposal to fix this problem: when using libmysqlclient, you must call...

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:
  Creating synonyms (defines): mysql_library_init for mysql_server_init, mysql_library_end for mysql_server_end;
  these new names are more generic, so suitable when using libmysqlclient as well as libmysqld.c
parent 0c27d518
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment