summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-05-22 02:57:27 +0300
committerunknown <monty@mashka.mysql.fi>2003-05-22 02:57:27 +0300
commit99740ff53d21e4ae50764d0170a08562222d2150 (patch)
treeed5eeb9e58454d28807426e58e1c1c16e4c08de4 /sql/mysqld.cc
parent4637832fa19b2866929c1e5cb7c9dd0a40db15c9 (diff)
parentf72611b4fa7eb45259b26d75a733f7a29d20dc04 (diff)
downloadmariadb-git-99740ff53d21e4ae50764d0170a08562222d2150.tar.gz
merge
VC++Files/libmysql/libmysql.dsp: Auto merged client/mysqlbinlog.cc: Auto merged include/my_sys.h: Auto merged libmysql/libmysql.def: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/group_by.result: Auto merged mysql-test/r/key.result: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/r/null_key.result: Auto merged mysql-test/r/order_by.result: Auto merged mysql-test/r/type_decimal.result: Auto merged mysql-test/r/variables.result: Auto merged mysql-test/t/ctype_latin1_de-master.opt: Auto merged mysql-test/t/variables.test: Auto merged mysys/charset.c: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/item.h: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/share/czech/errmsg.txt: Auto merged sql/share/danish/errmsg.txt: Auto merged sql/share/dutch/errmsg.txt: Auto merged sql/share/english/errmsg.txt: Auto merged sql/share/estonian/errmsg.txt: Auto merged sql/share/french/errmsg.txt: Auto merged sql/share/german/errmsg.txt: Auto merged sql/share/greek/errmsg.txt: Auto merged sql/share/hungarian/errmsg.txt: Auto merged sql/share/italian/errmsg.txt: Auto merged sql/share/japanese/errmsg.txt: Auto merged sql/share/korean/errmsg.txt: Auto merged sql/share/norwegian-ny/errmsg.txt: Auto merged sql/share/norwegian/errmsg.txt: Auto merged sql/share/portuguese/errmsg.txt: Auto merged sql/share/romanian/errmsg.txt: Auto merged sql/share/russian/errmsg.txt: Auto merged sql/share/slovak/errmsg.txt: Auto merged sql/share/spanish/errmsg.txt: Auto merged sql/share/swedish/errmsg.txt: Auto merged sql/share/ukrainian/errmsg.txt: Auto merged
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc660
1 files changed, 389 insertions, 271 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1036e4d2835..8037da06c33 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -46,7 +46,7 @@
#define MAIN_THD
#define SIGNAL_THD
-#ifdef PURIFY
+#ifdef HAVE_purify
#define IF_PURIFY(A,B) (A)
#else
#define IF_PURIFY(A,B) (B)
@@ -116,7 +116,7 @@ int deny_severity = LOG_WARNING;
#define my_fromhost(A) fromhost()
#define my_hosts_access(A) hosts_access()
#define my_eval_client(A) eval_client()
-#endif
+#endif /* __STDC__ */
#endif /* HAVE_LIBWRAP */
#ifdef HAVE_SYS_MMAN_H
@@ -128,8 +128,8 @@ int deny_severity = LOG_WARNING;
#include <library.h>
#include <monitor.h>
-event_handle_t eh;
-Report_t ref;
+static event_handle_t eh;
+static Report_t ref;
#endif /* __NETWARE__ */
#ifdef _AIX41
@@ -169,6 +169,7 @@ inline void reset_floating_point_exceptions()
#else
#define THR_KILL_SIGNAL SIGUSR2 // Can't use this with LinuxThreads
#endif
+#define MYSQL_KILL_SIGNAL SIGTERM
#ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
#include <sys/types.h>
@@ -183,229 +184,95 @@ inline void reset_floating_point_exceptions()
extern "C" int gethostname(char *name, int namelen);
#endif
-#define MYSQL_KILL_SIGNAL SIGTERM
-
-#ifndef DBUG_OFF
-static const char* default_dbug_option=IF_WIN("d:t:i:O,\\mysqld.trace",
- "d:t:i:o,/tmp/mysqld.trace");
-#endif
-
-#ifdef __NT__
-static char szPipeName [ 257 ];
-static SECURITY_ATTRIBUTES saPipeSecurity;
-static SECURITY_DESCRIPTOR sdPipeDescriptor;
-static HANDLE hPipe = INVALID_HANDLE_VALUE;
-#endif
-#ifdef __WIN__
-static pthread_cond_t COND_handler_count;
-static uint handler_count;
-static bool start_mode=0, use_opt_args;
-static int opt_argc;
-static char **opt_argv;
-#endif
/* Set prefix for windows binary */
#ifdef __WIN__
#undef MYSQL_SERVER_SUFFIX
#ifdef __NT__
-#if defined(HAVE_INNOBASE_DB) || defined(HAVE_BERKELEY_DB)
+#if defined(HAVE_BERKELEY_DB)
#define MYSQL_SERVER_SUFFIX "-max-nt"
#else
#define MYSQL_SERVER_SUFFIX "-nt"
#endif /* ...DB */
-#elif defined(HAVE_INNOBASE_DB) || defined(HAVE_BERKELEY_DB)
+#elif defined(HAVE_BERKELEY_DB)
#define MYSQL_SERVER_SUFFIX "-max"
#else
#define MYSQL_SERVER_SUFFIX ""
#endif /* __NT__ */
#endif /* __WIN__ */
-#ifdef HAVE_BERKELEY_DB
-SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_YES;
-#else
-SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_NO;
-#endif
-#ifdef HAVE_INNOBASE_DB
-SHOW_COMP_OPTION have_innodb=SHOW_OPTION_YES;
-#else
-SHOW_COMP_OPTION have_innodb=SHOW_OPTION_NO;
-#endif
-#ifdef HAVE_ISAM
-SHOW_COMP_OPTION have_isam=SHOW_OPTION_YES;
-#else
-SHOW_COMP_OPTION have_isam=SHOW_OPTION_NO;
-#endif
-#ifdef USE_RAID
-SHOW_COMP_OPTION have_raid=SHOW_OPTION_YES;
-#else
-SHOW_COMP_OPTION have_raid=SHOW_OPTION_NO;
-#endif
-#ifdef HAVE_OPENSSL
-SHOW_COMP_OPTION have_openssl=SHOW_OPTION_YES;
-#else
-SHOW_COMP_OPTION have_openssl=SHOW_OPTION_NO;
-#endif
-#ifdef HAVE_BROKEN_REALPATH
-SHOW_COMP_OPTION have_symlink=SHOW_OPTION_NO;
-#else
-SHOW_COMP_OPTION have_symlink=SHOW_OPTION_YES;
-#endif
-#ifdef HAVE_QUERY_CACHE
-SHOW_COMP_OPTION have_query_cache=SHOW_OPTION_YES;
-#else
-SHOW_COMP_OPTION have_query_cache=SHOW_OPTION_NO;
-#endif
-#ifdef HAVE_CRYPT
-SHOW_COMP_OPTION have_crypt=SHOW_OPTION_YES;
-#else
-SHOW_COMP_OPTION have_crypt=SHOW_OPTION_NO;
-#endif
-#ifdef HAVE_COMPRESS
-SHOW_COMP_OPTION have_compress= SHOW_OPTION_YES;
-#else
-SHOW_COMP_OPTION have_compress= SHOW_OPTION_NO;
-#endif
-const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
+/* Constants */
-bool opt_large_files= sizeof(my_off_t) > 4;
+const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
+const char *sql_mode_names[] =
+{
+ "REAL_AS_FLOAT", "PIPES_AS_CONCAT", "ANSI_QUOTES", "IGNORE_SPACE",
+ "SERIALIZE", "ONLY_FULL_GROUP_BY", "NO_UNSIGNED_SUBTRACTION",
+ "POSTGRESQL", "ORACLE", "MSSQL", "DB2", "SAPDB", "NO_KEY_OPTIONS",
+ "NO_TABLE_OPTIONS", "NO_FIELD_OPTIONS", "MYSQL323", "MYSQL40",
+ NullS
+};
+TYPELIB sql_mode_typelib= { array_elements(sql_mode_names)-1,"",
+ sql_mode_names };
+const char *first_keyword= "first", *binary_keyword= "BINARY";
+const char *localhost= "localhost", *delayed_user= "DELAYED";
#if SIZEOF_OFF_T > 4 && defined(BIG_TABLES)
#define GET_HA_ROWS GET_ULL
#else
#define GET_HA_ROWS GET_ULONG
#endif
-#ifdef HAVE_LIBWRAP
-char *libwrapName= NULL;
-#endif
+bool opt_large_files= sizeof(my_off_t) > 4;
+arg_cmp_func Arg_comparator::comparator_matrix[4][2] =
+{{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string},
+ {&Arg_comparator::compare_real, &Arg_comparator::compare_e_real},
+ {&Arg_comparator::compare_int, &Arg_comparator::compare_e_int},
+ {&Arg_comparator::compare_row, &Arg_comparator::compare_e_row}};
-/*
- Variables to store startup options
-*/
-my_bool opt_skip_slave_start = 0; // If set, slave is not autostarted
-/*
- If set, some standard measures to enforce slave data integrity will not
- be performed
-*/
-my_bool opt_reckless_slave = 0;
+/* Global variables */
-ulong back_log, connect_timeout, concurrency;
-char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], time_zone[30];
-char log_error_file[FN_REFLEN];
bool opt_log, opt_update_log, opt_bin_log, opt_slow_log;
bool opt_error_log= IF_WIN(1,0);
bool opt_disable_networking=0, opt_skip_show_db=0;
+bool server_id_supplied = 0;
+bool opt_endinfo,using_udf_functions, locked_in_memory;
+bool opt_using_transactions, using_update_log;
+bool volatile abort_loop, select_thread_in_use, signal_thread_in_use;
+bool volatile ready_to_exit, shutdown_in_progress, grant_option;
+
+my_bool opt_skip_slave_start = 0; // If set, slave is not autostarted
+my_bool opt_reckless_slave = 0;
my_bool opt_enable_named_pipe= 0;
my_bool opt_local_infile, opt_external_locking, opt_slave_compressed_protocol;
-uint delay_key_write_options= (uint) DELAY_KEY_WRITE_ON;
-
-static bool opt_do_pstack = 0;
-static ulong opt_specialflag=SPECIAL_ENGLISH;
-
-static ulong opt_myisam_block_size;
-static my_socket unix_sock= INVALID_SOCKET,ip_sock= INVALID_SOCKET;
-static my_string opt_logname=0,opt_update_logname=0,
- opt_binlog_index_name = 0,opt_slow_logname=0;
-
-static char* mysql_home_ptr= mysql_home;
-static char* pidfile_name_ptr= pidfile_name;
-char* log_error_file_ptr= log_error_file;
-static pthread_t select_thread;
-static my_bool opt_noacl=0, opt_bootstrap=0, opt_myisam_log=0;
my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
my_bool lower_case_table_names, opt_old_rpl_compat;
my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
my_bool opt_log_slave_updates= 0, opt_old_passwords=0, use_old_passwords=0;
my_bool opt_console= 0, opt_bdb, opt_innodb, opt_isam;
+my_bool opt_readonly, use_temp_pool, relay_log_purge;
+volatile bool mqh_used = 0;
-volatile bool mqh_used = 0;
-FILE *bootstrap_file=0;
-
-static bool kill_in_progress=0, segfaulted= 0;
-struct rand_struct sql_rand; // used by sql_class.cc:THD::THD()
-static int cleanup_done;
-static char **defaults_argv;
-char glob_hostname[FN_REFLEN];
+uint mysql_port, test_flags, select_errors, dropping_tables, ha_open_options;
+uint delay_key_write_options, protocol_version;
+uint volatile thread_count, thread_running, kill_cached_threads, wake_thread;
-#include "sslopt-vars.h"
-#ifdef HAVE_OPENSSL
-char *des_key_file = 0;
-struct st_VioSSLAcceptorFd *ssl_acceptor_fd= 0;
-#endif /* HAVE_OPENSSL */
-
-I_List <i_string_pair> replicate_rewrite_db;
-I_List<i_string> replicate_do_db, replicate_ignore_db;
-// allow the user to tell us which db to replicate and which to ignore
-I_List<i_string> binlog_do_db, binlog_ignore_db;
-
-/* if we guessed server_id , we need to know about it */
-ulong server_id= 0; // Must be long becasue of set_var.cc
-bool server_id_supplied = 0;
-
-uint mysql_port;
-uint test_flags = 0, select_errors=0, dropping_tables=0,ha_open_options=0;
-uint volatile thread_count=0, thread_running=0, kill_cached_threads=0,
- wake_thread=0;
-ulong thd_startup_options=(OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL |
- OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE );
-uint protocol_version=PROTOCOL_VERSION;
-struct system_variables global_system_variables;
-struct system_variables max_system_variables;
-ulonglong keybuff_size;
-ulong table_cache_size,
- thread_stack,
- thread_stack_min,what_to_log= ~ (1L << (uint) COM_TIME),
- query_buff_size,
- slow_launch_time = 2L,
- slave_open_temp_tables=0,
- open_files_limit=0, max_binlog_size;
-ulong com_stat[(uint) SQLCOM_END], com_other;
+ulong back_log, connect_timeout, concurrency;
+ulong server_id, thd_startup_options;
+ulong table_cache_size, thread_stack, thread_stack_min, what_to_log;
+ulong query_buff_size, slow_launch_time, slave_open_temp_tables;
+ulong open_files_limit, max_binlog_size;
ulong slave_net_timeout;
ulong thread_cache_size=0, binlog_cache_size=0, max_binlog_cache_size=0;
ulong query_cache_size=0;
-#ifdef HAVE_QUERY_CACHE
-ulong query_cache_limit= 0;
-ulong query_cache_min_res_unit= QUERY_CACHE_MIN_RESULT_DATA_SIZE;
-Query_cache query_cache;
-#endif
-arg_cmp_func Arg_comparator::comparator_matrix[4][2] =
-{{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string},
- {&Arg_comparator::compare_real, &Arg_comparator::compare_e_real},
- {&Arg_comparator::compare_int, &Arg_comparator::compare_e_int},
- {&Arg_comparator::compare_row, &Arg_comparator::compare_e_row}};
-#ifdef HAVE_SMEM
-char *shared_memory_base_name=default_shared_memory_base_name;
-my_bool opt_enable_shared_memory = 0;
-#endif
-
-volatile ulong cached_thread_count=0;
-
-// replication parameters, if master_host is not NULL, we are a slave
-my_string master_user = (char*) "test", master_password = 0, master_host=0,
- master_info_file = (char*) "master.info",
- relay_log_info_file = (char*) "relay-log.info",
- master_ssl_key=0, master_ssl_cert=0, master_ssl_capath=0, master_ssl_cipher=0;
-my_string report_user = 0, report_password = 0, report_host=0;
-
-const char *localhost=LOCAL_HOST;
-const char *delayed_user="DELAYED";
-uint master_port = MYSQL_PORT, master_connect_retry = 60;
-uint report_port = MYSQL_PORT;
-bool master_ssl = 0;
-
-ulong master_retry_count=0;
-ulong bytes_sent = 0L, bytes_received = 0L;
-
-bool opt_endinfo,using_udf_functions, locked_in_memory;
-bool opt_using_transactions, using_update_log;
-bool volatile abort_loop, select_thread_in_use, signal_thread_in_use;
-bool volatile ready_to_exit, shutdown_in_progress, grant_option;
+ulong com_stat[(uint) SQLCOM_END], com_other;
+ulong bytes_sent, bytes_received;
ulong refresh_version=1L,flush_version=1L; /* Increments on each reload */
-ulong query_id=1L,long_query_count,aborted_threads,
- aborted_connects,delayed_insert_timeout,delayed_insert_limit,
- delayed_queue_size,delayed_insert_threads,delayed_insert_writes,
- delayed_rows_in_use,delayed_insert_errors,flush_time, thread_created;
+ulong query_id, long_query_count, aborted_threads, aborted_connects;
+ulong delayed_insert_timeout, delayed_insert_limit, delayed_queue_size;
+ulong delayed_insert_threads, delayed_insert_writes, delayed_rows_in_use;
+ulong delayed_insert_errors,flush_time, thread_created;
ulong filesort_rows, filesort_range_count, filesort_scan_count;
ulong filesort_merge_passes;
ulong select_range_check_count, select_range_count, select_scan_count;
@@ -417,53 +284,51 @@ ulong max_connections,max_insert_delayed_threads,max_used_connections,
ulong thread_id=1L,current_pid;
ulong slow_launch_threads = 0;
ulong expire_logs_days = 0;
+ulong rpl_recovery_rank=0;
+ulong my_bind_addr; /* the address we bind to */
+volatile ulong cached_thread_count= 0;
+
+ulonglong keybuff_size;
+
+double log_10[32]; /* 10 potences */
+time_t start_time;
+
+char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], time_zone[30];
+char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN];
+char* log_error_file_ptr= log_error_file;
char mysql_real_data_home[FN_REFLEN],
- language[LIBLEN],reg_ext[FN_EXTLEN],
- mysql_charsets_dir[FN_REFLEN],
- blob_newline,f_fyllchar,max_sort_char,*mysqld_user,*mysqld_chroot,
- *opt_init_file;
+ language[LIBLEN],reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN],
+ max_sort_char,*mysqld_user,*mysqld_chroot, *opt_init_file;
char *language_ptr= language;
char mysql_data_home_buff[2], *mysql_data_home=mysql_real_data_home;
-char *default_collation_name= (char*) default_charset_info->name;
-#ifndef EMBEDDED_LIBRARY
-bool mysql_embedded=0;
-#else
-bool mysql_embedded=1;
-#endif
-
-static char *opt_bin_logname = 0;
-char *opt_relay_logname = 0, *opt_relaylog_index_name=0;
char server_version[SERVER_VERSION_LENGTH]=MYSQL_SERVER_VERSION;
-const char *first_keyword="first";
+char *mysql_unix_port, *opt_mysql_tmpdir;
+char *my_bind_addr_str;
const char **errmesg; /* Error messages */
const char *myisam_recover_options_str="OFF";
const char *sql_mode_str="OFF";
-ulong rpl_recovery_rank=0;
-my_bool relay_log_purge=1;
-my_string mysql_unix_port=NULL, opt_mysql_tmpdir=NULL;
-MY_TMPDIR mysql_tmpdir_list;
-ulong my_bind_addr; /* the address we bind to */
-char *my_bind_addr_str;
-DATE_FORMAT dayord;
-double log_10[32]; /* 10 potences */
+FILE *bootstrap_file;
+
+I_List <i_string_pair> replicate_rewrite_db;
+I_List<i_string> replicate_do_db, replicate_ignore_db;
+// allow the user to tell us which db to replicate and which to ignore
+I_List<i_string> binlog_do_db, binlog_ignore_db;
I_List<THD> threads,thread_cache;
-time_t start_time;
-const char *sql_mode_names[] =
-{
- "REAL_AS_FLOAT", "PIPES_AS_CONCAT", "ANSI_QUOTES", "IGNORE_SPACE",
- "SERIALIZE", "ONLY_FULL_GROUP_BY", "NO_UNSIGNED_SUBTRACTION",
- "POSTGRESQL", "ORACLE", "MSSQL", "DB2", "SAPDB", "NO_KEY_OPTIONS",
- "NO_TABLE_OPTIONS", "NO_FIELD_OPTIONS", "MYSQL323", "MYSQL40",
- NullS
-};
-TYPELIB sql_mode_typelib= {array_elements(sql_mode_names)-1,"",
- sql_mode_names};
+struct system_variables global_system_variables;
+struct system_variables max_system_variables;
+MY_TMPDIR mysql_tmpdir_list;
+DATE_FORMAT dayord;
MY_BITMAP temp_pool;
-my_bool use_temp_pool=0;
+
+SHOW_COMP_OPTION have_berkeley_db, have_innodb, have_isam;
+SHOW_COMP_OPTION have_raid, have_openssl, have_symlink, have_query_cache;
+SHOW_COMP_OPTION have_crypt, have_compress;
+
+/* Thread specific variables */
pthread_key(MEM_ROOT*,THR_MALLOC);
pthread_key(THD*, THR_THD);
@@ -481,24 +346,98 @@ pthread_cond_t COND_thread_cache,COND_flush_thread_cache;
pthread_t signal_thread;
pthread_attr_t connection_attrib;
+/* replication parameters, if master_host is not NULL, we are a slave */
+my_bool master_ssl;
+uint master_port= MYSQL_PORT, master_connect_retry = 60;
+uint report_port= MYSQL_PORT;
+ulong master_retry_count=0;
+char *master_user, *master_password, *master_host, *master_info_file;
+char *relay_log_info_file, *master_ssl_key, *master_ssl_cert;
+char *master_ssl_capath, *master_ssl_cipher, *report_user;
+char *report_password, *report_host;
+char *opt_relay_logname = 0, *opt_relaylog_index_name=0;
+
+/* Static variables */
+
+static bool kill_in_progress, segfaulted;
+static my_bool opt_do_pstack, opt_noacl, opt_bootstrap, opt_myisam_log;
+static int cleanup_done;
+static ulong opt_specialflag, opt_myisam_block_size;
+static char *opt_logname, *opt_update_logname, *opt_binlog_index_name;
+static char *opt_slow_logname;
+static char *mysql_home_ptr, *pidfile_name_ptr;
+static char **defaults_argv;
+static char *opt_bin_logname;
+
+static my_socket unix_sock,ip_sock;
+static pthread_t select_thread;
+struct rand_struct sql_rand; // used by sql_class.cc:THD::THD()
+
+/* OS specific variables */
+
#ifdef __WIN__
#undef getpid
#include <process.h>
+
+static pthread_cond_t COND_handler_count;
+static uint handler_count;
+static bool start_mode=0, use_opt_args;
+static int opt_argc;
+static char **opt_argv;
+
#if !defined(EMBEDDED_LIBRARY)
-HANDLE hEventShutdown;
+static HANDLE hEventShutdown;
static char shutdown_event_name[40];
#include "nt_servc.h"
static NTService Service; // Service object for WinNT
-#endif
+#endif /* EMBEDDED_LIBRARY */
+#endif /* __WIN__ */
+
+#ifdef __NT__
+static char szPipeName [ 257 ];
+static SECURITY_ATTRIBUTES saPipeSecurity;
+static SECURITY_DESCRIPTOR sdPipeDescriptor;
+static HANDLE hPipe = INVALID_HANDLE_VALUE;
#endif
#ifdef OS2
pthread_cond_t eventShutdown;
#endif
+#ifndef EMBEDDED_LIBRARY
+bool mysql_embedded=0;
+#else
+bool mysql_embedded=1;
+#endif
+
+#ifndef DBUG_OFF
+static const char* default_dbug_option;
+#endif
+#ifdef HAVE_LIBWRAP
+char *libwrapName= NULL;
+#endif
+#ifdef HAVE_QUERY_CACHE
+ulong query_cache_limit= 0;
+ulong query_cache_min_res_unit= QUERY_CACHE_MIN_RESULT_DATA_SIZE;
+Query_cache query_cache;
+#endif
+#ifdef HAVE_SMEM
+char *shared_memory_base_name= default_shared_memory_base_name;
+my_bool opt_enable_shared_memory;
+#endif
+
+#include "sslopt-vars.h"
+#ifdef HAVE_OPENSSL
+char *des_key_file;
+struct st_VioSSLAcceptorFd *ssl_acceptor_fd;
+#endif /* HAVE_OPENSSL */
+
+
+/* Function declarations */
+
static void start_signal_handler(void);
extern "C" pthread_handler_decl(signal_hand, arg);
-static void set_options(void);
+static void mysql_init_variables(void);
static void get_options(int argc,char **argv);
static int init_thread_environment();
static char *get_relative_path(const char *path);
@@ -824,9 +763,9 @@ static void __cdecl kill_server(int sig_ptr)
unireg_end();
#ifdef __NETWARE__
pthread_join(select_thread, NULL); // wait for main thread
-#else
- pthread_exit(0); /* purecov: deadcode */
#endif /* __NETWARE__ */
+
+ pthread_exit(0); /* purecov: deadcode */
#endif /* EMBEDDED_LIBRARY */
RETURN_FROM_KILL_SERVER;
@@ -884,13 +823,11 @@ void unireg_end(void)
{
clean_up(1);
my_thread_end();
-#ifndef __NETWARE__
-#ifdef SIGNALS_DONT_BREAK_READ
+#if defined(SIGNALS_DONT_BREAK_READ) && !defined(__NETWARE__)
exit(0);
#else
pthread_exit(0); // Exit is in main thread
#endif
-#endif /* __NETWARE__ */
}
@@ -954,6 +891,8 @@ void clean_up(bool print_message)
end_slave_list();
#endif
#ifdef HAVE_OPENSSL
+ if (ssl_acceptor_fd)
+ my_free((gptr) ssl_acceptor_fd, MYF(MY_ALLOW_ZERO_PTR));
free_des_key_file();
#endif /* HAVE_OPENSSL */
#ifdef USE_REGEX
@@ -1647,6 +1586,7 @@ static void init_signals(void)
sa.sa_handler=handle_segfault;
#endif
sigaction(SIGSEGV, &sa, NULL);
+ sigaction(SIGABRT, &sa, NULL);
#ifdef SIGBUS
sigaction(SIGBUS, &sa, NULL);
#endif
@@ -1732,9 +1672,10 @@ extern "C" void *signal_hand(void *arg __attribute__((unused)))
/*
Setup alarm handler
- The two extra handlers are for slave threads
+ This should actually be '+ max_number_of_slaves' instead of +10,
+ but the +10 should be quite safe.
*/
- init_thr_alarm(max_connections+max_insert_delayed_threads+2);
+ init_thr_alarm(max_connections+max_insert_delayed_threads+10);
#if SIGINT != THR_KILL_SIGNAL
(void) sigemptyset(&set); // Setup up SIGINT for debug
(void) sigaddset(&set,SIGINT); // For debugging
@@ -1997,6 +1938,7 @@ static int init_common_variables(const char *conf_file_name, int argc,
max_system_variables.pseudo_thread_id= (ulong)~0;
start_time=time((time_t*) 0);
+ mysql_init_variables();
#ifdef OS2
{
@@ -2035,7 +1977,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
load_defaults(conf_file_name, groups, &argc, &argv);
defaults_argv=argv;
- set_options();
get_options(argc,argv);
if (init_thread_environment())
return 1;
@@ -3482,10 +3423,11 @@ enum options
OPT_QUERY_CACHE_TYPE, OPT_RECORD_BUFFER,
OPT_RECORD_RND_BUFFER, OPT_RELAY_LOG_SPACE_LIMIT, OPT_RELAY_LOG_PURGE,
OPT_SLAVE_NET_TIMEOUT, OPT_SLAVE_COMPRESSED_PROTOCOL, OPT_SLOW_LAUNCH_TIME,
+ OPT_READONLY,
OPT_SORT_BUFFER, OPT_TABLE_CACHE,
OPT_THREAD_CONCURRENCY, OPT_THREAD_CACHE_SIZE,
OPT_TMP_TABLE_SIZE, OPT_THREAD_STACK,
- OPT_WAIT_TIMEOUT,
+ OPT_WAIT_TIMEOUT, OPT_MYISAM_REPAIR_THREADS,
OPT_INNODB_MIRRORED_LOG_GROUPS,
OPT_INNODB_LOG_FILES_IN_GROUP,
OPT_INNODB_LOG_FILE_SIZE,
@@ -3497,6 +3439,7 @@ enum options
OPT_INNODB_LOCK_WAIT_TIMEOUT,
OPT_INNODB_THREAD_CONCURRENCY,
OPT_INNODB_FORCE_RECOVERY,
+ OPT_INNODB_MAX_DIRTY_PAGES_PCT,
OPT_BDB_CACHE_SIZE,
OPT_BDB_LOG_BUFFER_SIZE,
OPT_BDB_MAX_LOCK,
@@ -3667,6 +3610,10 @@ Disable with --skip-bdb (will save memory)",
{"innodb_fast_shutdown", OPT_INNODB_FAST_SHUTDOWN,
"Speeds up server shutdown process", (gptr*) &innobase_fast_shutdown,
(gptr*) &innobase_fast_shutdown, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ {"innodb_max_dirty_pages_pct", OPT_INNODB_MAX_DIRTY_PAGES_PCT,
+ "Percentage of dirty pages allowed in bufferpool", (gptr*) &srv_max_buf_pool_modified_pct,
+ (gptr*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0},
+
#endif /* End HAVE_INNOBASE_DB */
{"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
@@ -3685,7 +3632,7 @@ Disable with --skip-bdb (will save memory)",
(gptr*) &opt_local_infile, 0, GET_BOOL, OPT_ARG,
1, 0, 0, 0, 0, 0},
{"log-bin", OPT_BIN_LOG,
- "Log queries in new binary format (for replication)",
+ "Log update queries in binary format",
(gptr*) &opt_bin_logname, (gptr*) &opt_bin_logname, 0, GET_STR_ALLOC,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-bin-index", OPT_BIN_LOG_INDEX,
@@ -3739,27 +3686,32 @@ Disable with --skip-bdb (will save memory)",
(gptr*) &master_retry_count, (gptr*) &master_retry_count, 0, GET_ULONG,
REQUIRED_ARG, 3600*24, 0, 0, 0, 0, 0},
{"master-info-file", OPT_MASTER_INFO_FILE,
- "The location of the file that remembers where we left off on the master during the replication process. The default is `master.info' in the data directory. You should not need to change this.",
+ "The location and name of the file that remembers the master and where the I/O replication \
+thread is in the master's binlogs.",
(gptr*) &master_info_file, (gptr*) &master_info_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"master-ssl", OPT_MASTER_SSL,
- "Turn SSL on for replication. Be warned that is this is a relatively new feature.",
+ "Planned to enable the slave to connect to the master using SSL. Does nothing yet.",
(gptr*) &master_ssl, (gptr*) &master_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"master-ssl-key", OPT_MASTER_SSL_KEY,
- "Master SSL keyfile name. Only applies if you have enabled master-ssl.",
+ "Master SSL keyfile name. Only applies if you have enabled master-ssl. Does \
+nothing yet.",
(gptr*) &master_ssl_key, (gptr*) &master_ssl_key, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"master-ssl-cert", OPT_MASTER_SSL_CERT,
- "Master SSL certificate file name. Only applies if you have enabled master-ssl.",
+ "Master SSL certificate file name. Only applies if you have enabled \
+master-ssl. Does nothing yet.",
(gptr*) &master_ssl_cert, (gptr*) &master_ssl_cert, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"master-ssl-capath", OPT_MASTER_SSL_CAPATH,
- "Master SSL CA path. Only applies if you have enabled master-ssl.",
+ "Master SSL CA path. Only applies if you have enabled master-ssl. \
+Does nothing yet.",
(gptr*) &master_ssl_capath, (gptr*) &master_ssl_capath, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"master-ssl-cipher", OPT_MASTER_SSL_CIPHER,
- "Master SSL cipher. Only applies if you have enabled master-ssl.",
+ "Master SSL cipher. Only applies if you have enabled master-ssl. \
+Does nothing yet.",
(gptr*) &master_ssl_cipher, (gptr*) &master_ssl_capath, 0, GET_STR, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"myisam-recover", OPT_MYISAM_RECOVER,
@@ -3860,10 +3812,13 @@ Disable with --skip-bdb (will save memory)",
{"rpl-recovery-rank", OPT_RPL_RECOVERY_RANK, "Undocumented",
(gptr*) &rpl_recovery_rank, (gptr*) &rpl_recovery_rank, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"relay-log", OPT_RELAY_LOG, "Undocumented",
+ {"relay-log", OPT_RELAY_LOG,
+ "The location and name to use for relay logs",
(gptr*) &opt_relay_logname, (gptr*) &opt_relay_logname, 0,
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"relay-log-index", OPT_RELAY_LOG_INDEX, "Undocumented",
+ {"relay-log-index", OPT_RELAY_LOG_INDEX,
+ "The location and name to use for the file that keeps a list of the last \
+relay logs",
(gptr*) &opt_relaylog_index_name, (gptr*) &opt_relaylog_index_name, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).",
@@ -3933,16 +3888,20 @@ Disable with --skip-isam",
{"skip-stack-trace", OPT_SKIP_STACK_TRACE,
"Don't print a stack trace on failure", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
- {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables",
+ {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. Depricated option. Use --skip-symbolic-links instead",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-thread-priority", OPT_SKIP_PRIOR,
"Don't give threads different priorities.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
- {"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE, "Undocumented",
+ {"relay-log-info-file", OPT_RELAY_LOG_INFO_FILE,
+ "The location and name of the file that remembers where the SQL replication \
+thread is in the relay logs",
(gptr*) &relay_log_info_file, (gptr*) &relay_log_info_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_REPLICATION
- {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR, "Undocumented",
+ {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR,
+ "The location where the slave should put its temporary files when \
+replicating a LOAD DATA INFILE command",
(gptr*) &slave_load_tmpdir, (gptr*) &slave_load_tmpdir, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"slave-skip-errors", OPT_SLAVE_SKIP_ERRORS,
@@ -3983,11 +3942,12 @@ Disable with --skip-isam",
{"external-locking", OPT_USE_LOCKING, "Use system (external) locking. With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running",
(gptr*) &opt_external_locking, (gptr*) &opt_external_locking,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef USE_SYMDIR
- {"use-symbolic-links", 's', "Enable symbolic link support",
+ {"use-symbolic-links", 's', "Enable symbolic link support. Depricated option; Use --symbolic-links instead",
+ (gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG,
+ IF_PURIFY(0,1), 0, 0, 0, 0, 0},
+ {"--symbolic-links", 's', "Enable symbolic link support",
(gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG,
IF_PURIFY(0,1), 0, 0, 0, 0, 0},
-#endif
{"user", 'u', "Run mysqld daemon as user", 0, 0, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit", 0, 0, 0, GET_NO_ARG,
@@ -4165,7 +4125,7 @@ Disable with --skip-isam",
(gptr*) &max_connect_errors, (gptr*) &max_connect_errors, 0, GET_ULONG,
REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ~0L, 0, 1, 0},
{"max_delayed_threads", OPT_MAX_DELAYED_THREADS,
- "Don't start more than this number of threads to handle INSERT DELAYED statements. This option does not yet have effect (on TODO), unless it is set to zero, which means INSERT DELAYED is not used.",
+ "Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero, which means INSERT DELAYED is not used.",
(gptr*) &max_insert_delayed_threads, (gptr*) &max_insert_delayed_threads,
0, GET_ULONG, REQUIRED_ARG, 20, 0, 16384, 0, 1, 0},
{"max_error_count", OPT_MAX_ERROR_COUNT,
@@ -4227,12 +4187,18 @@ Disable with --skip-isam",
(gptr*) &global_system_variables.myisam_max_extra_sort_file_size,
(gptr*) &max_system_variables.myisam_max_extra_sort_file_size,
0, GET_ULL, REQUIRED_ARG, (ulonglong) MI_MAX_TEMP_LENGTH,
- 0, ~0L, 0, 1, 0},
+ 0, (ulonglong) MAX_FILE_SIZE, 0, 1, 0},
{"myisam_max_sort_file_size", OPT_MYISAM_MAX_SORT_FILE_SIZE,
"Don't use the fast sort index method to created index if the temporary file would get bigger than this!",
(gptr*) &global_system_variables.myisam_max_sort_file_size,
(gptr*) &max_system_variables.myisam_max_sort_file_size, 0,
- GET_ULL, REQUIRED_ARG, (longlong) LONG_MAX, 0, ~0L, 0, 1024*1024, 0},
+ GET_ULL, REQUIRED_ARG, (longlong) LONG_MAX, 0, (ulonglong) MAX_FILE_SIZE,
+ 0, 1024*1024, 0},
+ {"myisam_repair_threads", OPT_MYISAM_REPAIR_THREADS,
+ "Number of threads to use when repairing MyISAM tables. The value of 1 disables parallel repair.",
+ (gptr*) &global_system_variables.myisam_repair_threads,
+ (gptr*) &max_system_variables.myisam_repair_threads, 0,
+ GET_ULONG, REQUIRED_ARG, 1, 1, ~0L, 0, 1, 0},
{"myisam_sort_buffer_size", OPT_MYISAM_SORT_BUFFER_SIZE,
"The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.",
(gptr*) &global_system_variables.myisam_sort_buff_size,
@@ -4307,7 +4273,7 @@ Disable with --skip-isam",
(gptr*) &relay_log_purge, 0, GET_BOOL, NO_ARG,
1, 0, 1, 0, 1, 0},
{"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT,
- "Max space to use for all relay logs",
+ "Maximum space to use for all relay logs",
(gptr*) &relay_log_space_limit,
(gptr*) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L,
(longlong) ULONG_MAX, 0, 1, 0},
@@ -4321,6 +4287,11 @@ Disable with --skip-isam",
(gptr*) &slave_net_timeout, (gptr*) &slave_net_timeout, 0,
GET_ULONG, REQUIRED_ARG, SLAVE_NET_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
#endif /* HAVE_REPLICATION */
+ {"read-only", OPT_READONLY,
+ "Make all tables readonly, with the expections for replications (slave) threads and users with the SUPER privilege",
+ (gptr*) &opt_readonly,
+ (gptr*) &opt_readonly,
+ 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
{"slow_launch_time", OPT_SLOW_LAUNCH_TIME,
"If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented.",
(gptr*) &slow_launch_time, (gptr*) &slow_launch_time, 0, GET_ULONG,
@@ -4597,19 +4568,111 @@ To see what values a running MySQL server is using, type\n\
}
-static void set_options(void)
-{
-#if !defined( my_pthread_setprio ) && !defined( HAVE_PTHREAD_SETSCHEDPARAM )
- opt_specialflag |= SPECIAL_NO_PRIOR;
-#endif
+/*
+ Initialize all MySQL global variables to default values
+
+ SYNOPSIS
+ mysql_init_variables()
+
+ NOTES
+ The reason to set a lot of global variables to zero is to allow one to
+ restart the embedded server with a clean environment
+ It's also needed on some exotic platforms where global variables are
+ not set to 0 when a program starts.
+
+ We don't need to set numeric variables refered to in my_long_options
+ as these are initialized by my_getopt.
+*/
+static void mysql_init_variables(void)
+{
+ /* Things reset to zero */
+ opt_skip_slave_start= opt_reckless_slave = 0;
+ mysql_home[0]= pidfile_name[0]= log_error_file[0]= 0;
+ opt_log= opt_update_log= opt_bin_log= opt_slow_log= 0;
+ opt_disable_networking= opt_skip_show_db=0;
+ opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname=0;
+ opt_bootstrap= opt_myisam_log= use_old_passwords= 0;
+ mqh_used= 0;
+ segfaulted= kill_in_progress= 0;
+ cleanup_done= 0;
+ defaults_argv= 0;
+ server_id_supplied= 0;
+ test_flags= select_errors= dropping_tables= ha_open_options=0;
+ thread_count= thread_running= kill_cached_threads= wake_thread=0;
+ slave_open_temp_tables= 0;
+ com_other= 0;
+ cached_thread_count= 0;
+ bytes_sent= bytes_received= 0;
+ opt_endinfo= using_udf_functions= 0;
+ opt_using_transactions= using_update_log= 0;
+ abort_loop= select_thread_in_use= signal_thread_in_use= 0;
+ ready_to_exit= shutdown_in_progress= grant_option= 0;
+ long_query_count= aborted_threads= aborted_connects= 0;
+ delayed_insert_threads= delayed_insert_writes= delayed_rows_in_use= 0;
+ delayed_insert_errors= thread_created= 0;
+ filesort_rows= filesort_range_count= filesort_scan_count= 0;
+ filesort_merge_passes= select_range_check_count= select_range_count= 0;
+ select_scan_count= select_full_range_join_count= select_full_join_count= 0;
+ specialflag= opened_tables= created_tmp_tables= created_tmp_disk_tables= 0;
+ max_used_connections= slow_launch_threads = 0;
+ max_sort_char= 0;
+ mysqld_user= mysqld_chroot= opt_init_file= opt_bin_logname = 0;
+ errmesg= 0;
+ mysql_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS;
+ bzero((gptr) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
+ bzero((gptr) &com_stat, sizeof(com_stat));
+
+ /* Things with default values that are not zero */
+ delay_key_write_options= (uint) DELAY_KEY_WRITE_ON;
+ opt_specialflag= SPECIAL_ENGLISH;
+ unix_sock= ip_sock= INVALID_SOCKET;
+ mysql_home_ptr= mysql_home;
+ pidfile_name_ptr= pidfile_name;
+ log_error_file_ptr= log_error_file;
+ language_ptr= language;
+ mysql_data_home= mysql_real_data_home;
+ thd_startup_options= (OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL |
+ OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE);
+ protocol_version= PROTOCOL_VERSION;
+ what_to_log= ~ (1L << (uint) COM_TIME);
+ refresh_version= flush_version= 1L; /* Increments on each reload */
+ thread_id= 1L;
+ strmov(server_version, MYSQL_SERVER_VERSION);
+ myisam_recover_options_str= sql_mode_str= "OFF";
+ my_bind_addr = htonl(INADDR_ANY);
+ threads.empty();
+ thread_cache.empty();
+
+ /* Initialize structures that is used when processing options */
+ replicate_rewrite_db.empty();
+ replicate_do_db.empty();
+ replicate_ignore_db.empty();
+ binlog_do_db.empty();
+ binlog_ignore_db.empty();
+
+ /* Set directory paths */
+ strmake(language, LANGUAGE, sizeof(language)-1);
+ strmake(mysql_real_data_home, get_relative_path(DATADIR),
+ sizeof(mysql_real_data_home)-1);
+ mysql_data_home_buff[0]=FN_CURLIB; // all paths are relative from here
+ mysql_data_home_buff[1]=0;
+
+ /* Replication parameters */
+ master_user= (char*) "test";
+ master_password= master_host= 0;
+ master_info_file= (char*) "master.info",
+ relay_log_info_file= (char*) "relay-log.info",
+ master_ssl_key= master_ssl_cert= master_ssl_capath= master_ssl_cipher= 0;
+ report_user= report_password = report_host= 0; /* TO BE DELETED */
+ opt_relay_logname= opt_relaylog_index_name= 0;
+
+ /* Variables in libraries */
+ charsets_dir= 0;
sys_charset.value= (char*) MYSQL_CHARSET;
sys_charset_system.value= (char*) system_charset_info->csname;
- (void) strmake(language, LANGUAGE, sizeof(language)-1);
- (void) strmake(mysql_real_data_home, get_relative_path(DATADIR),
- sizeof(mysql_real_data_home)-1);
- /* Set default values for some variables */
+ /* Set default values for some option variables */
global_system_variables.character_set_results= NULL;
global_system_variables.character_set_client= default_charset_info;
global_system_variables.collation_connection= default_charset_info;
@@ -4620,6 +4683,71 @@ static void set_options(void)
global_system_variables.max_join_size= (ulonglong) HA_POS_ERROR;
max_system_variables.max_join_size= (ulonglong) HA_POS_ERROR;
+ /* Variables that depends on compile options */
+#ifndef DBUG_OFF
+ default_dbug_option=IF_WIN("d:t:i:O,\\mysqld.trace",
+ "d:t:i:o,/tmp/mysqld.trace");
+#endif
+ opt_error_log= IF_WIN(1,0);
+#ifdef HAVE_BERKELEY_DB
+ have_berkeley_db= SHOW_OPTION_YES;
+#else
+ have_berkeley_db= SHOW_OPTION_NO;
+#endif
+#ifdef HAVE_INNOBASE_DB
+ have_innodb=SHOW_OPTION_YES;
+#else
+ have_innodb=SHOW_OPTION_NO;
+#endif
+#ifdef HAVE_ISAM
+ have_isam=SHOW_OPTION_YES;
+#else
+ have_isam=SHOW_OPTION_NO;
+#endif
+#ifdef USE_RAID
+ have_raid=SHOW_OPTION_YES;
+#else
+ have_raid=SHOW_OPTION_NO;
+#endif
+#ifdef HAVE_OPENSSL
+ have_openssl=SHOW_OPTION_YES;
+#else
+ have_openssl=SHOW_OPTION_NO;
+#endif
+#ifdef HAVE_BROKEN_REALPATH
+ have_symlink=SHOW_OPTION_NO;
+#else
+ have_symlink=SHOW_OPTION_YES;
+#endif
+#ifdef HAVE_QUERY_CACHE
+ have_query_cache=SHOW_OPTION_YES;
+#else
+ have_query_cache=SHOW_OPTION_NO;
+#endif
+#ifdef HAVE_CRYPT
+ have_crypt=SHOW_OPTION_YES;
+#else
+ have_crypt=SHOW_OPTION_NO;
+#endif
+#ifdef HAVE_COMPRESS
+ SHOW_COMP_OPTION have_compress= SHOW_OPTION_YES;
+#else
+ SHOW_COMP_OPTION have_compress= SHOW_OPTION_NO;
+#endif
+#ifdef HAVE_LIBWRAP
+ libwrapName= NullS;
+#endif
+#ifdef HAVE_OPENSSL
+ des_key_file = 0;
+ ssl_acceptor_fd= 0;
+#endif
+#ifdef HAVE_SMEM
+ shared_memory_base_name= default_shared_memory_base_name;
+#endif
+#if !defined(my_pthread_setprio) && !defined(HAVE_PTHREAD_SETSCHEDPARAM)
+ opt_specialflag |= SPECIAL_NO_PRIOR;
+#endif
+
#if defined(__WIN__) || defined(__NETWARE__)
/* Allow Win32 and NetWare users to move MySQL anywhere */
{
@@ -4634,10 +4762,6 @@ static void set_options(void)
tmpenv = DEFAULT_MYSQL_HOME;
(void) strmake(mysql_home, tmpenv, sizeof(mysql_home)-1);
#endif
-
- my_disable_locking=myisam_single_user= 1;
- opt_external_locking=0;
- my_bind_addr = htonl( INADDR_ANY );
}
@@ -4866,9 +4990,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
myisam_concurrent_insert=0;
myisam_recover_options= HA_RECOVER_NONE;
- my_disable_symlinks=1;
my_use_symdir=0;
- have_symlink=SHOW_OPTION_DISABLED;
ha_open_options&= ~(HA_OPEN_ABORT_IF_CRASHED | HA_OPEN_DELAY_KEY_WRITE);
#ifdef HAVE_QUERY_CACHE
query_cache_size=0;
@@ -4915,9 +5037,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
test_flags|=TEST_NO_STACKTRACE;
break;
case (int) OPT_SKIP_SYMLINKS:
- my_disable_symlinks=1;
my_use_symdir=0;
- have_symlink=SHOW_OPTION_DISABLED;
break;
case (int) OPT_BIND_ADDRESS:
if (argument && my_isdigit(mysqld_charset, argument[0]))
@@ -5189,11 +5309,9 @@ static void get_options(int argc,char **argv)
my_disable_locking= myisam_single_user= test(opt_external_locking == 0);
my_default_record_cache_size=global_system_variables.read_buff_size;
myisam_max_temp_length=
- (my_off_t) min(global_system_variables.myisam_max_sort_file_size,
- (ulonglong) MAX_FILE_SIZE);
+ (my_off_t) global_system_variables.myisam_max_sort_file_size;
myisam_max_extra_temp_length=
- (my_off_t) min(global_system_variables.myisam_max_extra_sort_file_size,
- (ulonglong) MAX_FILE_SIZE);
+ (my_off_t) global_system_variables.myisam_max_extra_sort_file_size;
/* Set global variables based on startup options */
myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size);