summaryrefslogtreecommitdiff
path: root/scripts/wsrep_sst_common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/wsrep_sst_common.sh')
-rw-r--r--scripts/wsrep_sst_common.sh24
1 files changed, 23 insertions, 1 deletions
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index 6c16e9a5e61..e9f67587c74 100644
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -61,6 +61,23 @@ trim_dir()
fi
}
+to_minuses()
+{
+ local x="$1"
+ local t="${1#*_}"
+ local r=""
+ while [ "$t" != "$x" ]; do
+ r="$r${x%%_*}-"
+ x="$t"
+ t="${t#*_}"
+ done
+ if [ -n "$BASH_VERSION" ]; then
+ printf '%s' "$r$x"
+ else
+ echo "$r$x"
+ fi
+}
+
WSREP_SST_OPT_BYPASS=0
WSREP_SST_OPT_BINLOG=""
WSREP_SST_OPT_BINLOG_INDEX=""
@@ -409,6 +426,11 @@ case "$1" in
# that has a "long" name, so remove all characters after
# the first equal sign:
option="${1%%=*}"
+ # If the option name contains underscores, then replace
+ # them to minuses:
+ if [ "${option#*_}" != "$option" ]; then
+ option=$(to_minuses "$option")
+ fi
# The "--loose-" prefix should not affect the recognition
# of the option name:
if [ "${option#--loose-}" != "$option" ]; then
@@ -598,7 +620,7 @@ get_binlog()
# If the log-bin option is specified without a parameter,
# then we need to build the name of the index file according
# to the rules described in the server documentation:
- if [ $(in_config '--mysqld' 'log-bin') -eq 1 ]; then
+ if [ $(in_config '--mysqld' 'log-bin') -ne 0 ]; then
if [ -n "$WSREP_SST_OPT_LOG_BASENAME" ]; then
# If the WSREP_SST_OPT_BINLOG variable is not set, but
# --log-basename is present among the arguments of mysqld,