diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-11-19 17:48:36 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-11-19 17:48:36 +0100 |
commit | 7f19330c595e3183d079fe2c18eecc74740e8f83 (patch) | |
tree | 8b853976cd14d96d5415757be525133b32be0c93 /scripts/wsrep_sst_common.sh | |
parent | 4046ed12bcddfd831c510b022cb7af224be9457b (diff) | |
parent | f4421c893b50f05078f14d33c47d21f52f59f8a7 (diff) | |
download | mariadb-git-7f19330c595e3183d079fe2c18eecc74740e8f83.tar.gz |
Merge branch 'github/10.0-galera' into 10.1
Diffstat (limited to 'scripts/wsrep_sst_common.sh')
-rw-r--r-- | scripts/wsrep_sst_common.sh | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index 78060f70ca5..fb8289d06df 100644 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2014 Codership Oy +# Copyright (C) 2012-2015 Codership Oy # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,22 +20,20 @@ set -u WSREP_SST_OPT_BYPASS=0 WSREP_SST_OPT_BINLOG="" +WSREP_SST_OPT_CONF_SUFFIX="" WSREP_SST_OPT_DATA="" -WSREP_SST_OPT_AUTH="" +WSREP_SST_OPT_AUTH=${WSREP_SST_OPT_AUTH:-} +WSREP_SST_OPT_USER=${WSREP_SST_OPT_USER:-} +WSREP_SST_OPT_PSWD=${WSREP_SST_OPT_PSWD:-} WSREP_SST_OPT_DEFAULT="" WSREP_SST_OPT_EXTRA_DEFAULT="" - while [ $# -gt 0 ]; do case "$1" in '--address') readonly WSREP_SST_OPT_ADDR="$2" shift ;; - '--auth') - WSREP_SST_OPT_AUTH="$2" - shift - ;; '--bypass') WSREP_SST_OPT_BYPASS=1 ;; @@ -50,6 +48,9 @@ case "$1" in '--defaults-extra-file') readonly WSREP_SST_OPT_EXTRA_DEFAULT="$1=$2" shift + '--defaults-group-suffix') + WSREP_SST_OPT_CONF_SUFFIX="$2" + shift ;; '--host') readonly WSREP_SST_OPT_HOST="$2" @@ -104,6 +105,7 @@ shift done readonly WSREP_SST_OPT_BYPASS readonly WSREP_SST_OPT_BINLOG +readonly WSREP_SST_OPT_CONF_SUFFIX # try to use my_print_defaults, mysql and mysqldump that come with the sources # (for MTR suite) @@ -133,13 +135,30 @@ fi readonly WSREP_SST_OPT_CONF="$WSREP_SST_OPT_DEFAULT $WSREP_SST_OPT_EXTRA_DEFAULT" MY_PRINT_DEFAULTS="$MY_PRINT_DEFAULTS $WSREP_SST_OPT_CONF" +wsrep_auth_not_set() +{ + [ -z "$WSREP_SST_OPT_AUTH" -o "$WSREP_SST_OPT_AUTH" = "(null)" ] +} -# State Snapshot Transfer authentication password was displayed in the ps output. Bug fixed #1200727. -if $MY_PRINT_DEFAULTS sst | grep -q "wsrep_sst_auth";then - if [ -z "$WSREP_SST_OPT_AUTH" -o "$WSREP_SST_OPT_AUTH" = "(null)" ];then - WSREP_SST_OPT_AUTH=$($MY_PRINT_DEFAULTS sst | grep -- "--wsrep_sst_auth" | cut -d= -f2) +# For Bug:1200727 +if $MY_PRINT_DEFAULTS sst | grep -q "wsrep_sst_auth" +then + if wsrep_auth_not_set + then + WSREP_SST_OPT_AUTH=$($MY_PRINT_DEFAULTS sst | grep -- "--wsrep_sst_auth" | cut -d= -f2) fi fi +readonly WSREP_SST_OPT_AUTH + +# Splitting AUTH into potential user:password pair +if ! wsrep_auth_not_set +then + readonly AUTH_VEC=(${WSREP_SST_OPT_AUTH//:/ }) + WSREP_SST_OPT_USER="${AUTH_VEC[0]:-}" + WSREP_SST_OPT_PSWD="${AUTH_VEC[1]:-}" +fi +readonly WSREP_SST_OPT_USER +readonly WSREP_SST_OPT_PSWD if [ -n "${WSREP_SST_OPT_DATA:-}" ] then @@ -148,7 +167,6 @@ else SST_PROGRESS_FILE="" fi - wsrep_log() { # echo everything to stderr so that it gets into common error log |