summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-06-07 10:54:37 +0300
committerMichael Widenius <monty@askmonty.org>2011-06-07 10:54:37 +0300
commit2740edcf5680bc03a318378514f88fefa67d5923 (patch)
treea9dcb5110fe3e01bb23aa44338c6f0c8e10a950c
parent370f79e38991cf45e921a29bdb1a57c23447d6c7 (diff)
downloadmariadb-git-2740edcf5680bc03a318378514f88fefa67d5923.tar.gz
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
-rw-r--r--sql/mysql_priv.h2
-rw-r--r--sql/mysqld.cc15
-rw-r--r--sql/sql_plugin.cc7
3 files changed, 13 insertions, 11 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 1ab8936df4c..3da7faa7799 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -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;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 9b8edb1d985..7db2eda0277 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -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,7 +9918,8 @@ 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)
{
- 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);
}
my_close(file, MYF(0));
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 391a574b35d..a83990d25f4 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -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"));
- sql_print_error("Can't open the mysql.plugin table. Please "
- "run mysql_upgrade to create it.");
+ 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;