Debian Codegraph @

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

raw
1 ################################################################################
2 # BUG#21141822 - GR(USABILITY): GROUP_REPLICATION_GROUP_NAME VAR IS NOT
3 # VALIDATED ON GROUP START
4 # BUG#21456559 - GR-GROUP-NAME SETS TO INCORRECT VALUE IF PASSED WITH
5 # 'GR-START-ON-BOOT'=ON
6 #
7 # This test verifies that group_name validation is done correctly when
8 # starting on boot as well as when we pass it manually in the test.
9 # Before this patch, the group_name with a length longer than the length of
10 # the valid UUID was being accepted which was causing problem going forward
11 # like assigning an invalid GTID to the GTID_EXECUTED value.
12 #
13 # Test:
14 # 0. The test requires one server: M1.
15 # 1. Starting the server with invalid group_name being passed on boot.
16 # 2. Asserting that the error due to invalid group name is being thrown.
17 # 3. Starting the server with boot option OFF.
18 # 4. Passing an incorrect value to group_name throws an error.
19 ################################################################################
20
21 --source include/have_group_replication_plugin.inc
22 --let $group_replication_group_name_invalid=aaaaaaaa-aaaa-aaaa-aaaa-invalidvalueused
23 --eval SET GLOBAL group_replication_group_name= "aeaeaeae-aeae-aeae-aeae-aeaeaeaeaeae"
24
25 SET SESSION sql_log_bin=0;
26 call mtr.add_suppression("is not a valid UUID");
27 call mtr.add_suppression("'group_replication' init function returned error");
28 SET SESSION sql_log_bin=1;
29
30 --echo
31 --let $rpl_connection_name= server1
32 --source include/rpl_connection.inc
33 --echo [ON SERVER1]
34 --source include/start_and_bootstrap_group_replication.inc
35
36 # Phase 1: Starting the server with invalid group_name being passed on boot
37 --let $allow_rpl_inited=1
38 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
39 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
40 --let $restart_parameters=restart:--group-replication-start-on-boot=1 --group-replication-group-name=$group_replication_group_name_invalid --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1
41 --replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
42 --source include/restart_mysqld.inc
43
44 --echo # Asserting that the error due to invalid group name is being thrown.
45 --let $grep_file=$MYSQLTEST_VARDIR/tmp/group_replication_group_name_error_on_boot.err
46 --let $grep_pattern=is not a valid UUID
47 --let $grep_output= print_count
48 --source include/grep_pattern.inc
49
50 # Starting the server with boot option OFF
51 --let $allow_rpl_inited=1
52 --let $restart_parameters=restart:--group-replication-start-on-boot=0 --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1
53 --replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
54 --source include/restart_mysqld.inc
55
56 # Phase 2: Passing an incorrect value to group_name throws an error
57 --error ER_WRONG_VALUE_FOR_VAR
58 --eval SET GLOBAL group_replication_group_name="$group_replication_group_name_invalid"
59
60 --source include/gr_clear_configuration.inc