summaryrefslogtreecommitdiff
path: root/libmysql/libmysql.c
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2003-12-19 16:34:48 +0200
committerunknown <monty@mysql.com>2003-12-19 16:34:48 +0200
commit245b1385a10a12a955c95338b08190cac5cfcbd4 (patch)
tree05b144ca850fc0bb99c1922907bfb2e9ba19fc77 /libmysql/libmysql.c
parent060122db13c995908835ca338aeeab848024e266 (diff)
parent9c2a63e35eec7a1af94dde1f10331361124a69f4 (diff)
downloadmariadb-git-245b1385a10a12a955c95338b08190cac5cfcbd4.tar.gz
merge
client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged include/my_global.h: Auto merged libmysqld/lib_sql.cc: Auto merged mysql-test/r/warnings.result: Auto merged mysql-test/t/type_enum.test: Auto merged sql/field.cc: Auto merged sql/lex.h: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r--libmysql/libmysql.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index a6718d6f320..728454a50fb 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -94,6 +94,25 @@ my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list);
static my_bool mysql_client_init= 0;
static my_bool org_my_init_done= 0;
+
+/*
+ Initialize the MySQL client library
+
+ SYNOPSIS
+ mysql_server_init()
+
+ NOTES
+ Should be called before doing any other calls to the MySQL
+ client library to initialize thread specific variables etc.
+ It's called by mysql_init() to ensure that things will work for
+ old not threaded applications that doesn't call mysql_server_init()
+ directly.
+
+ RETURN
+ 0 ok
+ 1 could not initialize environment (out of memory or thread keys)
+*/
+
int STDCALL mysql_server_init(int argc, char **argv, char **groups)
{
int result= 0;
@@ -101,7 +120,8 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
{
mysql_client_init=1;
org_my_init_done=my_init_done;
- my_init(); /* Will init threads */
+ if (my_init()) /* Will init threads */
+ return 1;
init_client_errs();
if (!mysql_port)
{
@@ -141,6 +161,7 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
return result;
}
+
void STDCALL mysql_server_end()
{
end_embedded_server();