forked from mysql/mysql-server
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WL#11652 Support multiple addresses for the --bind-address command op…
…tion This worklog adds support for binding a server to several IP addresses. To specify several addresses for listening incoming connection requests, the command line option --bind-address was extended to support comma separated list of IP addresses to bind. For every specified IP address a separate TCP socket is created and added to a list of sockets for listening incoming TCP connections.
- Loading branch information
Dmitry Shulga
committed
Jun 21, 2018
1 parent
9318d51
commit b72b101
Showing
9 changed files
with
435 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# | ||
# WL#11652 -- Support multiple addresses for the --bind-address command option | ||
# | ||
# | ||
# Server is started with --bind-address=127.0.0.1,::1 | ||
# Check that server accepts incoming connection both | ||
# on the address 127.0.0.1 and on the address ::1 | ||
# | ||
# Connecting to a server via 127.0.0.1 | ||
# Connecting to a server via ::1 | ||
SELECT @@global.bind_address; | ||
@@global.bind_address | ||
127.0.0.1,::1 | ||
# Stop DB server which was created by MTR default | ||
# | ||
# Starting mysqld in the regular mode... | ||
# | ||
# restart: --bind-address=127.0.0.1 | ||
SELECT @@global.bind_address; | ||
@@global.bind_address | ||
127.0.0.1 | ||
# Stop DB server which was created by MTR default | ||
# | ||
# Starting mysqld in the regular mode... | ||
# | ||
# restart: --bind-address=* | ||
SELECT @@global.bind_address; | ||
@@global.bind_address | ||
* | ||
# Stop DB server which was created by MTR default | ||
# | ||
# Starting mysqld in the regular mode... | ||
# | ||
# restart: --bind-address=:: | ||
SELECT @@global.bind_address; | ||
@@global.bind_address | ||
:: | ||
# Stop DB server which was created by MTR default | ||
# Check seperators not being ','. | ||
# Check that specially treated value :: is not allowed as part of | ||
# multi-value option bind-address. | ||
Pattern "Invalid value for command line option bind-addresses:" found | ||
# Check that specially treated value * is not allowed as part of | ||
# multi-value option bind-address. | ||
Pattern "Invalid value for command line option bind-addresses:" found | ||
# Check that server catches a parsing error during processing of | ||
# multi-value option bind-address. | ||
# Two adjacent commas in a value of the option --bind-address is treated | ||
# as an error. | ||
Pattern "Invalid value for command line option bind-addresses:" found | ||
# Check that a server catches a parsing error during processing of | ||
# multi-value option bind-address. | ||
# Comma in the end of a value of the option --bind-address is treated | ||
# as an error. | ||
Pattern "Invalid value for command line option bind-addresses:" found | ||
# Check that a server catches a parsing error during processing of | ||
# multi-value option bind-address. | ||
# Comma in the begining of a value of the option --bind-address | ||
# is treated as an error. | ||
Pattern "Invalid value for command line option bind-addresses:" found | ||
# Check that a server catches a parsing error during processing of | ||
# multi-value option bind-address. | ||
# empty value of the option --bind-address | ||
# is treated as an error. | ||
Pattern "Invalid value for command line option bind-addresses:" found | ||
# Check that a server catches a parsing error during processing of | ||
# multi-value option bind-address. | ||
# Check that specially treated ipv4 address 0.0.0.0 is not allowed | ||
# as part of multi-value option bind-address. | ||
Pattern "Invalid value for command line option bind-addresses:" found | ||
# Check that a server catches a parsing error during processing of | ||
# multi-value option bind-address. | ||
# empty value of the option --bind-address | ||
# is treated as an error. | ||
Pattern "Invalid value for command line option bind-addresses:" found | ||
# | ||
# Starting mysqld in the regular mode... | ||
# | ||
# restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# WL#11652 -- Support multiple addresses for the --bind-address command option | ||
# | ||
# Stop DB server which was created by MTR default | ||
# Check that not existing IP address as a value of | ||
# the option --bind-address is treated as an error. | ||
Pattern "Bind on TCP/IP port: Can't assign requested address" found | ||
# Check that not existing IP address as one of a value of | ||
# the option --bind-address is treated as an error. | ||
Pattern "Bind on TCP/IP port: Can't assign requested address" found | ||
# | ||
# Starting mysqld in the regular mode... | ||
# | ||
# restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--bind-address=127.0.0.1,::1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
--echo # | ||
--echo # WL#11652 -- Support multiple addresses for the --bind-address command option | ||
--echo # | ||
|
||
--source include/check_ipv6.inc | ||
|
||
--let $MYSQLD_LOG= $MYSQL_TMP_DIR/server.log | ||
--let $MYSQLD_DATADIR= `SELECT @@datadir` | ||
|
||
--echo # | ||
--echo # Server is started with --bind-address=127.0.0.1,::1 | ||
--echo # Check that server accepts incoming connection both | ||
--echo # on the address 127.0.0.1 and on the address ::1 | ||
--echo # | ||
--echo # Connecting to a server via 127.0.0.1 | ||
--connect(con1,127.0.0.1,root,,,,,TCP) | ||
|
||
--echo # Connecting to a server via ::1 | ||
--connect(con2,::1,root,,,,,TCP) | ||
|
||
--connection con1 | ||
--disconnect con1 | ||
|
||
--connection con2 | ||
--disconnect con2 | ||
|
||
--connection default | ||
SELECT @@global.bind_address; | ||
|
||
--echo # Stop DB server which was created by MTR default | ||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
--source include/shutdown_mysqld.inc | ||
|
||
--echo # | ||
--echo # Starting mysqld in the regular mode... | ||
--echo # | ||
--let $restart_parameters =restart: --bind-address=127.0.0.1 | ||
--source include/start_mysqld.inc | ||
SELECT @@global.bind_address; | ||
|
||
--echo # Stop DB server which was created by MTR default | ||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
--source include/shutdown_mysqld.inc | ||
|
||
--echo # | ||
--echo # Starting mysqld in the regular mode... | ||
--echo # | ||
--let $restart_parameters =restart: --bind-address=* | ||
--source include/start_mysqld.inc | ||
SELECT @@global.bind_address; | ||
|
||
--echo # Stop DB server which was created by MTR default | ||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
--source include/shutdown_mysqld.inc | ||
|
||
--echo # | ||
--echo # Starting mysqld in the regular mode... | ||
--echo # | ||
--let $restart_parameters =restart: --bind-address=:: | ||
--source include/start_mysqld.inc | ||
SELECT @@global.bind_address; | ||
|
||
--echo # Stop DB server which was created by MTR default | ||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
--source include/shutdown_mysqld.inc | ||
|
||
--echo # Check seperators not being ','. | ||
--error 1 | ||
--exec $MYSQLD --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR --no-defaults --secure-file-priv="" --bind-address=127.0.0.1 ::1 | ||
|
||
--let SEARCH_FILE=$MYSQLD_LOG | ||
--let SEARCH_PATTERN= Invalid value for command line option bind-addresses: | ||
|
||
--remove_file $MYSQLD_LOG | ||
|
||
--echo # Check that specially treated value :: is not allowed as part of | ||
--echo # multi-value option bind-address. | ||
--error 1 | ||
--exec $MYSQLD --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR --no-defaults --secure-file-priv="" --bind-address=127.0.0.1,::1,:: | ||
|
||
--let SEARCH_FILE=$MYSQLD_LOG | ||
--let SEARCH_PATTERN= Invalid value for command line option bind-addresses: | ||
--source include/search_pattern.inc | ||
|
||
--remove_file $MYSQLD_LOG | ||
|
||
--echo # Check that specially treated value * is not allowed as part of | ||
--echo # multi-value option bind-address. | ||
--error 1 | ||
--exec $MYSQLD --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR --no-defaults --secure-file-priv="" --bind-address=127.0.0.1,::1,* | ||
|
||
--let SEARCH_FILE=$MYSQLD_LOG | ||
--let SEARCH_PATTERN= Invalid value for command line option bind-addresses: | ||
--source include/search_pattern.inc | ||
|
||
--remove_file $MYSQLD_LOG | ||
|
||
--echo # Check that server catches a parsing error during processing of | ||
--echo # multi-value option bind-address. | ||
--echo # Two adjacent commas in a value of the option --bind-address is treated | ||
--echo # as an error. | ||
--error 1 | ||
--exec $MYSQLD --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR --no-defaults --secure-file-priv="" --bind-address=127.0.0.1,,::1 | ||
|
||
--let SEARCH_FILE=$MYSQLD_LOG | ||
--let SEARCH_PATTERN= Invalid value for command line option bind-addresses: | ||
--source include/search_pattern.inc | ||
|
||
--remove_file $MYSQLD_LOG | ||
|
||
--echo # Check that a server catches a parsing error during processing of | ||
--echo # multi-value option bind-address. | ||
--echo # Comma in the end of a value of the option --bind-address is treated | ||
--echo # as an error. | ||
--error 1 | ||
--exec $MYSQLD --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR --no-defaults --secure-file-priv="" --bind-address=127.0.0.1,::1, | ||
|
||
--let SEARCH_FILE=$MYSQLD_LOG | ||
--let SEARCH_PATTERN= Invalid value for command line option bind-addresses: | ||
--source include/search_pattern.inc | ||
|
||
--remove_file $MYSQLD_LOG | ||
|
||
--echo # Check that a server catches a parsing error during processing of | ||
--echo # multi-value option bind-address. | ||
--echo # Comma in the begining of a value of the option --bind-address | ||
--echo # is treated as an error. | ||
--error 1 | ||
--exec $MYSQLD --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR --no-defaults --secure-file-priv="" --bind-address=,127.0.0.1,::1 | ||
|
||
--let SEARCH_FILE=$MYSQLD_LOG | ||
--let SEARCH_PATTERN= Invalid value for command line option bind-addresses: | ||
--source include/search_pattern.inc | ||
|
||
--remove_file $MYSQLD_LOG | ||
|
||
--echo # Check that a server catches a parsing error during processing of | ||
--echo # multi-value option bind-address. | ||
--echo # empty value of the option --bind-address | ||
--echo # is treated as an error. | ||
--error 1 | ||
--exec $MYSQLD --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR --no-defaults --secure-file-priv="" --bind-address= | ||
|
||
--let SEARCH_FILE=$MYSQLD_LOG | ||
--let SEARCH_PATTERN= Invalid value for command line option bind-addresses: | ||
--source include/search_pattern.inc | ||
|
||
--remove_file $MYSQLD_LOG | ||
|
||
--echo # Check that a server catches a parsing error during processing of | ||
--echo # multi-value option bind-address. | ||
|
||
--echo # Check that specially treated ipv4 address 0.0.0.0 is not allowed | ||
--echo # as part of multi-value option bind-address. | ||
--error 1 | ||
--exec $MYSQLD --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR --no-defaults --secure-file-priv="" --bind-address=0.0.0.0,::1 | ||
|
||
--let SEARCH_FILE=$MYSQLD_LOG | ||
--let SEARCH_PATTERN= Invalid value for command line option bind-addresses: | ||
--source include/search_pattern.inc | ||
|
||
--remove_file $MYSQLD_LOG | ||
|
||
--echo # Check that a server catches a parsing error during processing of | ||
--echo # multi-value option bind-address. | ||
--echo # empty value of the option --bind-address | ||
--echo # is treated as an error. | ||
--error 1 | ||
--exec $MYSQLD --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR --no-defaults --secure-file-priv="" --bind-address= | ||
|
||
--let SEARCH_FILE=$MYSQLD_LOG | ||
--let SEARCH_PATTERN= Invalid value for command line option bind-addresses: | ||
--source include/search_pattern.inc | ||
|
||
--remove_file $MYSQLD_LOG | ||
|
||
--echo # | ||
--echo # Starting mysqld in the regular mode... | ||
--echo # | ||
--let $restart_parameters = | ||
|
||
--source include/start_mysqld.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--echo # | ||
--echo # WL#11652 -- Support multiple addresses for the --bind-address command option | ||
--echo # | ||
|
||
--source include/check_ipv6.inc | ||
--source include/not_windows.inc | ||
|
||
--let $MYSQLD_LOG= $MYSQL_TMP_DIR/server.log | ||
--let $MYSQLD_DATADIR= `SELECT @@datadir` | ||
|
||
--echo # Stop DB server which was created by MTR default | ||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
--source include/shutdown_mysqld.inc | ||
|
||
--echo # Check that not existing IP address as a value of | ||
--echo # the option --bind-address is treated as an error. | ||
--error 1 | ||
--exec $MYSQLD --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR --no-defaults --secure-file-priv="" --bind-address=128.0.0.1 | ||
|
||
--let SEARCH_FILE=$MYSQLD_LOG | ||
--let SEARCH_PATTERN= Bind on TCP/IP port: Can't assign requested address | ||
--source include/search_pattern.inc | ||
|
||
--remove_file $MYSQLD_LOG | ||
|
||
--echo # Check that not existing IP address as one of a value of | ||
--echo # the option --bind-address is treated as an error. | ||
--error 1 | ||
--exec $MYSQLD --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR --no-defaults --secure-file-priv="" --bind-address=128.0.0.1,::1 | ||
|
||
--let SEARCH_FILE=$MYSQLD_LOG | ||
--let SEARCH_PATTERN= Bind on TCP/IP port: Can't assign requested address | ||
--source include/search_pattern.inc | ||
|
||
--remove_file $MYSQLD_LOG | ||
|
||
--echo # | ||
--echo # Starting mysqld in the regular mode... | ||
--echo # | ||
--let $restart_parameters = | ||
|
||
--source include/start_mysqld.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.