summaryrefslogtreecommitdiff
path: root/mysql-test/include/show_slave_hosts.inc
diff options
context:
space:
mode:
authorManish Kumar <manish.4.kumar@oracle.com>2012-02-28 14:02:27 +0530
committerManish Kumar <manish.4.kumar@oracle.com>2012-02-28 14:02:27 +0530
commit9e048a6bc556f909613cca1fa9b9007ec3546092 (patch)
tree9774748c4ef8ccbaec37ddc401f9721cc4bc77e3 /mysql-test/include/show_slave_hosts.inc
parent2367e79e4c531c74a8f1da8107f955c4cae48f49 (diff)
parent26c9f1da82906532d5f132b5fa9f4ab9425d687e (diff)
downloadmariadb-git-9e048a6bc556f909613cca1fa9b9007ec3546092.tar.gz
BUG#13333431 - INCORRECT DEFAULT PORT IN 'SHOW SLAVE HOSTS' OUTPUT
Problem - The default port number shown in SHOW SLAVE HOSTS is always 3306 though the slave is actually listening on a different port number. This is a problem as the user can not be sure whether this port value can be trusted and so client trying to read replication topology can get confused. Fix - 3306 ceases to be the default value of report-port. Moreover report-port does not have a static default any longer. Instead we initialize report-port to 0 as the new default value and change it based on two checks : 1) If report_port is not set, the slave reports the port number its listening on. (i.e. if report-port is not set we get the actual value of the slave's port number). 2) If report-port is set, we show the value report-port is set to, as the slave's port number. mysql-test/include/show_slave_hosts.inc: A .inc file is added to use show slave hosts in the new test added. mysql-test/r/mysqld--help-notwin.result: Updated the result file to show the default value passed for report-port. mysql-test/suite/rpl/r/rpl_report_port.result: The result file for the new test that is added. mysql-test/suite/rpl/r/rpl_show_slave_hosts.result: Updated the result file to show the default value passed for report-port. mysql-test/suite/rpl/t/rpl_report_port-slave.opt: Option file for the new test added. mysql-test/suite/rpl/t/rpl_report_port.test: Added a test to check the correct functionality of report-port. We check this by running the replication twice. In the first run we do not set the value of report-port through the opt file and get the actual port number of the slave's port. We then restart the server with report-port set to some value (in this case 9000) and check the value reported for the slave's port number. mysql-test/suite/sys_vars/t/report_port_basic.test: Update the test file to show the value for report-port. It is replaced with SLAVE_PORT as the actual value of the report-port will change with each run. sql/mysqld.cc: Changed the value reported by report port : 1. If the value for report-port is not set we assign report-port to be the actual port number of the slave (mysqld_port). 2. If report-port is set we get the value set for the report-port. sql/sys_vars.cc: Passed 0 as the default value of the report-port.
Diffstat (limited to 'mysql-test/include/show_slave_hosts.inc')
-rw-r--r--mysql-test/include/show_slave_hosts.inc3
1 files changed, 3 insertions, 0 deletions
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;