Skip to content

Commit 26192a4

Browse files
committed
MDEV-33265 mariadb-secure-installation fails with --defaults-group-suffix
Reason for the error is that --defaults-group-suffix is passed twice to the command line client, and option parser is not prepared for this. Double occurence of comes from 2 invocations of parse_arguments(), which appends unparsed arguments each time it is called. Fixed by treating --defaults-group-suffix like other "--defaults-" (--defaults-file/--defaults-extra-file). it will be parsed, and thus passed only once to the command line client.
1 parent 3a38a7a commit 26192a4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/mysql_secure_installation.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ echo_c=
2727
basedir=
2828
defaults_file=
2929
defaults_extra_file=
30+
defaults_group_suffix=
3031
no_defaults=
3132

3233
parse_arg()
@@ -52,6 +53,7 @@ parse_arguments()
5253
--basedir=*) basedir=`parse_arg "$arg"` ;;
5354
--defaults-file=*) defaults_file="$arg" ;;
5455
--defaults-extra-file=*) defaults_extra_file="$arg" ;;
56+
--defaults-group-suffix=*) defaults_group_suffix="$arg" ;;
5557
--no-defaults) no_defaults="$arg" ;;
5658
*)
5759
if test -n "$pick_args"
@@ -184,7 +186,7 @@ fi
184186

185187
# Now we can get arguments from the group [client] and [client-server]
186188
# in the my.cfg file, then re-run to merge with command line arguments.
187-
parse_arguments `$print_defaults $defaults_file $defaults_extra_file $no_defaults client client-server client-mariadb`
189+
parse_arguments `$print_defaults $defaults_file $defaults_extra_file $defaults_group_suffix $no_defaults client client-server client-mariadb`
188190
parse_arguments PICK-ARGS-FROM-ARGV "$@"
189191

190192
set_echo_compat() {

0 commit comments

Comments
 (0)