summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-07-23 21:44:35 +0200
committerSergei Golubchik <sergii@pisem.net>2014-07-23 21:44:35 +0200
commit8fc3724421529b982df81bc56ee89a763295b8d8 (patch)
tree82415e48132685eb03802f62464843016ff08d9a /scripts
parent1907bf042a38c162740fb729b8a93b4c6f72f411 (diff)
downloadmariadb-git-8fc3724421529b982df81bc56ee89a763295b8d8.tar.gz
MDEV-5958 Inconsitent handling of invalid arguments for mysqld_safe
issue an error for unrecognized options in the [mysqld_safe] section of my.cnf but don't abort the script
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysqld_safe.sh29
1 files changed, 13 insertions, 16 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index a8e1cac2793..e5e0b768440 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -190,16 +190,6 @@ shell_quote_string() {
}
parse_arguments() {
- # We only need to pass arguments through to the server if we don't
- # handle them here. So, we collect unrecognized options (passed on
- # the command line) into the args variable.
- pick_args=
- if test "$1" = PICK-ARGS-FROM-ARGV
- then
- pick_args=1
- shift
- fi
-
for arg do
# the parameter after "=", or the whole $arg if no match
val=`echo "$arg" | sed -e 's;^--[^=]*=;;'`
@@ -256,11 +246,10 @@ parse_arguments() {
--help) usage ;;
*)
- if test -n "$pick_args"
- then
- append_arg_to_args "$arg"
- fi
- ;;
+ case "$unrecognized_handling" in
+ collect) append_arg_to_args "$arg" ;;
+ complain) log_error "unknown option '$arg'" ;;
+ esac
esac
done
}
@@ -517,8 +506,16 @@ then
SET_USER=0
fi
+# If arguments come from [mysqld_safe] section of my.cnf
+# we complain about unrecognized options
+unrecognized_handling=complain
parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld mariadb_safe`
-parse_arguments PICK-ARGS-FROM-ARGV "$@"
+
+# We only need to pass arguments through to the server if we don't
+# handle them here. So, we collect unrecognized options (passed on
+# the command line) into the args variable.
+unrecognized_handling=collect
+parse_arguments "$@"
#