diff options
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 215 |
1 files changed, 164 insertions, 51 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e3a39ceee63..6b5783b7e2e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -598,6 +598,7 @@ char *mysqld_unix_port, *opt_mysql_tmpdir; const char **errmesg; /**< Error messages */ const char *myisam_recover_options_str="OFF"; const char *myisam_stats_method_str="nulls_unequal"; +const char *opt_thread_handling= thread_handling_typelib.type_names[0]; /** name of reference on left espression in rewritten IN subquery */ const char *in_left_expr_name= "<left expr>"; @@ -1173,11 +1174,14 @@ static void __cdecl kill_server(int sig_ptr) /* Send event to smem_event_connect_request for aborting */ - if (!SetEvent(smem_event_connect_request)) + if (opt_enable_shared_memory) { - DBUG_PRINT("error", - ("Got error: %ld from SetEvent of smem_event_connect_request", - GetLastError())); + if (!SetEvent(smem_event_connect_request)) + { + DBUG_PRINT("error", + ("Got error: %ld from SetEvent of smem_event_connect_request", + GetLastError())); + } } #endif @@ -1318,7 +1322,6 @@ void clean_up(bool print_message) lex_free(); /* Free some memory */ item_create_cleanup(); set_var_free(); - free_charsets(); if (!opt_noacl) { #ifdef HAVE_DLOPEN @@ -2029,10 +2032,10 @@ bool one_thread_per_connection_end(THD *thd, bool put_in_cache) /* It's safe to broadcast outside a lock (COND... is not deleted here) */ DBUG_PRINT("signal", ("Broadcasting COND_thread_count")); + DBUG_LEAVE; // Must match DBUG_ENTER() my_thread_end(); (void) pthread_cond_broadcast(&COND_thread_count); - DBUG_LEAVE; // Must match DBUG_ENTER() pthread_exit(0); return 0; // Avoid compiler warnings } @@ -2704,7 +2707,7 @@ static void init_signals(void) { /* Change limits so that we will get a core file */ STRUCT_RLIMIT rl; - rl.rlim_cur = rl.rlim_max = RLIM_INFINITY; + rl.rlim_cur = rl.rlim_max = (rlim_t) RLIM_INFINITY; if (setrlimit(RLIMIT_CORE, &rl) && global_system_variables.log_warnings) sql_print_warning("setrlimit could not change the size of core files to 'infinity'; We may not be able to generate a core file on signals"); } @@ -4005,6 +4008,27 @@ server."); if (opt_bin_log) { + /* Reports an error and aborts, if the --log-bin's path + is a directory.*/ + if (opt_bin_logname && + opt_bin_logname[strlen(opt_bin_logname) - 1] == FN_LIBCHAR) + { + sql_print_error("Path '%s' is a directory name, please specify \ +a file name for --log-bin option", opt_bin_logname); + unireg_abort(1); + } + + /* Reports an error and aborts, if the --log-bin-index's path + is a directory.*/ + if (opt_binlog_index_name && + opt_binlog_index_name[strlen(opt_binlog_index_name) - 1] + == FN_LIBCHAR) + { + sql_print_error("Path '%s' is a directory name, please specify \ +a file name for --log-bin-index option", opt_binlog_index_name); + unireg_abort(1); + } + char buf[FN_REFLEN]; const char *ln; ln= mysql_bin_log.generate_name(opt_bin_logname, "-bin", 1, buf); @@ -4028,7 +4052,7 @@ server."); my_free(opt_bin_logname, MYF(MY_ALLOW_ZERO_PTR)); opt_bin_logname=my_strdup(buf, MYF(0)); } - if (mysql_bin_log.open_index_file(opt_binlog_index_name, ln)) + if (mysql_bin_log.open_index_file(opt_binlog_index_name, ln, TRUE)) { unireg_abort(1); } @@ -4200,7 +4224,7 @@ server."); } if (opt_bin_log && mysql_bin_log.open(opt_bin_logname, LOG_BIN, 0, - WRITE_CACHE, 0, max_binlog_size, 0)) + WRITE_CACHE, 0, max_binlog_size, 0, TRUE)) unireg_abort(1); #ifdef HAVE_REPLICATION @@ -5355,12 +5379,16 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused))) pthread_handler_t handle_connections_namedpipes(void *arg) { HANDLE hConnectedPipe; - OVERLAPPED connectOverlapped = {0}; + OVERLAPPED connectOverlapped= {0}; THD *thd; my_thread_init(); DBUG_ENTER("handle_connections_namedpipes"); - connectOverlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - + connectOverlapped.hEvent= CreateEvent(NULL, TRUE, FALSE, NULL); + if (!connectOverlapped.hEvent) + { + sql_print_error("Can't create event, last error=%u", GetLastError()); + unireg_abort(1); + } DBUG_PRINT("general",("Waiting for named pipe connections.")); while (!abort_loop) { @@ -5383,7 +5411,8 @@ pthread_handler_t handle_connections_namedpipes(void *arg) { CloseHandle(hPipe); if ((hPipe= CreateNamedPipe(pipe_name, - PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED, + PIPE_ACCESS_DUPLEX | + FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, @@ -5403,7 +5432,8 @@ pthread_handler_t handle_connections_namedpipes(void *arg) hConnectedPipe = hPipe; /* create new pipe for new connection */ if ((hPipe = CreateNamedPipe(pipe_name, - PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED, + PIPE_ACCESS_DUPLEX | + FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, @@ -5730,6 +5760,7 @@ enum options_mysqld OPT_DISCONNECT_SLAVE_EVENT_COUNT, OPT_TC_HEURISTIC_RECOVER, OPT_ABORT_SLAVE_EVENT_COUNT, OPT_LOG_BIN_TRUST_FUNCTION_CREATORS, + OPT_LOG_BIN_TRUST_FUNCTION_CREATORS_OLD, OPT_ENGINE_CONDITION_PUSHDOWN, OPT_NDB_CONNECTSTRING, OPT_NDB_USE_EXACT_COUNT, OPT_NDB_USE_TRANSACTIONS, OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, @@ -5779,6 +5810,7 @@ enum options_mysqld OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE, OPT_MYISAM_USE_MMAP, OPT_MYISAM_REPAIR_THREADS, + OPT_MYISAM_MMAP_SIZE, OPT_MYISAM_STATS_METHOD, OPT_PAGECACHE_BUFFER_SIZE, @@ -5814,6 +5846,7 @@ enum options_mysqld OPT_EXPIRE_LOGS_DAYS, OPT_GROUP_CONCAT_MAX_LEN, OPT_DEFAULT_COLLATION, + OPT_DEFAULT_COLLATION_OLD, OPT_CHARACTER_SET_CLIENT_HANDSHAKE, OPT_CHARACTER_SET_FILESYSTEM, OPT_LC_TIME_NAMES, @@ -5840,6 +5873,9 @@ enum options_mysqld OPT_TABLE_LOCK_WAIT_TIMEOUT, OPT_PLUGIN_LOAD, OPT_PLUGIN_DIR, + OPT_SYMBOLIC_LINKS, + OPT_WARNINGS, + OPT_RECORD_BUFFER_OLD, OPT_LOG_OUTPUT, OPT_PORT_OPEN_TIMEOUT, OPT_PROFILING, @@ -5866,7 +5902,9 @@ enum options_mysqld OPT_LOG_SLOW_FILTER, OPT_GENERAL_LOG_FILE, OPT_SLOW_QUERY_LOG_FILE, - OPT_IGNORE_BUILTIN_INNODB + OPT_IGNORE_BUILTIN_INNODB, + OPT_BINLOG_DIRECT_NON_TRANS_UPDATE, + OPT_DEFAULT_CHARACTER_SET_OLD }; @@ -6019,10 +6057,11 @@ struct my_option my_long_options[] = {"debug-flush", OPT_DEBUG_FLUSH, "Default debug log with flush after write", (uchar**) 0, (uchar**) 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"default-character-set", 'C', "Set the default character set (deprecated option, use --character-set-server instead).", + {"default-character-set", OPT_DEFAULT_CHARACTER_SET_OLD, + "Set the default character set (deprecated option, use --character-set-server instead).", (uchar**) &default_character_set_name, (uchar**) &default_character_set_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - {"default-collation", OPT_DEFAULT_COLLATION, "Set the default collation (deprecated option, use --collation-server instead).", + {"default-collation", OPT_DEFAULT_COLLATION_OLD, "Set the default collation (deprecated option, use --collation-server instead).", (uchar**) &default_collation_name, (uchar**) &default_collation_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, {"default-storage-engine", OPT_STORAGE_ENGINE, @@ -6121,7 +6160,8 @@ Disable with --skip-large-pages.", #endif {"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"init-slave", OPT_INIT_SLAVE, "Command(s) that are executed when a slave connects to this master", + {"init-slave", OPT_INIT_SLAVE, "Command(s) that are executed by a slave server \ +each time the SQL thread starts.", (uchar**) &opt_init_slave, (uchar**) &opt_init_slave, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"language", 'L', @@ -6161,7 +6201,7 @@ Disable with --skip-large-pages.", compatibility; the behaviour was also changed to apply only to functions (and triggers). In a future release this old name could be removed. */ - {"log-bin-trust-routine-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS, + {"log-bin-trust-routine-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS_OLD, "(deprecated) Use log-bin-trust-function-creators.", (uchar**) &trust_function_creators, (uchar**) &trust_function_creators, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -6714,7 +6754,7 @@ log and this option does nothing anymore.", {"transaction-isolation", OPT_TX_ISOLATION, "Default transaction isolation level.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"use-symbolic-links", 's', "Enable symbolic link support. Deprecated option; use --symbolic-links instead.", + {"use-symbolic-links", OPT_SYMBOLIC_LINKS, "Enable symbolic link support. Deprecated option; use --symbolic-links instead.", (uchar**) &my_use_symdir, (uchar**) &my_use_symdir, 0, GET_BOOL, NO_ARG, IF_VALGRIND(0,1), 0, 0, 0, 0, 0}, {"user", 'u', "Run mysqld daemon as user.", 0, 0, 0, GET_STR, REQUIRED_ARG, @@ -6724,7 +6764,7 @@ log and this option does nothing anymore.", 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"warnings", 'W', "Deprecated; use --log-warnings instead.", + {"warnings", OPT_WARNINGS, "Deprecated; use --log-warnings instead.", (uchar**) &global_system_variables.log_warnings, (uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, (longlong) ULONG_MAX, 0, 0, 0}, @@ -7002,6 +7042,10 @@ The minimum value for this variable is 4096.", (uchar**) &max_system_variables.myisam_max_sort_file_size, 0, GET_ULL, REQUIRED_ARG, (longlong) LONG_MAX, 0, (ulonglong) MAX_FILE_SIZE, 0, 1024*1024, 0}, + {"myisam_mmap_size", OPT_MYISAM_MMAP_SIZE, + "Can be used to restrict the total memory used for memory mmaping of myisam files", + (uchar**) &myisam_mmap_size, (uchar**) &myisam_mmap_size, 0, + GET_ULL, REQUIRED_ARG, SIZE_T_MAX, MEMMAP_EXTRA_MARGIN, SIZE_T_MAX, 0, 1, 0}, {"myisam_repair_threads", OPT_MYISAM_REPAIR_THREADS, "Number of threads to use when repairing MyISAM tables. The value of 1 disables parallel repair.", (uchar**) &global_system_variables.myisam_repair_threads, @@ -7149,8 +7193,8 @@ The minimum value for this variable is 4096.", (uchar**) &max_system_variables.read_rnd_buff_size, 0, GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0}, - {"record_buffer", OPT_RECORD_BUFFER, - "Alias for read_buffer_size", + {"record_buffer", OPT_RECORD_BUFFER_OLD, + "Alias for read_buffer_size. This variable is deprecated and will be removed in a future release.", (uchar**) &global_system_variables.read_buff_size, (uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0}, @@ -7242,10 +7286,10 @@ The minimum value for this variable is 4096.", 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tmp_table_size", OPT_TMP_TABLE_SIZE, "If an internal in-memory temporary table exceeds this size, MySQL will" - " automatically convert it to an on-disk MyISAM table.", + " automatically convert it to an on-disk MyISAM/Maria table.", (uchar**) &global_system_variables.tmp_table_size, (uchar**) &max_system_variables.tmp_table_size, 0, GET_ULL, - REQUIRED_ARG, 16*1024*1024L, 1024, MAX_MEM_TABLE_SIZE, 0, 1, 0}, + REQUIRED_ARG, 16*1024*1024L, 0, MAX_MEM_TABLE_SIZE, 0, 1, 0}, {"transaction_alloc_block_size", OPT_TRANS_ALLOC_BLOCK_SIZE, "Allocation block size for transactions to be stored in binary log", (uchar**) &global_system_variables.trans_alloc_block_size, @@ -7260,7 +7304,8 @@ The minimum value for this variable is 4096.", 1024, 0}, {"thread_handling", OPT_THREAD_HANDLING, "Define threads usage for handling queries: " - "one-thread-per-connection or no-threads", 0, 0, + "one-thread-per-connection or no-threads", + (uchar**) &opt_thread_handling, (uchar**) &opt_thread_handling, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"updatable_views_with_limit", OPT_UPDATABLE_VIEWS_WITH_LIMIT, "1 = YES = Don't issue an error message (warning only) if a VIEW without presence of a key of the underlying table is used in queries with a LIMIT clause for updating. 0 = NO = Prohibit update of a VIEW, which does not contain a key of the underlying table and the query uses a LIMIT clause (usually get from GUI tools).", @@ -7273,6 +7318,10 @@ The minimum value for this variable is 4096.", (uchar**) &max_system_variables.net_wait_timeout, 0, GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT), 0, 1, 0}, + {"binlog-direct-non-transactional-updates", OPT_BINLOG_DIRECT_NON_TRANS_UPDATE, + "Causes updates to non-transactional engines using statement format to be written directly to binary log. Before using this option make sure that there are no dependencies between transactional and non-transactional tables such as in the statement INSERT INTO t_myisam SELECT * FROM t_innodb; otherwise, slaves may diverge from the master.", + (uchar**) &global_system_variables.binlog_direct_non_trans_update, (uchar**) &max_system_variables.binlog_direct_non_trans_update, 0, GET_BOOL, NO_ARG, 0, + 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -7746,6 +7795,7 @@ SHOW_VAR status_vars[]= { {"Ssl_verify_mode", (char*) &show_ssl_get_verify_mode, SHOW_FUNC}, {"Ssl_version", (char*) &show_ssl_get_version, SHOW_FUNC}, #endif /* HAVE_OPENSSL */ + {"Syncs", (char*) &my_sync_count, SHOW_LONG_NOFLUSH}, {"Table_locks_immediate", (char*) &locks_immediate, SHOW_LONG}, {"Table_locks_waited", (char*) &locks_waited, SHOW_LONG}, #ifdef HAVE_MMAP @@ -7932,7 +7982,13 @@ static int mysql_init_variables(void) refresh_version= 1L; /* Increments on each reload */ global_query_id= thread_id= 1L; strmov(server_version, MYSQL_SERVER_VERSION); - myisam_recover_options_str= sql_mode_str= "OFF"; + sql_mode_str= ""; + + /* By default, auto-repair MyISAM tables after crash */ + myisam_recover_options_str= "DEFAULT"; + myisam_recover_options= HA_RECOVER_DEFAULT; + ha_open_options|= HA_OPEN_ABORT_IF_CRASHED; + myisam_stats_method_str= "nulls_unequal"; my_bind_addr = htonl(INADDR_ANY); threads.empty(); @@ -8154,6 +8210,9 @@ mysqld_get_one_option(int optid, opt_endinfo=1; /* unireg: memory allocation */ break; #endif + case '0': + WARN_DEPRECATED(NULL, VER_CELOSIA, "--log-long-format", "--log-short-format"); + break; case 'a': global_system_variables.sql_mode= fix_sql_mode(MODE_ANSI); global_system_variables.tx_isolation= ISO_SERIALIZABLE; @@ -8161,6 +8220,11 @@ mysqld_get_one_option(int optid, case 'b': strmake(mysql_home,argument,sizeof(mysql_home)-1); break; + case OPT_DEFAULT_CHARACTER_SET_OLD: // --default-character-set + WARN_DEPRECATED(NULL, VER_CELOSIA, + "--default-character-set", + "--character-set-server"); + /* Fall through */ case 'C': if (default_collation_name == compiled_default_collation_name) default_collation_name= 0; @@ -8184,6 +8248,9 @@ mysqld_get_one_option(int optid, case 'L': strmake(language, argument, sizeof(language)-1); break; + case 'O': + WARN_DEPRECATED(NULL, VER_CELOSIA, "--set-variable", "--variable-name=value"); + break; #ifdef HAVE_REPLICATION case OPT_SLAVE_SKIP_ERRORS: init_slave_skip_errors(argument); @@ -8206,6 +8273,9 @@ mysqld_get_one_option(int optid, print_version(); exit(0); #endif /*EMBEDDED_LIBRARY*/ + case OPT_WARNINGS: + WARN_DEPRECATED(NULL, VER_CELOSIA, "--warnings", "--log-warnings"); + /* Note: fall-through to 'W' */ case 'W': if (!argument) global_system_variables.log_warnings++; @@ -8218,6 +8288,18 @@ mysqld_get_one_option(int optid, test_flags= argument ? (uint) atoi(argument) : 0; opt_endinfo=1; break; + case (int) OPT_DEFAULT_COLLATION_OLD: + WARN_DEPRECATED(NULL, VER_CELOSIA, "--default-collation", "--collation-server"); + break; + case (int) OPT_SAFE_SHOW_DB: + WARN_DEPRECATED(NULL, VER_CELOSIA, "--safe-show-database", "GRANT SHOW DATABASES"); + break; + case (int) OPT_LOG_BIN_TRUST_FUNCTION_CREATORS_OLD: + WARN_DEPRECATED(NULL, VER_CELOSIA, "--log-bin-trust-routine-creators", "--log-bin-trust-function-creators"); + break; + case (int) OPT_ENABLE_LOCK: + WARN_DEPRECATED(NULL, VER_CELOSIA, "--enable-locking", "--external-locking"); + break; case (int) OPT_BIG_TABLES: thd_startup_options|=OPTION_BIG_TABLES; break; @@ -8228,6 +8310,7 @@ mysqld_get_one_option(int optid, opt_myisam_log=1; break; case (int) OPT_UPDATE_LOG: + WARN_DEPRECATED(NULL, VER_CELOSIA, "--log-update", "--log-bin"); opt_update_log=1; break; case (int) OPT_BIN_LOG: @@ -8240,6 +8323,8 @@ mysqld_get_one_option(int optid, case (int) OPT_INIT_RPL_ROLE: { int role; + LINT_INIT(role); + if (!find_opt_type(argument, &rpl_role_typelib, opt->name, &role)) { rpl_status = (role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE; @@ -8295,6 +8380,8 @@ mysqld_get_one_option(int optid, case OPT_BINLOG_FORMAT: { int id; + LINT_INIT(id); + if (!find_opt_type(argument, &binlog_format_typelib, opt->name, &id)) { global_system_variables.binlog_format= opt_binlog_format_id= id - 1; @@ -8399,8 +8486,18 @@ mysqld_get_one_option(int optid, "give threads different priorities."); break; case (int) OPT_SKIP_LOCK: + WARN_DEPRECATED(NULL, VER_CELOSIA, "--skip-locking", "--skip-external-locking"); opt_external_locking=0; break; + case (int) OPT_SQL_BIN_UPDATE_SAME: + WARN_DEPRECATED(NULL, VER_CELOSIA, "--sql-bin-update-same", "the binary log"); + break; + case (int) OPT_RECORD_BUFFER_OLD: + WARN_DEPRECATED(NULL, VER_CELOSIA, "record_buffer", "read_buffer_size"); + break; + case (int) OPT_SYMBOLIC_LINKS: + WARN_DEPRECATED(NULL, VER_CELOSIA, "--use-symbolic-links", "--symbolic-links"); + break; case (int) OPT_SKIP_HOST_CACHE: opt_specialflag|= SPECIAL_NO_HOST_CACHE; break; @@ -8426,6 +8523,7 @@ mysqld_get_one_option(int optid, test_flags|=TEST_NO_STACKTRACE; break; case (int) OPT_SKIP_SYMLINKS: + WARN_DEPRECATED(NULL, VER_CELOSIA, "--skip-symlink", "--skip-symbolic-links"); my_use_symdir=0; break; case (int) OPT_BIND_ADDRESS: @@ -8520,6 +8618,9 @@ mysqld_get_one_option(int optid, server_id_supplied = 1; break; case OPT_DELAY_KEY_WRITE_ALL: + WARN_DEPRECATED(NULL, VER_CELOSIA, + "--delay-key-write-for-all-tables", + "--delay-key-write=ALL"); if (argument != disabled_my_option) argument= (char*) "ALL"; /* Fall through */ @@ -8531,6 +8632,8 @@ mysqld_get_one_option(int optid, else { int type; + LINT_INIT(type); + if (!find_opt_type(argument, &delay_key_write_typelib, opt->name, &type)) delay_key_write_options= (uint) type-1; } @@ -8542,6 +8645,8 @@ mysqld_get_one_option(int optid, case OPT_TX_ISOLATION: { int type; + LINT_INIT(type); + if (!find_opt_type(argument, &tx_isolation_typelib, opt->name, &type)) global_system_variables.tx_isolation= (type-1); break; @@ -8586,26 +8691,31 @@ mysqld_get_one_option(int optid, #endif case OPT_MYISAM_RECOVER: { - if (!argument) - { - myisam_recover_options= HA_RECOVER_DEFAULT; - myisam_recover_options_str= myisam_recover_typelib.type_names[0]; - } - else if (!argument[0]) + if (argument && (!argument[0] || + my_strcasecmp(system_charset_info, argument, "OFF") == 0)) { myisam_recover_options= HA_RECOVER_NONE; myisam_recover_options_str= "OFF"; + ha_open_options&= ~HA_OPEN_ABORT_IF_CRASHED; } else { - myisam_recover_options_str=argument; - myisam_recover_options= - find_bit_type_or_exit(argument, &myisam_recover_typelib, opt->name, - &error); - if (error) - return 1; + if (!argument) + { + myisam_recover_options= HA_RECOVER_DEFAULT; + myisam_recover_options_str= myisam_recover_typelib.type_names[0]; + } + else + { + myisam_recover_options_str=argument; + myisam_recover_options= + find_bit_type_or_exit(argument, &myisam_recover_typelib, opt->name, + &error); + if (error) + return 1; + } + ha_open_options|=HA_OPEN_ABORT_IF_CRASHED; } - ha_open_options|=HA_OPEN_ABORT_IF_CRASHED; break; } case OPT_CONCURRENT_INSERT: @@ -8624,6 +8734,7 @@ mysqld_get_one_option(int optid, ulong method_conv; int method; LINT_INIT(method_conv); + LINT_INIT(method); myisam_stats_method_str= argument; if (!find_opt_type(argument, &myisam_stats_method_typelib, @@ -8680,14 +8791,16 @@ mysqld_get_one_option(int optid, break; } case OPT_ONE_THREAD: - global_system_variables.thread_handling= - SCHEDULER_ONE_THREAD_PER_CONNECTION; + global_system_variables.thread_handling= SCHEDULER_NO_THREADS; + opt_thread_handling= thread_handling_typelib.type_names[global_system_variables.thread_handling]; break; case OPT_THREAD_HANDLING: { int id; + LINT_INIT(id); if (!find_opt_type(argument, &thread_handling_typelib, opt->name, &id)) global_system_variables.thread_handling= id - 1; + opt_thread_handling= thread_handling_typelib.type_names[global_system_variables.thread_handling]; break; } case OPT_FT_BOOLEAN_SYNTAX: @@ -8974,14 +9087,8 @@ static int fix_paths(void) pos[0]= FN_LIBCHAR; pos[1]= 0; } - convert_dirname(mysql_real_data_home,mysql_real_data_home,NullS); - my_realpath(mysql_unpacked_real_data_home, mysql_real_data_home, MYF(0)); - mysql_unpacked_real_data_home_len= strlen(mysql_unpacked_real_data_home); - if (mysql_unpacked_real_data_home[mysql_unpacked_real_data_home_len-1] == FN_LIBCHAR) - --mysql_unpacked_real_data_home_len; - - convert_dirname(language,language,NullS); + convert_dirname(mysql_real_data_home,mysql_real_data_home,NullS); (void) my_load_path(mysql_home,mysql_home,""); // Resolve current dir (void) my_load_path(mysql_real_data_home,mysql_real_data_home,mysql_home); (void) my_load_path(pidfile_name,pidfile_name,mysql_real_data_home); @@ -8989,6 +9096,12 @@ static int fix_paths(void) get_relative_path(PLUGINDIR), mysql_home); opt_plugin_dir_ptr= opt_plugin_dir; + my_realpath(mysql_unpacked_real_data_home, mysql_real_data_home, MYF(0)); + mysql_unpacked_real_data_home_len= + (int) strlen(mysql_unpacked_real_data_home); + if (mysql_unpacked_real_data_home[mysql_unpacked_real_data_home_len-1] == FN_LIBCHAR) + --mysql_unpacked_real_data_home_len; + char *sharedir=get_relative_path(SHAREDIR); if (test_if_hard_path(sharedir)) strmake(buff,sharedir,sizeof(buff)-1); /* purecov: tested */ @@ -9019,8 +9132,8 @@ static int fix_paths(void) /* Convert the secure-file-priv option to system format, allowing a quick strcmp to check if read or write is in an allowed dir - */ - if (opt_secure_file_priv) + */ + if (opt_secure_file_priv && opt_secure_file_priv[0]) { convert_dirname(buff, opt_secure_file_priv, NullS); my_free(opt_secure_file_priv, MYF(0)); |