• Daniel Black's avatar
    MDEV-15496: wsrep_sst_common - parse IPv6 correct · 2b35db5a
    Daniel Black authored
    Fix to e78e308e, IPv6 got split at :
    
    Also got rid of awk (yuck!) to parse port (commit: b4fbb418)
    
    Tested with dash to avoid bashisms:
    
    $ dash -vx './wsrep_sst_common.sh' --address '128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1  | more
    + readonly WSREP_SST_OPT_ADDR=128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_HOST=128.0.0.5
    + readonly WSREP_SST_OPT_HOST_UNESCAPED=128.0.0.5
    + remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_PORT=3333
    + remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_MODULE=module
    + readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + remain=lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_LSN=lsn_version
    + remain=sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_SST_VER=sst_ver
    
    $ dash -vx './wsrep_sst_common.sh' --address '[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1  | more
    + readonly WSREP_SST_OPT_ADDR=[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + addr_no_bracket=2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_HOST_UNESCAPED=2001:db8::1
    + readonly WSREP_SST_OPT_HOST=[2001:db8::1]
    + remain=:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_PORT=3333
    + remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_MODULE=module
    + readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + remain=lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_LSN=lsn_version
    + remain=sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_SST_VER=sst_ver
    
    And bash as well:
    
    $ bash -vx './wsrep_sst_common.sh' --address '127.0.0.3:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1 | more
    + readonly WSREP_SST_OPT_ADDR=127.0.0.3:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + WSREP_SST_OPT_ADDR=127.0.0.3:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + case "${WSREP_SST_OPT_ADDR}" in
    + readonly WSREP_SST_OPT_HOST=127.0.0.3
    + WSREP_SST_OPT_HOST=127.0.0.3
    + readonly WSREP_SST_OPT_HOST_UNESCAPED=127.0.0.3
    + WSREP_SST_OPT_HOST_UNESCAPED=127.0.0.3
    + remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_PORT=3333
    + WSREP_SST_OPT_PORT=3333
    + remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_MODULE=module
    + WSREP_SST_OPT_MODULE=module
    + readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + remain=lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_LSN=lsn_version
    + WSREP_SST_OPT_LSN=lsn_version
    + remain=sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_SST_VER=sst_ver
    + WSREP_SST_OPT_SST_VER=sst_ver
    
    $ bash -vx './wsrep_sst_common.sh' --address '[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1 | more
    + readonly 'WSREP_SST_OPT_ADDR=[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2'
    + WSREP_SST_OPT_ADDR='[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2'
    + case "${WSREP_SST_OPT_ADDR}" in
    + addr_no_bracket='2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2'
    + readonly WSREP_SST_OPT_HOST_UNESCAPED=2001:db8::1
    + WSREP_SST_OPT_HOST_UNESCAPED=2001:db8::1
    + readonly 'WSREP_SST_OPT_HOST=[2001:db8::1]'
    + WSREP_SST_OPT_HOST='[2001:db8::1]'
    + remain=:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_PORT=3333
    + WSREP_SST_OPT_PORT=3333
    + remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_MODULE=module
    + WSREP_SST_OPT_MODULE=module
    + readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
    + remain=lsn_version/sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_LSN=lsn_version
    + WSREP_SST_OPT_LSN=lsn_version
    + remain=sst_ver/some_future_option1/some_future_option2
    + readonly WSREP_SST_OPT_SST_VER=sst_ver
    + WSREP_SST_OPT_SST_VER=sst_ver
    2b35db5a
wsrep_sst_common.sh 7.1 KB