| 1 |
# |
| 2 |
#BUG#13333431 : INCORRECT DEFAULT PORT IN 'SHOW SLAVE HOSTS' OUTPUT |
| 3 |
# |
| 4 |
# ==== Purpose ==== |
| 5 |
# |
| 6 |
# The test show the default value printed for the slave's port number if the |
| 7 |
# --report-port= <some value> is not set on the slave. This is different from |
| 8 |
# the present scenario which show 3306 as the default value if the report-port |
| 9 |
# is not set on the slave. |
| 10 |
# |
| 11 |
#====Method==== |
| 12 |
# |
| 13 |
# Start replication with report port set to 9000 and restart the slave. |
| 14 |
# In this case on doing SHOW SLAVE HOSTS on the master, we get the port number |
| 15 |
# of the slave to be 9000. |
| 16 |
# In the second case restart the slave server with report port not set. In this |
| 17 |
# case on doing SHOW SLAVE HOSTS on the master, we get the actual port number |
| 18 |
# of the slave (ie. SLAVE_PORT). |
| 19 |
|
| 20 |
source include/master-slave.inc; |
| 21 |
source include/have_binlog_format_mixed.inc; |
| 22 |
|
| 23 |
connection master; |
| 24 |
|
| 25 |
# Start the server with some value being passed to the report_port= <option> |
| 26 |
# this will be used incase we have to mask the value of the slave's port |
| 27 |
# number in certain situations. |
| 28 |
|
| 29 |
--let $rpl_server_number= 2 |
| 30 |
--let $rpl_server_parameters= --report-port=9000 |
| 31 |
--source include/rpl_restart_server.inc |
| 32 |
|
| 33 |
connection slave; |
| 34 |
--source include/start_slave.inc |
| 35 |
--let $slave_param= Slave_IO_State |
| 36 |
--let $slave_param_value= Waiting for source to send event |
| 37 |
--source include/wait_for_slave_param.inc |
| 38 |
|
| 39 |
--echo [Slave restarted with the report-port set to some value] |
| 40 |
connection master; |
| 41 |
|
| 42 |
# 9000 is the value of the port we should get. |
| 43 |
--let $report_port= query_get_value(SHOW SLAVE HOSTS, Port, 1) |
| 44 |
--let assert_text= The value shown for the slave's port number is user specified port number which is the value set for report-port. |
| 45 |
--let assert_cond= $report_port = "9000" |
| 46 |
--source include/assert.inc |
| 47 |
|
| 48 |
# Start the server with the report-port being passed with no value. So on SHOW SLAVE HOSTS |
| 49 |
# on the master the value of slave's port should be the actual value of the slave port. |
| 50 |
connection master; |
| 51 |
|
| 52 |
--let $rpl_server_number= 2 |
| 53 |
--let $rpl_server_parameters= |
| 54 |
--source include/rpl_restart_server.inc |
| 55 |
|
| 56 |
connection slave; |
| 57 |
--source include/start_slave.inc |
| 58 |
--let $slave_param= Slave_IO_State |
| 59 |
--let $slave_param_value= Waiting for source to send event |
| 60 |
--source include/wait_for_slave_param.inc |
| 61 |
|
| 62 |
connection master; |
| 63 |
--source include/sync_slave_sql_with_master.inc |
| 64 |
--echo [Slave restarted with the report-port set to the value of slave's port number] |
| 65 |
|
| 66 |
connection master; |
| 67 |
|
| 68 |
# The value reported is the actual value of the slave's port. |
| 69 |
--let $report_port= query_get_value(SHOW SLAVE HOSTS, Port, 1) |
| 70 |
--let assert_text= The default value shown for the slave's port number is the actual port number of the slave. |
| 71 |
--let assert_cond= $report_port = "$SLAVE_MYPORT" |
| 72 |
--source include/assert.inc |
| 73 |
|
| 74 |
--source include/rpl_end.inc |