summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2020-08-11 14:03:02 +0200
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2020-08-11 14:03:02 +0200
commit490a078ee4b9cddd9e357512eb5bcc23f9addc40 (patch)
tree21e5e806fd1e7e2fcd2b4d1bd722d83af7b312db
parente3c18b8e849373821b9c009b285ae13ef0fcc1a8 (diff)
downloadmariadb-git-bb-10.1-MDEV-21039.tar.gz
MDEV-21039: Server fails to start with unknown mysqld_safe optionsbb-10.1-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 (for 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.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 87dc81e8b5f..3d3d4141dc5 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -24,6 +24,7 @@ unsafe_my_cnf=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
@@ -383,11 +384,22 @@ 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
+ "--loose-"*) append_arg_to_args "$arg" ;;
+ *) append_arg_to_args "--loose-$arg"
+ esac
+ fi
esac
done
}