Commit eb4bdff1 authored by Michael Widenius's avatar Michael Widenius

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
parent 29de9958
......@@ -2240,7 +2240,7 @@ extern uint thread_handling;
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_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 my_bool opt_readonly, lower_case_file_system;
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
*/
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_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 */
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;
ulong log_output_options;
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 &&
!(lower_case_file_system=
(test_if_case_insensitive(mysql_real_data_home) == 1)))
!(lower_case_file_system= (lower_case_file_system == 1)))
{
if (global_system_variables.log_warnings)
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
{
lower_case_file_system=
(test_if_case_insensitive(mysql_real_data_home) == 1);
lower_case_file_system= (lower_case_file_system == 1);
}
/* 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
*/
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 */
mysql_data_home= mysql_data_home_buff;
mysql_data_home[0]=FN_CURLIB; // all paths are relative from here
......@@ -9920,6 +9918,7 @@ static int test_if_case_insensitive(const char *dir_name)
(void) my_delete(buff2, MYF(0));
if ((file= my_create(buff, 0666, O_RDWR, MYF(0))) < 0)
{
if (!opt_help)
sql_print_warning("Can't create test file %s", buff);
DBUG_RETURN(-1);
}
......
......@@ -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))
{
DBUG_PRINT("error",("Can't open plugin table"));
if (!opt_help)
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;
}
table= tables.table;
......
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