diff options
author | unknown <monty@narttu.mysql.fi> | 2007-08-14 00:22:34 +0300 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2007-08-14 00:22:34 +0300 |
commit | c5f0611fadd910a8a169e35bdd7e572080530efe (patch) | |
tree | 2641806010f25bf6469538558e05487ecff3c959 /sql/mysqld.cc | |
parent | 6930ac54068b88ce5ca2476f70d74ddb42f5d9fc (diff) | |
parent | 09a53f28a73d8000bab902611f609a44d87f329d (diff) | |
download | mariadb-git-c5f0611fadd910a8a169e35bdd7e572080530efe.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into mysql.com:/home/my/mysql-5.1
configure.in:
Auto merged
client/mysql.cc:
Auto merged
include/m_ctype.h:
Auto merged
sql/field.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/handler.h:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_string.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
storage/myisam/mi_rkey.c:
Auto merged
client/mysqldump.c:
Manual merge (trivial)
scripts/mysql_install_db.sh:
Complex merge (parital rewrite of new code)
sql/sql_show.cc:
Manual merge
tests/mysql_client_test.c:
then
if ! test -x "$print_defaults"
then
missing_in_basedir my_print_defaults
exit 1
fi
else
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index fe4f83dd79e..e2d05238ee9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -693,7 +693,7 @@ struct st_VioSSLFd *ssl_acceptor_fd; pthread_handler_t signal_hand(void *arg); static void mysql_init_variables(void); static void get_options(int *argc,char **argv); -static my_bool get_one_option(int, const struct my_option *, char *); +extern "C" my_bool mysqld_get_one_option(int, const struct my_option *, char *); static void set_server_version(void); static int init_thread_environment(); static char *get_relative_path(const char *path); @@ -1141,6 +1141,7 @@ void unireg_end(void) extern "C" void unireg_abort(int exit_code) { DBUG_ENTER("unireg_abort"); + if (exit_code) sql_print_error("Aborting\n"); else if (opt_help) @@ -2353,7 +2354,7 @@ static void init_signals(void) sigaddset(&set,SIGTSTP); #endif if (thd_lib_detected != THD_LIB_LT) - sigaddset(&set,THR_SERVER_ALARM); + sigaddset(&set,THR_SERVER_ALARM); if (test_flags & TEST_SIGINT) { // May be SIGINT @@ -2549,7 +2550,9 @@ static void check_data_home(const char *path) /* ARGSUSED */ -static int my_message_sql(uint error, const char *str, myf MyFlags) +extern "C" int my_message_sql(uint error, const char *str, myf MyFlags); + +int my_message_sql(uint error, const char *str, myf MyFlags) { THD *thd; DBUG_ENTER("my_message_sql"); @@ -2612,13 +2615,16 @@ static int my_message_sql(uint error, const char *str, myf MyFlags) #ifndef EMBEDDED_LIBRARY -static void *my_str_malloc_mysqld(size_t size) +extern "C" void *my_str_malloc_mysqld(size_t size); +extern "C" void my_str_free_mysqld(void *ptr); + +void *my_str_malloc_mysqld(size_t size) { return my_malloc(size, MYF(MY_FAE)); } -static void my_str_free_mysqld(void *ptr) +void my_str_free_mysqld(void *ptr) { my_free((uchar*)ptr, MYF(MY_FAE)); } @@ -3418,7 +3424,7 @@ server."); my_getopt_skip_unknown= 0; if ((ho_error= handle_options(&defaults_argc, &tmp_argv, no_opts, - get_one_option))) + mysqld_get_one_option))) unireg_abort(ho_error); if (defaults_argc) @@ -3902,7 +3908,6 @@ we force server id to 2, but this MySQL server will not act as a slave."); */ if (init_slave() && !active_mi) { - end_thr_alarm(1); // Don't allow alarms unireg_abort(1); } @@ -3910,16 +3915,12 @@ we force server id to 2, but this MySQL server will not act as a slave."); { select_thread_in_use= 0; // Allow 'kill' to work bootstrap(stdin); - end_thr_alarm(1); // Don't allow alarms unireg_abort(bootstrap_error ? 1 : 0); } if (opt_init_file) { if (read_init_file(opt_init_file)) - { - end_thr_alarm(1); // Don't allow alarms unireg_abort(1); - } } execute_ddl_log_recovery(); @@ -6873,6 +6874,7 @@ SHOW_VAR status_vars[]= { {"Open_streams", (char*) &my_stream_opened, SHOW_LONG_NOFLUSH}, {"Open_table_definitions", (char*) &show_table_definitions, SHOW_FUNC}, {"Open_tables", (char*) &show_open_tables, SHOW_FUNC}, + {"Opened_files", (char*) &my_file_total_opened, SHOW_LONG_NOFLUSH}, {"Opened_tables", (char*) offsetof(STATUS_VAR, opened_tables), SHOW_LONG_STATUS}, {"Prepared_stmt_count", (char*) &show_prepared_stmt_count, SHOW_FUNC}, #ifdef HAVE_QUERY_CACHE @@ -7240,9 +7242,10 @@ static void mysql_init_variables(void) } -static my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), - char *argument) +my_bool +mysqld_get_one_option(int optid, + const struct my_option *opt __attribute__((unused)), + char *argument) { switch(optid) { case '#': @@ -7738,7 +7741,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), /* Handle arguments for multiple key caches */ -static uchar* * +extern "C" uchar **mysql_getopt_value(const char *keyname, uint key_length, + const struct my_option *option); + +uchar* * mysql_getopt_value(const char *keyname, uint key_length, const struct my_option *option) { @@ -7767,11 +7773,19 @@ mysql_getopt_value(const char *keyname, uint key_length, } -static void option_error_reporter(enum loglevel level, const char *format, ...) +extern "C" void option_error_reporter(enum loglevel level, const char *format, ...); + +void option_error_reporter(enum loglevel level, const char *format, ...) { va_list args; va_start(args, format); - vprint_msg_to_log(level, format, args); + + /* Don't print warnings for --loose options during bootstrap */ + if (level == ERROR_LEVEL || !opt_bootstrap || + global_system_variables.log_warnings) + { + vprint_msg_to_log(level, format, args); + } va_end(args); } @@ -7789,7 +7803,7 @@ static void get_options(int *argc,char **argv) my_getopt_skip_unknown= TRUE; if ((ho_error= handle_options(argc, &argv, my_long_options, - get_one_option))) + mysqld_get_one_option))) exit(ho_error); (*argc)++; /* add back one for the progname handle_options removes */ /* no need to do this for argv as we are discarding it. */ @@ -8150,7 +8164,7 @@ void refresh_status(THD *thd) add_to_status(&global_status_var, &thd->status_var); /* Reset thread's status variables */ - bzero((char*) &thd->status_var, sizeof(thd->status_var)); + bzero((uchar*) &thd->status_var, sizeof(thd->status_var)); /* Reset some global variables */ reset_status_vars(); |