Skip to content

Commit bce3086

Browse files
committed
Merge branch 'mysql-5.6' into mysql-5.7
2 parents e779a0c + ea42e88 commit bce3086

File tree

5 files changed

+36
-7
lines changed

5 files changed

+36
-7
lines changed

include/my_default.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ extern const char *my_defaults_extra_file;
2525
extern const char *my_defaults_group_suffix;
2626
extern const char *my_defaults_file;
2727
extern my_bool my_getopt_use_args_separator;
28+
extern my_bool my_defaults_read_login_file;
2829

2930
/* Define the type of function to be passed to process_default_option_files */
3031
typedef int (*Process_option_func)(void *ctx, const char *group_name,

mysql-test/r/mysql_config_editor.result

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,10 @@ DROP USER user_name_len_25_01234567@localhost,user_name_len_26_012345678@localho
313313
###############################
314314
# done..
315315
#### End of test ####
316+
#
317+
# Bug #24557925: MYSQL_CONFIG_EDITOR CAN MAKE SERVER UNBOOTABLE
318+
#
319+
# Restarting the server. Should work
320+
# Cleanup
321+
/home/gkodinov/work/B24557925-5.6/client//mysql_config_editor remove --login-path=mysqld
322+
# End of 5.6 tests

mysql-test/t/mysql_config_editor.test

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,19 @@ DROP USER user_name_len_25_01234567@localhost,user_name_len_26_012345678@localho
240240

241241
--echo #### End of test ####
242242

243+
244+
--echo #
245+
--echo # Bug #24557925: MYSQL_CONFIG_EDITOR CAN MAKE SERVER UNBOOTABLE
246+
--echo #
247+
248+
249+
--exec $MYSQL_CONFIG_EDITOR set --login-path=mysqld --host=test_user5
250+
251+
--echo # Restarting the server. Should work
252+
--source include/restart_mysqld.inc
253+
254+
--echo # Cleanup
255+
--echo $MYSQL_CONFIG_EDITOR remove --login-path=mysqld
256+
--remove_file $MYSQL_TEST_LOGIN_FILE
257+
258+
--echo # End of 5.6 tests

mysys_ssl/my_default.cc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,8 @@ int load_defaults(const char *conf_file, const char **groups,
588588
return my_load_defaults(conf_file, groups, argc, argv, &default_directories);
589589
}
590590

591+
/** A global to turn off or on reading the mylogin file. On by default */
592+
my_bool my_defaults_read_login_file= TRUE;
591593
/*
592594
Read options from configurations files
593595
@@ -672,16 +674,18 @@ int my_load_defaults(const char *conf_file, const char **groups,
672674
DBUG_RETURN(error);
673675
}
674676

675-
/* Read options from login group. */
676-
if (my_default_get_login_file(my_login_file, sizeof(my_login_file)) &&
677-
(error= my_search_option_files(my_login_file,argc, argv, &args_used,
677+
if (my_defaults_read_login_file)
678+
{
679+
/* Read options from login group. */
680+
if (my_default_get_login_file(my_login_file, sizeof(my_login_file)) &&
681+
(error= my_search_option_files(my_login_file, argc, argv, &args_used,
678682
handle_default_option, (void *) &ctx,
679683
dirs, true, found_no_defaults)))
680-
{
681-
free_root(&alloc,MYF(0));
682-
DBUG_RETURN(error);
684+
{
685+
free_root(&alloc, MYF(0));
686+
DBUG_RETURN(error);
687+
}
683688
}
684-
685689
/*
686690
Here error contains <> 0 only if we have a fully specified conf_file
687691
or a forced default file

sql/mysqld.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4365,6 +4365,7 @@ int mysqld_main(int argc, char **argv)
43654365
orig_argc= argc;
43664366
orig_argv= argv;
43674367
my_getopt_use_args_separator= TRUE;
4368+
my_defaults_read_login_file= FALSE;
43684369
if (load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv))
43694370
{
43704371
flush_error_log_messages();

0 commit comments

Comments
 (0)