diff options
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c432b3d9e0a..3a3eee9737d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -582,6 +582,7 @@ const char *log_output_str= "FILE"; time_t server_start_time, flush_status_time; char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30]; +char default_logfile_name[FN_REFLEN]; char *default_tz_name; char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN]; char mysql_real_data_home[FN_REFLEN], @@ -647,7 +648,7 @@ MY_LOCALE *my_default_lc_time_names; SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_query_cache; SHOW_COMP_OPTION have_geometry, have_rtree_keys; SHOW_COMP_OPTION have_crypt, have_compress; -SHOW_COMP_OPTION have_community_features; +SHOW_COMP_OPTION have_profiling; /* Thread specific variables */ @@ -2525,7 +2526,7 @@ terribly wrong...\n"); } fprintf(stderr, "Trying to get some variables.\n\ Some pointers may be invalid and cause the dump to abort...\n"); - my_safe_print_str("thd->query", thd->query, 1024); + my_safe_print_str("thd->query", thd->query(), 1024); fprintf(stderr, "thd->thread_id=%lu\n", (ulong) thd->thread_id); fprintf(stderr, "thd->killed=%s\n", kreason); } @@ -3195,10 +3196,13 @@ static int init_common_variables(const char *conf_file_name, int argc, strmake(glob_hostname, STRING_WITH_LEN("localhost")); sql_print_warning("gethostname failed, using '%s' as hostname", glob_hostname); - strmake(pidfile_name, STRING_WITH_LEN("mysql")); + strmake(default_logfile_name, STRING_WITH_LEN("mysql")); } else - strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5); + strmake(default_logfile_name, glob_hostname, + sizeof(default_logfile_name)-5); + + strmake(pidfile_name, default_logfile_name, sizeof(pidfile_name)-5); strmov(fn_ext(pidfile_name),".pid"); // Add proper extension /* @@ -3238,7 +3242,8 @@ static int init_common_variables(const char *conf_file_name, int argc, orig_argc=argc; orig_argv=argv; - load_defaults(conf_file_name, groups, &argc, &argv); + if (load_defaults(conf_file_name, groups, &argc, &argv)) + return 1; defaults_argv=argv; defaults_argc=argc; if (get_options(&defaults_argc, defaults_argv)) @@ -3484,7 +3489,7 @@ static int init_common_variables(const char *conf_file_name, int argc, if (opt_slow_log && opt_slow_logname && !(log_output_options & LOG_FILE) && !(log_output_options & LOG_NONE)) sql_print_warning("Although a path was specified for the " - "--log_slow_queries option, log tables are used. " + "--log-slow-queries option, log tables are used. " "To enable logging to files use the --log-output=file option."); s= opt_logname ? opt_logname : make_default_log_name(buff, ".log"); @@ -4943,9 +4948,6 @@ static void create_new_thread(THD *thd) NET *net=&thd->net; DBUG_ENTER("create_new_thread"); - if (protocol_version > 9) - net->return_errno=1; - /* Don't allow too many connections. We roughly check here that we allow only (max_connections + 1) connections. @@ -5871,10 +5873,6 @@ struct my_option my_long_options[] = "Set the default storage engine (table type) for tables.", (uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"default-table-type", OPT_STORAGE_ENGINE, - "(deprecated) Use --default-storage-engine.", - (uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default-time-zone", OPT_DEFAULT_TIME_ZONE, "Set the default time zone.", (uchar**) &default_tz_name, (uchar**) &default_tz_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, @@ -6063,14 +6061,14 @@ Disable with --skip-super-large-pages.", (uchar**) &opt_log_slow_slave_statements, (uchar**) &opt_log_slow_slave_statements, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"log_slow_queries", OPT_SLOW_QUERY_LOG, - "Log slow queries to a table or log file. Defaults logging to table " - "mysql.slow_log or hostname-slow.log if --log-output=file is used. " - "Must be enabled to activate other slow log options. " - "(deprecated option, use --slow_query_log/--slow_query_log_file instead)", + {"log-slow-queries", OPT_SLOW_QUERY_LOG, + "Log slow queries to a table or log file. Defaults logging to table " + "mysql.slow_log or hostname-slow.log if --log-output=file is used. " + "Must be enabled to activate other slow log options. " + "Deprecated option, use --slow-query-log/--slow-query-log-file instead.", (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"slow_query_log_file", OPT_SLOW_QUERY_LOG_FILE, + {"slow-query-log-file", OPT_SLOW_QUERY_LOG_FILE, "Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be enabled to activate other slow log options.", (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -6308,7 +6306,7 @@ master-ssl", "Maximum time in seconds to wait for the port to become free. " "(Default: no wait)", (uchar**) &mysqld_port_timeout, (uchar**) &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) +#if defined(ENABLED_PROFILING) {"profiling_history_size", OPT_PROFILING, "Limit of query profiling memory", (uchar**) &global_system_variables.profiling_history_size, (uchar**) &max_system_variables.profiling_history_size, @@ -6791,7 +6789,7 @@ The minimum value for this variable is 4096.", (uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG, REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0}, {"min_examined_row_limit", OPT_MIN_EXAMINED_ROW_LIMIT, - "Don't log queries which examine less than min_examined_row_limit rows to file.", + "Don't write queries to slow log that examine fewer than min_examined_row_limit rows.", (uchar**) &global_system_variables.min_examined_row_limit, (uchar**) &max_system_variables.min_examined_row_limit, 0, GET_ULONG, REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1L, 0}, @@ -7136,7 +7134,7 @@ static int show_starttime(THD *thd, SHOW_VAR *var, char *buff) return 0; } -#ifdef COMMUNITY_SERVER +#ifdef ENABLED_PROFILING static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_LONG; @@ -7631,7 +7629,7 @@ SHOW_VAR status_vars[]= { {"Threads_created", (char*) &thread_created, SHOW_LONG_NOFLUSH}, {"Threads_running", (char*) &thread_running, SHOW_INT}, {"Uptime", (char*) &show_starttime, SHOW_FUNC}, -#ifdef COMMUNITY_SERVER +#ifdef ENABLED_PROFILING {"Uptime_since_flush_status",(char*) &show_flushstatustime, SHOW_FUNC}, #endif {NullS, NullS, SHOW_LONG} @@ -7863,10 +7861,10 @@ static int mysql_init_variables(void) "d:t:i:o,/tmp/mysqld.trace"); #endif opt_error_log= IF_WIN(1,0); -#ifdef COMMUNITY_SERVER - have_community_features = SHOW_OPTION_YES; +#ifdef ENABLED_PROFILING + have_profiling = SHOW_OPTION_YES; #else - have_community_features = SHOW_OPTION_NO; + have_profiling = SHOW_OPTION_NO; #endif global_system_variables.ndb_index_stat_enable=FALSE; max_system_variables.ndb_index_stat_enable=TRUE; @@ -7984,7 +7982,7 @@ mysqld_get_one_option(int optid, default_collation_name= 0; break; case 'l': - WARN_DEPRECATED(NULL, "7.0", "--log", "'--general_log'/'--general_log_file'"); + WARN_DEPRECATED(NULL, "7.0", "--log", "'--general-log'/'--general-log-file'"); opt_log=1; break; case 'h': @@ -8158,7 +8156,8 @@ mysqld_get_one_option(int optid, } #endif /* HAVE_REPLICATION */ case (int) OPT_SLOW_QUERY_LOG: - WARN_DEPRECATED(NULL, "7.0", "--log_slow_queries", "'--slow_query_log'/'--slow_query_log_file'"); + WARN_DEPRECATED(NULL, "7.0", "--log-slow-queries", + "'--slow-query-log'/'--slow-query-log-file'"); opt_slow_log= 1; break; #ifdef WITH_CSV_STORAGE_ENGINE @@ -8986,9 +8985,7 @@ void refresh_status(THD *thd) /* Reset the counters of all key caches (default and named). */ process_key_caches(reset_key_cache_counters); -#ifdef COMMUNITY_SERVER flush_status_time= time((time_t*) 0); -#endif pthread_mutex_unlock(&LOCK_status); /* |