[Commits] f561fd77505: Merge branch 'patch-1' of https://github.com/colinmollenhour/server into colinmollenhour-patch-1
revision-id: f561fd7750564f61d1f4c8de8f042c3c23f5cfe3 (mariadb-10.3.7-35-gf561fd77505) parent(s): 898a8c3c0ce2c56773865521c59d5ac172495978 396e1835a839dc1a222fa89fc751eede10b933ba author: Jan Lindström committer: Jan Lindström timestamp: 2018-08-29 10:42:06 +0300 message: Merge branch 'patch-1' of https://github.com/colinmollenhour/server into colinmollenhour-patch-1 scripts/wsrep_sst_common.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --cc scripts/wsrep_sst_common.sh index e72b74ab6d1,0579ddc35ac..ef5a295d36f --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@@ -253,15 -258,24 +253,23 @@@ parse_cnf( local var=$2 local reval="" - # print the default settings for given group using my_print_default. # normalize the variable names specified in cnf file (user can use _ or - for example log-bin or log_bin) - # then grep for needed variable + # then search for needed variable # finally get the variable value (if variables has been specified multiple time use the last value only) - reval=$($MY_PRINT_DEFAULTS "${group}" | awk -v var="${var}" 'BEGIN { OFS=FS="=" } { gsub(/_/,"-",$1); if ( $1=="--"var) lastval=substr($0,length($1)+2) } END { print lastval}') + # look in group+suffix + if [ -n $WSREP_SST_OPT_CONF_SUFFIX ]; then + reval=$($MY_PRINT_DEFAULTS "${group}${WSREP_SST_OPT_CONF_SUFFIX}" | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1) + fi + + # look in group + if [ -z "$reval" ]; then + reval=$($MY_PRINT_DEFAULTS $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1) + fi # use default if we haven't found a value - if [ -z $reval ]; then - [ -n $3 ] && reval=$3 + if [ -z "$reval" ]; then + [ -n "$3" ] && reval=$3 fi echo $reval }
participants (1)
-
jan