Commit 26192a46 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

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.
parent 3a38a7a4
...@@ -27,6 +27,7 @@ echo_c= ...@@ -27,6 +27,7 @@ echo_c=
basedir= basedir=
defaults_file= defaults_file=
defaults_extra_file= defaults_extra_file=
defaults_group_suffix=
no_defaults= no_defaults=
parse_arg() parse_arg()
...@@ -52,6 +53,7 @@ parse_arguments() ...@@ -52,6 +53,7 @@ parse_arguments()
--basedir=*) basedir=`parse_arg "$arg"` ;; --basedir=*) basedir=`parse_arg "$arg"` ;;
--defaults-file=*) defaults_file="$arg" ;; --defaults-file=*) defaults_file="$arg" ;;
--defaults-extra-file=*) defaults_extra_file="$arg" ;; --defaults-extra-file=*) defaults_extra_file="$arg" ;;
--defaults-group-suffix=*) defaults_group_suffix="$arg" ;;
--no-defaults) no_defaults="$arg" ;; --no-defaults) no_defaults="$arg" ;;
*) *)
if test -n "$pick_args" if test -n "$pick_args"
...@@ -184,7 +186,7 @@ fi ...@@ -184,7 +186,7 @@ fi
# Now we can get arguments from the group [client] and [client-server] # Now we can get arguments from the group [client] and [client-server]
# in the my.cfg file, then re-run to merge with command line arguments. # in the my.cfg file, then re-run to merge with command line arguments.
parse_arguments `$print_defaults $defaults_file $defaults_extra_file $no_defaults client client-server client-mariadb` parse_arguments `$print_defaults $defaults_file $defaults_extra_file $defaults_group_suffix $no_defaults client client-server client-mariadb`
parse_arguments PICK-ARGS-FROM-ARGV "$@" parse_arguments PICK-ARGS-FROM-ARGV "$@"
set_echo_compat() { set_echo_compat() {
......
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