Commit 80c66247 authored by unknown's avatar unknown

Changed --log-warnings to be integer instead of boolean. Given --skip-log-warnings

will disable warnings, --log-warnings will increment warning level by one, or the
level can be given as an optional argument. Default level is 1.

Changed aborted connection warning to be logged only if the level is > 1.


sql/sql_class.h:
  Changed boolean into ulong.
sql/sql_parse.cc:
  Changed aborted connection warning to be logged only if the level is > 1.
parent fec8faa0
...@@ -3944,11 +3944,11 @@ replicating a LOAD DATA INFILE command", ...@@ -3944,11 +3944,11 @@ replicating a LOAD DATA INFILE command",
0, 0, 0, 0}, 0, 0, 0, 0},
{"log-warnings", 'W', "Log some not critical warnings to the log file", {"log-warnings", 'W', "Log some not critical warnings to the log file",
(gptr*) &global_system_variables.log_warnings, (gptr*) &global_system_variables.log_warnings,
(gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 1, 0, 0, (gptr*) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0,
0, 0, 0}, 0, 0, 0},
{"warnings", 'W', "Deprecated ; Use --log-warnings instead", {"warnings", 'W', "Deprecated ; Use --log-warnings instead",
(gptr*) &global_system_variables.log_warnings, (gptr*) &global_system_variables.log_warnings,
(gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 1, 0, 0, (gptr*) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0,
0, 0, 0}, 0, 0, 0},
{ "back_log", OPT_BACK_LOG, { "back_log", OPT_BACK_LOG,
"The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.", "The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.",
...@@ -4656,6 +4656,14 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -4656,6 +4656,14 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'V': case 'V':
print_version(); print_version();
exit(0); exit(0);
case 'W':
if (!argument)
global_system_variables.log_warnings++;
else if (argument == disabled_my_option)
global_system_variables.log_warnings= 0L;
else
global_system_variables.log_warnings= atoi(argument);
break;
case 'I': case 'I':
case '?': case '?':
usage(); usage();
......
...@@ -133,7 +133,7 @@ sys_var_ulonglong_ptr sys_key_buffer_size("key_buffer_size", ...@@ -133,7 +133,7 @@ sys_var_ulonglong_ptr sys_key_buffer_size("key_buffer_size",
fix_key_buffer_size); fix_key_buffer_size);
sys_var_bool_ptr sys_local_infile("local_infile", sys_var_bool_ptr sys_local_infile("local_infile",
&opt_local_infile); &opt_local_infile);
sys_var_thd_bool sys_log_warnings("log_warnings", &SV::log_warnings); sys_var_thd_ulong sys_log_warnings("log_warnings", &SV::log_warnings);
sys_var_thd_ulong sys_long_query_time("long_query_time", sys_var_thd_ulong sys_long_query_time("long_query_time",
&SV::long_query_time); &SV::long_query_time);
sys_var_thd_bool sys_low_priority_updates("low_priority_updates", sys_var_thd_bool sys_low_priority_updates("low_priority_updates",
......
...@@ -333,8 +333,8 @@ struct system_variables ...@@ -333,8 +333,8 @@ struct system_variables
ulong query_prealloc_size; ulong query_prealloc_size;
ulong trans_alloc_block_size; ulong trans_alloc_block_size;
ulong trans_prealloc_size; ulong trans_prealloc_size;
ulong log_warnings;
my_bool log_warnings;
my_bool low_priority_updates; my_bool low_priority_updates;
my_bool new_mode; my_bool new_mode;
my_bool query_cache_wlock_invalidate; my_bool query_cache_wlock_invalidate;
......
...@@ -742,7 +742,7 @@ pthread_handler_decl(handle_one_connection,arg) ...@@ -742,7 +742,7 @@ pthread_handler_decl(handle_one_connection,arg)
free_root(&thd->mem_root,MYF(0)); free_root(&thd->mem_root,MYF(0));
if (net->error && net->vio != 0) if (net->error && net->vio != 0)
{ {
if (!thd->killed && thd->variables.log_warnings) if (!thd->killed && thd->variables.log_warnings > 1)
sql_print_error(ER(ER_NEW_ABORTING_CONNECTION), sql_print_error(ER(ER_NEW_ABORTING_CONNECTION),
thd->thread_id,(thd->db ? thd->db : "unconnected"), thd->thread_id,(thd->db ? thd->db : "unconnected"),
thd->user ? thd->user : "unauthenticated", thd->user ? thd->user : "unauthenticated",
......
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