From 26192a4665f12e88f55858364b2c7ec372c280f0 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 16 Jul 2024 09:30:20 +0200 Subject: [PATCH] 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. --- scripts/mysql_secure_installation.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index b2a9edf4953..7a0611070cc 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -27,6 +27,7 @@ echo_c= basedir= defaults_file= defaults_extra_file= +defaults_group_suffix= no_defaults= parse_arg() @@ -52,6 +53,7 @@ parse_arguments() --basedir=*) basedir=`parse_arg "$arg"` ;; --defaults-file=*) defaults_file="$arg" ;; --defaults-extra-file=*) defaults_extra_file="$arg" ;; + --defaults-group-suffix=*) defaults_group_suffix="$arg" ;; --no-defaults) no_defaults="$arg" ;; *) if test -n "$pick_args" @@ -184,7 +186,7 @@ fi # 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. -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 "$@" set_echo_compat() {