Debian Codegraph @

mysql-test/suite/group_replication/t/gr_member_lengthy_hostname.test

raw
1 ################################################################################
2 #
3 # WL#12571: Support fully qualified hostnames longer than 60 characters
4 #
5 # This test validates that if the user sets up the member to report
6 # a specific hostname larger then 60 chars, the group replication
7 # performance_schema tables are able to display it.
8 #
9 ################################################################################
10 --let $group_replication_group_name= `SELECT UUID()`
11 --source include/have_group_replication_plugin.inc
12 --source include/force_restart.inc
13
14 --let $lengthy_hostname=host_1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890
15
16 --connection server1
17 --source include/start_and_bootstrap_group_replication.inc
18
19 --echo #####################################################################
20 --echo # 1.a Verify that when startup options report-host is not set, its value
21 --echo # shown on MEMBER_PORT value is as defined on rpl_1slave_base.cnf
22
23 --let $assert_text= The performance_schema.replication_group_members.MEMBER_HOST matches with hostname system variable
24 --let $assert_cond= "[SELECT MEMBER_HOST FROM performance_schema.replication_group_members]" = "127.0.0.1";
25 --source include/assert.inc
26
27 --echo #####################################################################
28 --echo # 2. Verify that when startup options report-host and report-port are
29 --echo # set, performance_schema.replication_group_members.MEMBER_HOST and
30 --echo # MEMBER_PORT are set equal to report-host and report-port.
31
32 --let $new_host= $lengthy_hostname
33 --let $new_port= 24844
34
35 # restart server with report-host and report-port parameters
36 --let $allow_rpl_inited=1
37 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
38 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
39 --let $restart_parameters=restart:--report-host=$new_host --report-port=$new_port --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds
40 --replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
41 --source include/restart_mysqld.inc
42
43 --let $rpl_connection_name= server1
44 --source include/rpl_connection.inc
45 --enable_reconnect
46
47 --source include/start_and_bootstrap_group_replication.inc
48
49 --let $i=1
50 while($i>0)
51 {
52 if ($i == 1)
53 {
54 #
55 # 1. Assertion: assert that the hostname reported in SHOW SLAVE STATUS is correct
56 #
57 --let $hostname_read= `SELECT MEMBER_HOST FROM performance_schema.replication_group_members`
58 --let $hostname_source= performance_schema.replication_group_members
59 }
60
61 --let $assert_cond= "$hostname_read" = "$lengthy_hostname"
62 --let $assert_text= Hostname in $hostname_source matches the one set through CHANGE MASTER TO
63 --source include/assert.inc
64
65 --dec $i
66 }
67
68 --source include/stop_group_replication.inc
69
70 # clean up
71 --let $restart_parameters=