Fixed that mysqld --no-defaults --help --verbose doesn't give a lot of irrelevant error messages.
sql/mysql_priv.h: Make opt_help global sql/mysqld.cc: Don't give (double) warnings about lower case file systems if --help is given. Don't give warning about non existing data directory if --help is given. sql/sql_plugin.cc: Give a better warning if --help is used and plugin table doesn't exists
This commit is contained in:
parent
370f79e389
commit
2740edcf56
@ -2240,7 +2240,7 @@ extern uint thread_handling;
|
|||||||
extern uint connection_count, extra_connection_count;
|
extern uint connection_count, extra_connection_count;
|
||||||
extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
|
extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
|
||||||
extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
|
extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
|
||||||
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
|
extern my_bool opt_slave_compressed_protocol, use_temp_pool, opt_help;
|
||||||
extern ulong slave_exec_mode_options;
|
extern ulong slave_exec_mode_options;
|
||||||
extern my_bool opt_readonly, lower_case_file_system;
|
extern my_bool opt_readonly, lower_case_file_system;
|
||||||
extern my_bool opt_userstat_running;
|
extern my_bool opt_userstat_running;
|
||||||
|
@ -436,7 +436,7 @@ bool opt_large_files= sizeof(my_off_t) > 4;
|
|||||||
/*
|
/*
|
||||||
Used with --help for detailed option
|
Used with --help for detailed option
|
||||||
*/
|
*/
|
||||||
static my_bool opt_help= 0, opt_verbose= 0;
|
static my_bool opt_verbose= 0;
|
||||||
|
|
||||||
arg_cmp_func Arg_comparator::comparator_matrix[6][2] =
|
arg_cmp_func Arg_comparator::comparator_matrix[6][2] =
|
||||||
{{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string},
|
{{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string},
|
||||||
@ -521,7 +521,7 @@ static pthread_cond_t COND_thread_cache, COND_flush_thread_cache;
|
|||||||
/* Global variables */
|
/* Global variables */
|
||||||
|
|
||||||
bool opt_update_log, opt_bin_log, opt_ignore_builtin_innodb= 0;
|
bool opt_update_log, opt_bin_log, opt_ignore_builtin_innodb= 0;
|
||||||
my_bool opt_log, opt_slow_log, debug_assert_if_crashed_table;
|
my_bool opt_log, opt_slow_log, debug_assert_if_crashed_table, opt_help= 0;
|
||||||
my_bool opt_userstat_running;
|
my_bool opt_userstat_running;
|
||||||
ulong log_output_options;
|
ulong log_output_options;
|
||||||
my_bool opt_log_queries_not_using_indexes= 0;
|
my_bool opt_log_queries_not_using_indexes= 0;
|
||||||
@ -3829,8 +3829,7 @@ You should consider changing lower_case_table_names to 1 or 2",
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (lower_case_table_names == 2 &&
|
else if (lower_case_table_names == 2 &&
|
||||||
!(lower_case_file_system=
|
!(lower_case_file_system= (lower_case_file_system == 1)))
|
||||||
(test_if_case_insensitive(mysql_real_data_home) == 1)))
|
|
||||||
{
|
{
|
||||||
if (global_system_variables.log_warnings)
|
if (global_system_variables.log_warnings)
|
||||||
sql_print_warning("lower_case_table_names was set to 2, even though your "
|
sql_print_warning("lower_case_table_names was set to 2, even though your "
|
||||||
@ -3841,8 +3840,7 @@ You should consider changing lower_case_table_names to 1 or 2",
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lower_case_file_system=
|
lower_case_file_system= (lower_case_file_system == 1);
|
||||||
(test_if_case_insensitive(mysql_real_data_home) == 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset table_alias_charset, now that lower_case_table_names is set. */
|
/* Reset table_alias_charset, now that lower_case_table_names is set. */
|
||||||
@ -4744,7 +4742,7 @@ int main(int argc, char **argv)
|
|||||||
We have enough space for fiddling with the argv, continue
|
We have enough space for fiddling with the argv, continue
|
||||||
*/
|
*/
|
||||||
check_data_home(mysql_real_data_home);
|
check_data_home(mysql_real_data_home);
|
||||||
if (my_setwd(mysql_real_data_home,MYF(MY_WME)) && !opt_help)
|
if (my_setwd(mysql_real_data_home, opt_help ? 0 : MYF(MY_WME)) && !opt_help)
|
||||||
unireg_abort(1); /* purecov: inspected */
|
unireg_abort(1); /* purecov: inspected */
|
||||||
mysql_data_home= mysql_data_home_buff;
|
mysql_data_home= mysql_data_home_buff;
|
||||||
mysql_data_home[0]=FN_CURLIB; // all paths are relative from here
|
mysql_data_home[0]=FN_CURLIB; // all paths are relative from here
|
||||||
@ -9920,7 +9918,8 @@ static int test_if_case_insensitive(const char *dir_name)
|
|||||||
(void) my_delete(buff2, MYF(0));
|
(void) my_delete(buff2, MYF(0));
|
||||||
if ((file= my_create(buff, 0666, O_RDWR, MYF(0))) < 0)
|
if ((file= my_create(buff, 0666, O_RDWR, MYF(0))) < 0)
|
||||||
{
|
{
|
||||||
sql_print_warning("Can't create test file %s", buff);
|
if (!opt_help)
|
||||||
|
sql_print_warning("Can't create test file %s", buff);
|
||||||
DBUG_RETURN(-1);
|
DBUG_RETURN(-1);
|
||||||
}
|
}
|
||||||
my_close(file, MYF(0));
|
my_close(file, MYF(0));
|
||||||
|
@ -1638,8 +1638,11 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
|
|||||||
if (simple_open_n_lock_tables(new_thd, &tables))
|
if (simple_open_n_lock_tables(new_thd, &tables))
|
||||||
{
|
{
|
||||||
DBUG_PRINT("error",("Can't open plugin table"));
|
DBUG_PRINT("error",("Can't open plugin table"));
|
||||||
sql_print_error("Can't open the mysql.plugin table. Please "
|
if (!opt_help)
|
||||||
"run mysql_upgrade to create it.");
|
sql_print_error("Can't open the mysql.plugin table. Please "
|
||||||
|
"run mysql_upgrade to create it.");
|
||||||
|
else
|
||||||
|
sql_print_warning("Could not open mysql.plugin table. Some options may be missing from the help text");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
table= tables.table;
|
table= tables.table;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user