Rearrange mysql options so that --defaults-file is always first, and remove default: localhost from pt-ms and pt-stalk, since parse_options.sh deals with defaults + config files for mysql options poorly

This commit is contained in:
Brian Fraser
2013-03-06 12:52:17 -03:00
parent ebd83f5ba4
commit 0efad73f3e
3 changed files with 35 additions and 4 deletions

View File

@@ -47,6 +47,22 @@ mysql_options() {
echo $MYSQL_ARGS
}
# This basically makes sure that --defaults-file comes first
arrange_mysql_options() {
local opts="$1"
local rearranged=""
for opt in $opts; do
if [ "$(echo $opt | awk -F= '{print $1}')" = "--defaults-file" ]; then
rearranged="$opt $rearranged"
else
rearranged="$rearranged $opt"
fi
done
echo "$rearranged"
}
# ###########################################################################
# End mysql_options package
# ###########################################################################