Commit 2918e5d5 authored by hf@deer.(none)'s avatar hf@deer.(none)

Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1

into deer.(none):/home/hf/work/mysql-4.1.clean
parents 282b4028 b04af449
......@@ -435,11 +435,6 @@ void STDCALL mysql_server_end()
my_free((char*) copy_arguments_ptr, MYF(MY_ALLOW_ZERO_PTR));
copy_arguments_ptr=0;
clean_up(0);
#ifdef THREAD
/* Don't call my_thread_end() if the application is using MY_INIT() */
if (!org_my_init_done)
my_thread_end();
#endif
/* If library called my_init(), free memory allocated by it */
if (!org_my_init_done)
my_end(0);
......
......@@ -20,27 +20,28 @@
#include "mysql_priv.h"
#include "mysys_err.h"
static void read_texts(const char *file_name,const char ***point,
static bool read_texts(const char *file_name,const char ***point,
uint error_messages);
static void init_myfunc_errs(void);
/* Read messages from errorfile */
void init_errmessage(void)
bool init_errmessage(void)
{
DBUG_ENTER("init_errmessage");
read_texts(ERRMSG_FILE,&my_errmsg[ERRMAPP],ER_ERROR_MESSAGES);
if (read_texts(ERRMSG_FILE,&my_errmsg[ERRMAPP],ER_ERROR_MESSAGES))
DBUG_RETURN(TRUE);
errmesg=my_errmsg[ERRMAPP]; /* Init global variabel */
init_myfunc_errs(); /* Init myfunc messages */
DBUG_VOID_RETURN;
DBUG_RETURN(FALSE);
}
/* Read text from packed textfile in language-directory */
/* If we can't read messagefile then it's panic- we can't continue */
static void read_texts(const char *file_name,const char ***point,
static bool read_texts(const char *file_name,const char ***point,
uint error_messages)
{
register uint i;
......@@ -116,7 +117,7 @@ Check that the above file is the right version for this program!",
point[i]= *point +uint2korr(head+10+i+i);
}
VOID(my_close(file,MYF(0)));
DBUG_VOID_RETURN;
DBUG_RETURN(FALSE);
err:
switch (funktpos) {
......
......@@ -37,7 +37,9 @@ void unireg_init(ulong options)
#ifdef USE_MY_ATOF
init_my_atof(); /* use our atof */
#endif
#ifndef EMBEDDED_LIBRARY
my_abort_hook=unireg_abort; /* Abort with close of databases */
#endif
VOID(strmov(reg_ext,".frm"));
for (i=0 ; i < 6 ; i++) // YYMMDDHHMMSS
......
......@@ -725,7 +725,7 @@ void key_restore(TABLE *form,byte *key,uint index,uint key_length);
int key_cmp(TABLE *form,const byte *key,uint index,uint key_length);
void key_unpack(String *to,TABLE *form,uint index);
bool check_if_key_used(TABLE *table, uint idx, List<Item> &fields);
void init_errmessage(void);
bool init_errmessage(void);
void sql_perror(const char *message);
void sql_print_error(const char *format,...)
......@@ -937,7 +937,11 @@ extern String *make_datetime(String *str, TIME *l_time,
int test_if_number(char *str,int *res,bool allow_wildcards);
void change_byte(byte *,uint,char,char);
#ifndef EMBEDDED_LIBRARY
extern "C" void unireg_abort(int exit_code);
#else
#define unireg_abort(exit_code) DBUG_RETURN(exit_code)
#endif
void init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
SQL_SELECT *select,
int use_record_cache, bool print_errors);
......
......@@ -851,6 +851,7 @@ extern "C" sig_handler print_signal_warning(int sig)
(Mac OS X) we have to call exit() instead if pthread_exit().
*/
#ifndef EMBEDDED_LIBRARY
void unireg_end(void)
{
clean_up(1);
......@@ -862,7 +863,6 @@ void unireg_end(void)
#endif
}
extern "C" void unireg_abort(int exit_code)
{
DBUG_ENTER("unireg_abort");
......@@ -874,7 +874,7 @@ extern "C" void unireg_abort(int exit_code)
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
exit(exit_code); /* purecov: inspected */
}
#endif
void clean_up(bool print_message)
{
......@@ -1024,6 +1024,7 @@ static void set_ports()
}
}
#ifndef EMBEDDED_LIBRARY
/* Change to run as another user if started with --user */
static void set_user(const char *user)
......@@ -1106,7 +1107,6 @@ static void set_root(const char *path)
#endif
}
static void server_init(void)
{
struct sockaddr_in IPaddr;
......@@ -1257,6 +1257,7 @@ static void server_init(void)
DBUG_VOID_RETURN;
}
#endif /*!EMBEDDED_LIBRARY*/
void yyerror(const char *s)
{
......@@ -2120,7 +2121,8 @@ static int init_common_variables(const char *conf_file_name, int argc,
open_files_limit= 0; /* Can't set or detect limit */
#endif
unireg_init(opt_specialflag); /* Set up extern variabels */
init_errmessage(); /* Read error messages from file */
if (init_errmessage()) /* Read error messages from file */
return 1;
init_client_errs();
lex_init();
item_init();
......@@ -2233,6 +2235,7 @@ static void init_ssl()
static int init_server_components()
{
DBUG_ENTER("init_server_components");
table_cache_init();
hostname_cache_init();
query_cache_result_size_limit(query_cache_limit);
......@@ -2324,7 +2327,7 @@ Now disabling --log-slave-updates.");
init_max_user_conn();
init_update_queries();
return 0;
DBUG_RETURN(0);
}
......@@ -5604,8 +5607,10 @@ static void get_options(int argc,char **argv)
/* Set global MyISAM variables from delay_key_write_options */
fix_delay_key_write((THD*) 0, OPT_GLOBAL);
#ifndef EMBEDDED_LIBRARY
if (mysqld_chroot)
set_root(mysqld_chroot);
#endif
fix_paths();
/*
......
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