1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
jani@a80-186-24-72.elisa-laajakaista.fi
2004-06-01 17:29:24 +03:00
parent df8f605609
commit 2953c23ab0
4 changed files with 13 additions and 5 deletions

View File

@ -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)),
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();

View File

@ -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",

View File

@ -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;

View File

@ -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",