summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2021-01-18 16:21:58 +0100
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2021-01-18 16:21:58 +0100
commitd16a08a1d16263f7f9b349777940ff51747c4d8e (patch)
treeec5842a5ddfaa6bf369065e49c1bc3ca5927ccf8
parentbeaea31ab12ab56ea8a6eb5e99cf82648675ea78 (diff)
downloadmariadb-git-10.2-MDEV-21039.tar.gz
MDEV-21039: Server fails to start with unknown mysqld_safe options10.2-MDEV-21039
Adding any unknown option to the "[mysqld_safe]" section makes mysqld impossible to start with mysqld_multi. For example, after adding the unknown option "numa_interleave" to the "[mysqld_safe]" section, mysqld_multi exits with the following diagnostics: [ERROR] /usr/local/mysql/bin/mysqld: unknown option '--numa_interleave' To get rid of this behavior, this patch by default adds the "--loose-" prefix to all unknown (to mysqld_safe) options. This behavior can be enabled explicitly with the --ignore-unknown option and disabled with the --no-ignore-unknown option.
-rw-r--r--scripts/mysqld_safe.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index dc2c0db8e40..76c2ed1ad98 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -23,6 +23,7 @@ numa_interleave=0
wsrep_on=0
dry_run=0
defaults_group_suffix=
+ignore_unknown=1
# Initial logging status: error log is not open, and not using syslog
logging=init
@@ -389,11 +390,24 @@ parse_arguments() {
--help) usage ;;
+ --ignore-unknown) ignore_unknown=1 ;;
+ --no-ignore-unknown|--not-ignore-unknown) ignore_unknown=0 ;;
+
*)
- case "$unrecognized_handling" in
- collect) append_arg_to_args "$arg" ;;
- complain) log_error "unknown option '$arg'" ;;
- esac
+ if test $ignore_unknown -eq 0
+ then
+ case "$unrecognized_handling" in
+ collect) append_arg_to_args "$arg" ;;
+ complain) log_error "unknown option '$arg'"
+ esac
+ else
+ case "$arg" in
+ --no-defaults|--defaults-file=*|--defaults-extra-file|--loose-*)
+ append_arg_to_args "$arg" ;;
+ *)
+ append_arg_to_args "--loose-$arg"
+ esac
+ fi
esac
done
}