Commit affff1ae authored by Monty's avatar Monty

Less logging of not critial things during startup/shutdown:

- Added --start option to mysqld which don't prints notes to log on startup
  This helps to find errors in configure options easier
- Dont write [Note] entries to log after we have abort the server
  This makes it easier to find what went wrong
- Don't by default write out Changed limits for max_open_files as this didn't really change from anything the user gave us
- Dont write warnings about not using --explicit_defaults_for_timestamp (we don't have plans do depricate the old behaviour)
parent 602c803b
...@@ -909,6 +909,7 @@ The following options may be given as the first argument: ...@@ -909,6 +909,7 @@ The following options may be given as the first argument:
--show-slave-auth-info --show-slave-auth-info
Show user and password in SHOW SLAVE HOSTS on this Show user and password in SHOW SLAVE HOSTS on this
master. master.
--silent Don't print [Note] to log during startup.
--skip-bdb Deprecated option; Exist only for compatibility with old --skip-bdb Deprecated option; Exist only for compatibility with old
my.cnf files my.cnf files
--skip-grant-tables Start without grant tables. This gives all users FULL --skip-grant-tables Start without grant tables. This gives all users FULL
...@@ -1386,6 +1387,7 @@ secure-auth TRUE ...@@ -1386,6 +1387,7 @@ secure-auth TRUE
secure-file-priv (No default value) secure-file-priv (No default value)
server-id 0 server-id 0
show-slave-auth-info FALSE show-slave-auth-info FALSE
silent FALSE
skip-grant-tables TRUE skip-grant-tables TRUE
skip-name-resolve FALSE skip-name-resolve FALSE
skip-networking FALSE skip-networking FALSE
......
...@@ -8455,6 +8455,9 @@ void sql_print_information(const char *format, ...) ...@@ -8455,6 +8455,9 @@ void sql_print_information(const char *format, ...)
va_list args; va_list args;
DBUG_ENTER("sql_print_information"); DBUG_ENTER("sql_print_information");
if (disable_log_notes)
DBUG_VOID_RETURN; // Skip notes during start/shutdown
va_start(args, format); va_start(args, format);
error_log_print(INFORMATION_LEVEL, format, args); error_log_print(INFORMATION_LEVEL, format, args);
va_end(args); va_end(args);
......
...@@ -386,7 +386,8 @@ static DYNAMIC_ARRAY all_options; ...@@ -386,7 +386,8 @@ static DYNAMIC_ARRAY all_options;
/* Global variables */ /* Global variables */
bool opt_bin_log, opt_bin_log_used=0, opt_ignore_builtin_innodb= 0; bool opt_bin_log, opt_bin_log_used=0, opt_ignore_builtin_innodb= 0;
my_bool opt_log, debug_assert_if_crashed_table= 0, opt_help= 0; my_bool opt_log, debug_assert_if_crashed_table= 0, opt_help= 0, opt_silent= 0;
my_bool disable_log_notes;
static my_bool opt_abort; static my_bool opt_abort;
ulonglong log_output_options; ulonglong log_output_options;
my_bool opt_userstat_running; my_bool opt_userstat_running;
...@@ -2012,6 +2013,8 @@ extern "C" void unireg_abort(int exit_code) ...@@ -2012,6 +2013,8 @@ extern "C" void unireg_abort(int exit_code)
usage(); usage();
if (exit_code) if (exit_code)
sql_print_error("Aborting\n"); sql_print_error("Aborting\n");
/* Don't write more notes to the log to not hide error message */
disable_log_notes= 1;
#ifdef WITH_WSREP #ifdef WITH_WSREP
/* Check if wsrep class is used. If yes, then cleanup wsrep */ /* Check if wsrep class is used. If yes, then cleanup wsrep */
...@@ -4396,7 +4399,7 @@ static int init_common_variables() ...@@ -4396,7 +4399,7 @@ static int init_common_variables()
DBUG_PRINT("warning", DBUG_PRINT("warning",
("Changed limits: max_open_files: %u max_connections: %ld table_cache: %ld", ("Changed limits: max_open_files: %u max_connections: %ld table_cache: %ld",
files, max_connections, tc_size)); files, max_connections, tc_size));
if (global_system_variables.log_warnings) if (global_system_variables.log_warnings > 1)
sql_print_warning("Changed limits: max_open_files: %u max_connections: %ld table_cache: %ld", sql_print_warning("Changed limits: max_open_files: %u max_connections: %ld table_cache: %ld",
files, max_connections, tc_size); files, max_connections, tc_size);
} }
...@@ -5934,6 +5937,7 @@ int mysqld_main(int argc, char **argv) ...@@ -5934,6 +5937,7 @@ int mysqld_main(int argc, char **argv)
unireg_abort(1); unireg_abort(1);
} }
disable_log_notes= 0; /* Startup done, now we can give notes again */
sql_print_information(ER_DEFAULT(ER_STARTUP),my_progname,server_version, sql_print_information(ER_DEFAULT(ER_STARTUP),my_progname,server_version,
((mysql_socket_getfd(unix_sock) == INVALID_SOCKET) ? ((mysql_socket_getfd(unix_sock) == INVALID_SOCKET) ?
(char*) "" : mysqld_unix_port), (char*) "" : mysqld_unix_port),
...@@ -7491,6 +7495,8 @@ struct my_option my_long_options[]= ...@@ -7491,6 +7495,8 @@ struct my_option my_long_options[]=
"Show user and password in SHOW SLAVE HOSTS on this master.", "Show user and password in SHOW SLAVE HOSTS on this master.",
&opt_show_slave_auth_info, &opt_show_slave_auth_info, 0, &opt_show_slave_auth_info, &opt_show_slave_auth_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"silent", OPT_SILENT, "Don't print [Note] to log during startup.",
&opt_silent, &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-bdb", OPT_DEPRECATED_OPTION, {"skip-bdb", OPT_DEPRECATED_OPTION,
"Deprecated option; Exist only for compatibility with old my.cnf files", "Deprecated option; Exist only for compatibility with old my.cnf files",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
...@@ -8659,6 +8665,7 @@ static int mysql_init_variables(void) ...@@ -8659,6 +8665,7 @@ static int mysql_init_variables(void)
opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name ! opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name !
opt_secure_auth= 0; opt_secure_auth= 0;
opt_bootstrap= opt_myisam_log= 0; opt_bootstrap= opt_myisam_log= 0;
disable_log_notes= 0;
mqh_used= 0; mqh_used= 0;
kill_in_progress= 0; kill_in_progress= 0;
cleanup_done= 0; cleanup_done= 0;
...@@ -9164,7 +9171,9 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) ...@@ -9164,7 +9171,9 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument)
} }
} }
break; break;
case OPT_SILENT:
disable_log_notes= opt_silent;
break;
case OPT_PLUGIN_LOAD: case OPT_PLUGIN_LOAD:
free_list(opt_plugin_load_list_ptr); free_list(opt_plugin_load_list_ptr);
/* fall through */ /* fall through */
...@@ -9398,6 +9407,7 @@ static int get_options(int *argc_ptr, char ***argv_ptr) ...@@ -9398,6 +9407,7 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
global_system_variables.max_allowed_packet); global_system_variables.max_allowed_packet);
} }
#if MYSQL_VERSION_ID > 101001
/* /*
TIMESTAMP columns get implicit DEFAULT values when TIMESTAMP columns get implicit DEFAULT values when
--explicit_defaults_for_timestamp is not set. --explicit_defaults_for_timestamp is not set.
...@@ -9406,7 +9416,7 @@ static int get_options(int *argc_ptr, char ***argv_ptr) ...@@ -9406,7 +9416,7 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
sql_print_warning("TIMESTAMP with implicit DEFAULT value is deprecated. " sql_print_warning("TIMESTAMP with implicit DEFAULT value is deprecated. "
"Please use --explicit_defaults_for_timestamp server " "Please use --explicit_defaults_for_timestamp server "
"option (see documentation for more details)."); "option (see documentation for more details).");
#endif
if (log_error_file_ptr != disabled_my_option) if (log_error_file_ptr != disabled_my_option)
opt_error_log= 1; opt_error_log= 1;
......
...@@ -616,6 +616,7 @@ enum options_mysqld ...@@ -616,6 +616,7 @@ enum options_mysqld
OPT_REPLICATE_WILD_IGNORE_TABLE, OPT_REPLICATE_WILD_IGNORE_TABLE,
OPT_SAFE, OPT_SAFE,
OPT_SERVER_ID, OPT_SERVER_ID,
OPT_SILENT,
OPT_SKIP_HOST_CACHE, OPT_SKIP_HOST_CACHE,
OPT_SKIP_RESOLVE, OPT_SKIP_RESOLVE,
OPT_SLAVE_PARALLEL_MODE, OPT_SLAVE_PARALLEL_MODE,
...@@ -783,7 +784,7 @@ extern ulong thread_created; ...@@ -783,7 +784,7 @@ extern ulong thread_created;
extern scheduler_functions *thread_scheduler, *extra_thread_scheduler; extern scheduler_functions *thread_scheduler, *extra_thread_scheduler;
extern char *opt_log_basename; extern char *opt_log_basename;
extern my_bool opt_master_verify_checksum; extern my_bool opt_master_verify_checksum;
extern my_bool opt_stack_trace; extern my_bool opt_stack_trace, disable_log_notes;
extern my_bool opt_expect_abort; extern my_bool opt_expect_abort;
extern my_bool opt_slave_sql_verify_checksum; extern my_bool opt_slave_sql_verify_checksum;
extern my_bool opt_mysql56_temporal_format, strict_password_validation; extern my_bool opt_mysql56_temporal_format, strict_password_validation;
......
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