diff --git a/mysql-test/include/show_slave_hosts.inc b/mysql-test/include/show_slave_hosts.inc new file mode 100644 index 00000000000..e27c1bfb09c --- /dev/null +++ b/mysql-test/include/show_slave_hosts.inc @@ -0,0 +1,3 @@ +--replace_result $SLAVE_MYPORT SLAVE_PORT $DEFAULT_MASTER_PORT DEFAULT_PORT +--replace_regex /[0-9, a-f]{8}-[0-9, a-f]{4}-[0-9, a-f]{4}-[0-9, a-f]{4}-[0-9, a-f]{12}/SLAVE_UUID/ +SHOW SLAVE HOSTS; diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 3df31eeebd5..36649cf761d 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -915,7 +915,7 @@ relay-log-space-limit 0 replicate-same-server-id FALSE report-host (No default value) report-password (No default value) -report-port 3306 +report-port 0 report-user (No default value) rpl-recovery-rank 0 safe-user-create FALSE diff --git a/mysql-test/suite/rpl/r/rpl_report_port.result b/mysql-test/suite/rpl/r/rpl_report_port.result new file mode 100644 index 00000000000..d5a684241bc --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_report_port.result @@ -0,0 +1,15 @@ +include/master-slave.inc +[connection master] +[The default value shown for the slave's port number is the actual port number of the slave] +SHOW SLAVE HOSTS; +Server_id Host Port Master_id +2 127.0.0.1 SLAVE_PORT 1 +[The default value shown for the slave's port number is the actual port number of the slave] +include/rpl_restart_server.inc [server_number=2 parameters: --report-port=9000] +include/start_slave.inc +[Slave restarted with the report-port set to some value] +[The value shown for the slave's port number is 9000 which is the value set for report-port] +SHOW SLAVE HOSTS; +Server_id Host Port Master_id +2 127.0.0.1 9000 1 +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result index 2ada5670e04..16d71e125ab 100644 --- a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result +++ b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result @@ -6,7 +6,7 @@ START SLAVE IO_THREAD; include/wait_for_slave_io_to_start.inc SHOW SLAVE HOSTS; Server_id Host Port Master_id -3 slave2 DEFAULT_PORT 1 +3 slave2 SLAVE_PORT 1 2 SLAVE_PORT 1 include/stop_slave_io.inc SHOW SLAVE HOSTS; diff --git a/mysql-test/suite/rpl/t/rpl_report_port-slave.opt b/mysql-test/suite/rpl/t/rpl_report_port-slave.opt new file mode 100644 index 00000000000..ffe2b2e7016 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_report_port-slave.opt @@ -0,0 +1 @@ +--report-port= diff --git a/mysql-test/suite/rpl/t/rpl_report_port.test b/mysql-test/suite/rpl/t/rpl_report_port.test new file mode 100644 index 00000000000..11cb9684090 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_report_port.test @@ -0,0 +1,59 @@ +# +#BUG#13333431 : INCORRECT DEFAULT PORT IN 'SHOW SLAVE HOSTS' OUTPUT +# +# ==== Purpose ==== +# +# The test show the default value printed for the slave's port number if the +# --report-port= is not set on the slave. This is different from +# the present scenario which show 3306 as the default value if the report-port +# is not set on the slave. +# +#====Method==== +# +# Start replication with report port not set.This will give the actual port +# number of the slave (ie. SLAVE_PORT) for the on doing SHOW SLAVE HOSTS on +# the master. +# Restart the slave server with report port set to 9000 and start the slave. +# In this case on doing SHOW SLAVE HOSTS on the master, we get the port number +# of the slave to be 9000. + +source include/master-slave.inc; + +connection master; + +--echo [The default value shown for the slave's port number is the actual port number of the slave] +source include/show_slave_hosts.inc; + +# SLAVE_PORT is the value of the port we should get. + +let $show_statement= SHOW SLAVE HOSTS; +let $field= Port; +let $condition= 'SLAVE_PORT'; +source include/wait_show_condition.inc; +--echo [The default value shown for the slave's port number is the actual port number of the slave] + +# Start the server with some value being passed to the report_port=